aboutsummaryrefslogtreecommitdiff
path: root/docs/file_locations.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/file_locations.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/file_locations.md')
-rw-r--r--docs/file_locations.md110
1 files changed, 110 insertions, 0 deletions
diff --git a/docs/file_locations.md b/docs/file_locations.md
new file mode 100644
index 00000000..d8e1c684
--- /dev/null
+++ b/docs/file_locations.md
@@ -0,0 +1,110 @@
1# File locations
2
3This is a summary of all file paths related to LuaRocks, including the files
4that compose LuaRocks (its scripts and modules), files installed by LuaRocks
5(Lua modules and scripts), and files required by LuaRocks (programs, libraries
6and headers).
7
8For each path, the default value is also listed.
9
10Whenever "5.x" is used, it refers to the Lua version you configured during
11installation.
12
13# Path to LuaRocks
14
15* LuaRocks command-line scripts. These are the main LuaRocks commands
16 (`luarocks`, `luarocks-admin`); it should be in your system PATH.
17
18 * Unix default: /usr/local/bin
19
20* LuaRocks modules. These are Lua modules (`luarocks.fs`, etc.) used by
21 LuaRocks. The LuaRocks command-line tools are configured during installation
22 to be able to find those files.
23
24 * Unix default: /usr/local/share/lua/5.x/
25
26# Path to Lua binaries and associated data
27
28* Lua interpreter. Where to find the Lua interpreter to execute scripts and
29 LuaRocks itself.
30
31 * Unix default: /usr/local/bin/lua
32
33* Lua libraries. The directory containing the Lua virtual machine as a shared
34 library. On some platforms, Lua modules written in C (also called "C
35 modules") should link against this library
36
37 * Unix default: /usr/local/lib
38
39* Lua header files (lua.h, etc.). They are required when compiling C modules.
40
41 * Unix default: /usr/local/include
42
43On Unix, those locations vary according to your OS variant or distribution. If
44you're using a Linux distribution, for example, you may have installed Lua
45using your package manager and paths use /usr/ rather than /usr/local/, and
46the `lua` binary may be called `lua-5.x`.
47
48For Windows users, having libraries and headers around may be uncommon, as
49Windows tends to have binary distributions. LuaRocks can provide binary rocks,
50but rocks in the standard repository are often available only as source code
51and need to be compiled during the installation process.
52
53# Paths to rocks trees
54
55LuaRocks by default is configured to use two rocks trees:
56
57* System-wide [rock tree](rocks_repositories.md) (used by default)
58 * Unix default: /usr/local/
59* Per-user [rock tree](rocks_repositories.md) (may be selected by the user with the --local flag).
60 * Unix default: $HOME/.luarocks/
61
62In order to use the modules installed in the rock trees, the [deployment
63directories](rocks_repositories.md) should be in the `LUA_PATH` and
64`LUA_CPATH` environment variables.
65
66On Unix, performing a vanilla installation of Lua from lua.org and a vanilla
67installation of LuaRocks will install both under /usr/local, meaning that the
68environment variables for the system-wide rock tree are correct by default.
69
70The command `[luarocks path](luarocks_path.md)` outputs the correct environment
71variables set for a rock tree.
72
73# Path where command-line scripts are installed
74
75Rocks may also deploy command-line scripts. This location is relative to the
76rock tree where they are installed:
77
78* System-wide [rock tree](rocks_repositories.md) (used by default)
79
80 * Unix default: /usr/local/bin/
81
82* Per-user [rock tree](rocks_repositories.md) (may be selected by the user
83 with the --local flag).
84
85 * Unix default: $HOME/.luarocks/bin/
86
87To be able to call those scripts from the shell, the location where they are
88installed need to be in your environment path.
89
90On Unix, /usr/local/bin is usually in the $PATH by default, but
91$HOME/.luarocks/bin is not.
92
93The command `[luarocks path](luarocks_path.md) --bin` outputs the correct PATH
94environment variables set for a rock tree.
95
96# Compiler
97
98For compiling modules written in C, you need a compiler toolchain installed.
99
100For many platforms this is a non-issue: Linux distribution often include
101`gcc` (the default installation of Ubuntu, notably, ships without build
102tools by default: run `sudo apt-get install build-essential`).
103
104On Windows, where binary distribution is the standard, this might be an
105additional requirement. Because more rocks are available as source code than
106as binary rocks, it is probably best to have a C compiler available. LuaRocks
107supports MinGW and the Microsoft Visual Studio toolchains. The compiler should
108be in the system path, or explicitly configured in the LuaRocks config files.
109
110