diff options
Diffstat (limited to 'docs/file_locations.md')
-rw-r--r-- | docs/file_locations.md | 110 |
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 | |||
3 | This is a summary of all file paths related to LuaRocks, including the files | ||
4 | that compose LuaRocks (its scripts and modules), files installed by LuaRocks | ||
5 | (Lua modules and scripts), and files required by LuaRocks (programs, libraries | ||
6 | and headers). | ||
7 | |||
8 | For each path, the default value is also listed. | ||
9 | |||
10 | Whenever "5.x" is used, it refers to the Lua version you configured during | ||
11 | installation. | ||
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 | |||
43 | On Unix, those locations vary according to your OS variant or distribution. If | ||
44 | you're using a Linux distribution, for example, you may have installed Lua | ||
45 | using your package manager and paths use /usr/ rather than /usr/local/, and | ||
46 | the `lua` binary may be called `lua-5.x`. | ||
47 | |||
48 | For Windows users, having libraries and headers around may be uncommon, as | ||
49 | Windows tends to have binary distributions. LuaRocks can provide binary rocks, | ||
50 | but rocks in the standard repository are often available only as source code | ||
51 | and need to be compiled during the installation process. | ||
52 | |||
53 | # Paths to rocks trees | ||
54 | |||
55 | LuaRocks 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 | |||
62 | In order to use the modules installed in the rock trees, the [deployment | ||
63 | directories](rocks_repositories.md) should be in the `LUA_PATH` and | ||
64 | `LUA_CPATH` environment variables. | ||
65 | |||
66 | On Unix, performing a vanilla installation of Lua from lua.org and a vanilla | ||
67 | installation of LuaRocks will install both under /usr/local, meaning that the | ||
68 | environment variables for the system-wide rock tree are correct by default. | ||
69 | |||
70 | The command `[luarocks path](luarocks_path.md)` outputs the correct environment | ||
71 | variables set for a rock tree. | ||
72 | |||
73 | # Path where command-line scripts are installed | ||
74 | |||
75 | Rocks may also deploy command-line scripts. This location is relative to the | ||
76 | rock 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 | |||
87 | To be able to call those scripts from the shell, the location where they are | ||
88 | installed need to be in your environment path. | ||
89 | |||
90 | On Unix, /usr/local/bin is usually in the $PATH by default, but | ||
91 | $HOME/.luarocks/bin is not. | ||
92 | |||
93 | The command `[luarocks path](luarocks_path.md) --bin` outputs the correct PATH | ||
94 | environment variables set for a rock tree. | ||
95 | |||
96 | # Compiler | ||
97 | |||
98 | For compiling modules written in C, you need a compiler toolchain installed. | ||
99 | |||
100 | For many platforms this is a non-issue: Linux distribution often include | ||
101 | `gcc` (the default installation of Ubuntu, notably, ships without build | ||
102 | tools by default: run `sudo apt-get install build-essential`). | ||
103 | |||
104 | On Windows, where binary distribution is the standard, this might be an | ||
105 | additional requirement. Because more rocks are available as source code than | ||
106 | as binary rocks, it is probably best to have a C compiler available. LuaRocks | ||
107 | supports MinGW and the Microsoft Visual Studio toolchains. The compiler should | ||
108 | be in the system path, or explicitly configured in the LuaRocks config files. | ||
109 | |||
110 | |||