diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2025-01-05 21:40:39 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2025-02-21 11:22:43 -0300 |
commit | 7e86fa86b4d08fd6118d6eab46d92b29ffea791e (patch) | |
tree | 10fdd12beed4b0eca408533ad11d1f52d7d62e10 /docs/hosting_binary_rocks.md | |
parent | 1ada2ea4bbd94ac0c58e3e2cc918194140090a75 (diff) | |
download | luarocks-7e86fa86b4d08fd6118d6eab46d92b29ffea791e.tar.gz luarocks-7e86fa86b4d08fd6118d6eab46d92b29ffea791e.tar.bz2 luarocks-7e86fa86b4d08fd6118d6eab46d92b29ffea791e.zip |
docs: import Wiki docs into the main repo
Diffstat (limited to 'docs/hosting_binary_rocks.md')
-rw-r--r-- | docs/hosting_binary_rocks.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/hosting_binary_rocks.md b/docs/hosting_binary_rocks.md new file mode 100644 index 00000000..1df055ab --- /dev/null +++ b/docs/hosting_binary_rocks.md | |||
@@ -0,0 +1,41 @@ | |||
1 | # Hosting binary rocks | ||
2 | |||
3 | At the moment, LuaRocks.org hosts only rockspecs and src.rock files, and not | ||
4 | binary rocks. But you can host your own repository of binary rocks at any | ||
5 | static HTTP server (for example, Github Pages). | ||
6 | |||
7 | Suppose you want to host a binary rock for a rock of yours named `my_rock`: | ||
8 | |||
9 | Step 1: build your rocks with `luarocks build my_rock`. This will compile your | ||
10 | rocks locally in your system. After a successful build, you should see them | ||
11 | installed with `luarocks list`. | ||
12 | |||
13 | Step 2: create binary rocks from using `luarocks pack my_rock`. This will | ||
14 | create a binary rock file, named after your operating system and processor, | ||
15 | for example, `my_rock-1.0-1-macosx-x86_64.rock`. Note that this binary is | ||
16 | dependent on library versions of your own machine. This is more of an issue in | ||
17 | some operating systems than others (Linux binaries are very picky with library | ||
18 | dependencies, so it's helpful to build binaries on older distros for greater | ||
19 | compatibility.) | ||
20 | |||
21 | Step 2.5: if your rock has dependencies, repeat step 2 for them as well. | ||
22 | |||
23 | Step 3: create a new directory `my_dir`, copy your rock binary into it (and | ||
24 | possibly your rockspec and src.rock as well, for a nice one-stop-shop of your | ||
25 | rock) and run `luarocks-admin make-manifest my_dir`. This will create files | ||
26 | named `manifest-*` in it, which turn this directory into a working LuaRocks | ||
27 | server. You can even use it locally: `luarocks install --server=my_dir | ||
28 | my_rock` should work! | ||
29 | |||
30 | Step 4: upload the contents of `my_dir`, manifest files and rocks, into a HTTP | ||
31 | server and use its URL as the argument of `--server`. For example, if you | ||
32 | uploaded it into `http://example.com/binary-rock/manifest-5.3` and | ||
33 | `http://example.com/binary-rock/my-rock-1.0-1-macosx-x86_64.rock`, then using | ||
34 | `luarocks install --server=http://example.com/binary-rock my_rock` should | ||
35 | fetch the manifest, read it, find the rock name, download it and install it. | ||
36 | |||
37 | Note that in a repo that contains both binary and source rocks, running | ||
38 | `luarocks install http://example.com/binary-rock my_rock` will download and | ||
39 | install the binary rock, and `luarocks build http://example.com/binary-rock | ||
40 | my_rock` will download, compile and install the source rock. | ||
41 | |||