aboutsummaryrefslogtreecommitdiff
path: root/docs/hosting_binary_rocks.md
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2025-01-05 21:40:39 -0300
committerHisham Muhammad <hisham@gobolinux.org>2025-02-21 11:22:43 -0300
commit7e86fa86b4d08fd6118d6eab46d92b29ffea791e (patch)
tree10fdd12beed4b0eca408533ad11d1f52d7d62e10 /docs/hosting_binary_rocks.md
parent1ada2ea4bbd94ac0c58e3e2cc918194140090a75 (diff)
downloadluarocks-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.md41
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
3At the moment, LuaRocks.org hosts only rockspecs and src.rock files, and not
4binary rocks. But you can host your own repository of binary rocks at any
5static HTTP server (for example, Github Pages).
6
7Suppose you want to host a binary rock for a rock of yours named `my_rock`:
8
9Step 1: build your rocks with `luarocks build my_rock`. This will compile your
10rocks locally in your system. After a successful build, you should see them
11installed with `luarocks list`.
12
13Step 2: create binary rocks from using `luarocks pack my_rock`. This will
14create a binary rock file, named after your operating system and processor,
15for example, `my_rock-1.0-1-macosx-x86_64.rock`. Note that this binary is
16dependent on library versions of your own machine. This is more of an issue in
17some operating systems than others (Linux binaries are very picky with library
18dependencies, so it's helpful to build binaries on older distros for greater
19compatibility.)
20
21Step 2.5: if your rock has dependencies, repeat step 2 for them as well.
22
23Step 3: create a new directory `my_dir`, copy your rock binary into it (and
24possibly your rockspec and src.rock as well, for a nice one-stop-shop of your
25rock) and run `luarocks-admin make-manifest my_dir`. This will create files
26named `manifest-*` in it, which turn this directory into a working LuaRocks
27server. You can even use it locally: `luarocks install --server=my_dir
28my_rock` should work!
29
30Step 4: upload the contents of `my_dir`, manifest files and rocks, into a HTTP
31server and use its URL as the argument of `--server`. For example, if you
32uploaded 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
35fetch the manifest, read it, find the rock name, download it and install it.
36
37Note 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
39install the binary rock, and `luarocks build http://example.com/binary-rock
40my_rock` will download, compile and install the source rock.
41