Login or register Large RSS Icon

Config file format

The LuaRocks configuration file is a Lua file containing assignments. Default values are assumed for variables that are not assigned explicitly in the configuration file. The location of the configuration file can be configured through flags during installation. If no --force-config or /FORCECONFIG flags were used on installation, the LUAROCKS_CONFIG environment variable can be used as well. The default value is platform-dependent; exact paths depends on flags given during installation, but on Unix systems it would be something like $PREFIX/etc/luarocks/config.lua; on Windows systems, c:\luarocks\config.lua.

Locations

  • rocks_trees (array of strings) - The path to the local rocks trees, where rocks are installed. When installing rocks, LuaRocks tries to pick a location to store the rock starting from the bottom of the list; when loading rocks in runtime, LuaRocks scans from the top of the list. This way, if one has the local dir first and the system-wide dir last (this is what the default installation does, for instance), rocks installed by the user take precedence over rocks installed system-wide, and rocks installed by the admin user go to the system-wide dir while user installations go to their home directory.
  • rocks_servers (array of strings) - Remote URLs or local pathnames of rocks servers: directories containing .rock or .rockspec files, and a "manifest" file, generated by the luarocks-admin make_manifest command. Default is { "http://luarocks.luaforge.net/rocks" }.
  • external_deps_dirs (array of strings) - Where to look for external dependencies, when a prefix is not set for a specific dependency in the _variables_ table (see below) or through the command-line. Default is { "/usr/local", "/usr" } on Unix; { "c:\\external" } on Windows.

File upload

The next release of LuaRocks (currently available only in SVN) will support uploading rocks and rockspecs to remote servers through luarocks-admin. These are the related config entries:

  • upload_server (string) - An FTP URL for a rock server (optionally including username and password), or an alias specified in the upload_servers table. Example: "ftp://user:password@ftp.luaforge.net/project/htdocs/rocks"
  • upload_user (string) - Default login name rock servers.
  • upload_password (string) - Default password rock servers.
  • upload_servers (table with string keys and table values) - A list of aliases for URLs, to be used for accessing repositories through various protocols. Each entry has a string alias as a key and a table as a value. This table value contains protocol names as keys and pathnames as values. Protocols "http", "ftp" and "sftp" are supported. Example: { rocks = { http = "www.example.com/rocks", sftp = "example.com/var/rocks" } }

Platform-specific settings

  • lua_extension (string) - Filename extension of Lua files (without the dot/separator). Default is "lua".
  • lib_extension (string) - Filename extension of dynamic library files (without the dot/separator). Default is "so" on Unix; "dll" on Windows.
  • arch (string) - A two-part string identifying operating system and hardware architecture, for filtering binary rocks. This value is autodetected by LuaRocks. Example values are "macosx-powerpc" and "win32-x86".
  • platforms (array of string) - A list of string identifiers indicating which platform constraints can be satisfied by the running system. This is used for filtering commands on the LuaRocks build rules. This allows a more general platform definition such as "unix" when the same build commands are valid for all Unix variants, instead of enumerating all known valid arch entries, and at the same time using a more specific definition such as "macosx" when a platform-specific flag is used. This value is automatically filled according to the value of *arch*.
  • external_deps_patterns (table) (since 0.6) - Name patterns to be used when matching dependencies in a portable way.

Variables

  • variables (table) - A table containing string-to-string key-value pairs containing variables to be substituted by build rules in rockspecs. LuaRocks provides a general facility for build back-ends in which they can substitute the entries of this table in strings containing references written $(LIKE_THIS). Some standard variables are expected by the included back-ends. For example, the "make" back-end expects the LIBFLAG to contain the flag to be passed to the C compiler to instruct it to build a shared library. So, in Linux systems, the variables["LIBFLAG"] = "-shared". LuaRocks also adds entries to this table according to the rock being compiled, to make values available to the build back-end. These are:
    • PREFIX - The installation prefix of the rock (absolute path inside the rocks tree). Example: "/home/hisham/.luarocks/5.1/foo/1.0-1/"
    • LUADIR - Directory for storing Lua modules written in Lua (absolute path inside the rock entry of the rocks tree). Example: "/home/hisham/.luarocks/5.1/foo/1.0-1/lua/"
    • LIBDIR - Directory for storing Lua modules written in C (absolute path inside the rock entry of the rocks tree). Example: "/home/hisham/.luarocks/5.1/foo/1.0-1/lib/"
    • BINDIR - Directory for storing command-line scripts (absolute path inside the rock entry of the rocks tree). Example: "/home/hisham/.luarocks/5.1/foo/1.0-1/bin/"
    • CONFDIR - Directory for storing configuration files for a module (absolute path inside the rock entry of the rocks tree). Example: "/home/hisham/.luarocks/5.1/foo/1.0-1/conf/"

Other

  • cmake_generator (string) - If specified it overrides the default cmake generator. Currently only Makefile-based generators are supported.
Powered by Sputnik | XHTML 1.1