diff options
Diffstat (limited to '')
-rw-r--r-- | docs/rockspec_format.md | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/docs/rockspec_format.md b/docs/rockspec_format.md index edb35632..3a7dfd3d 100644 --- a/docs/rockspec_format.md +++ b/docs/rockspec_format.md | |||
@@ -11,28 +11,28 @@ For number fields, strings are accepted and converted using tonumber(). | |||
11 | * **description.summary** (string) - A one-line description of the package. Example: "Network support for the Lua language" | 11 | * **description.summary** (string) - A one-line description of the package. Example: "Network support for the Lua language" |
12 | * **description.detailed** (string) - A longer description of the package. Example: "LuaSocket is a Lua extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for functionality commonly needed by applications that deal with the Internet." | 12 | * **description.detailed** (string) - A longer description of the package. Example: "LuaSocket is a Lua extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for functionality commonly needed by applications that deal with the Internet." |
13 | * **description.license** (string) - The license used by the package. A short name, such as "MIT" and "GPL-2" is preferred. Software using the same license as Lua 5.x should use "MIT". | 13 | * **description.license** (string) - The license used by the package. A short name, such as "MIT" and "GPL-2" is preferred. Software using the same license as Lua 5.x should use "MIT". |
14 | * **description.homepage** (string) - An URL for the project. This is not the URL for the tarball, but the address of a website. Example: "http://github.com/keplerproject/rings" | 14 | * **description.homepage** (string) - An URL for the project. This is not the URL for the tarball, but the address of a website. Example: "https://github.com/keplerproject/rings" |
15 | * **description.issues_url** (string) (since 3.0) - An URL for the project's issue tracker. Example: "http://github.com/keplerproject/rings/issues" | 15 | * **description.issues_url** (string) (since 3.0) - An URL for the project's issue tracker. Example: "https://github.com/keplerproject/rings/issues" |
16 | * **description.maintainer** (string) - Contact information for the _rockspec_ maintainer (which may or may not be the package maintainer -- contact for the package maintainer can usually be obtained through the address in the homepage field). Example: "John Doe <john@doe.gov>" | 16 | * **description.maintainer** (string) - Contact information for the _rockspec_ maintainer (which may or may not be the package maintainer -- contact for the package maintainer can usually be obtained through the address in the homepage field). Example: "John Doe <john@doe.gov>" |
17 | * **description.labels** (array of strings) (since 3.0) - A list of short strings that specify labels for categorization of this rock. See the list of labels at [http://luarocks.org] for inspiration. Example: { "crypto", "network", "tls", "https" } | 17 | * **description.labels** (array of strings) (since 3.0) - A list of short strings that specify labels for categorization of this rock. See the list of labels at [https://luarocks.org] for inspiration. Example: { "crypto", "network", "tls", "https" } |
18 | 18 | ||
19 | ## Dependency information | 19 | ## Dependency information |
20 | 20 | ||
21 | Dependencies are represented in LuaRocks through strings with a package name followed by a comma-separated list of constraints. Each constraint consists of an operator and a version number. In this string format, version numbers are represented as naturally as possible, like they are used by upstream projects (e.g. "2.0beta3"). Internally, LuaRocks converts them to a purely numeric representation, allowing comparison following some common sense heuristics. The precise specification of the comparison criteria is the source code of the luarocks.deps module, but the test/test_deps.lua file included with LuaRocks provides some insights on what these criteria are. | 21 | Dependencies are represented in LuaRocks through strings with a package name followed by a comma-separated list of constraints. Each constraint consists of an operator and a version number. In this string format, version numbers are represented as naturally as possible, like they are used by upstream projects (e.g. "2.0beta3"). Internally, LuaRocks converts them to a purely numeric representation, allowing comparison following some common sense heuristics. The precise specification of the comparison criteria is the source code of the luarocks.deps module, but the test/test_deps.lua file included with LuaRocks provides some insights on what these criteria are. |
22 | 22 | ||
23 | * **supported_platforms** (array of strings) - If this array is not present, the rock is assumed to be portable to any platform. If present, this should contain strings containing LuaRocks platform identifiers, optionally preceded by a "!" to indicate a negative match. If only negative entries are listed, the rock is assumed to be portable to any platform except those listed. If any positive entry exists, then at least one entry must match positively to the currently running platform. Currently supported LuaRocks platform identifiers are: "unix", "windows", "win32", "cygwin", "macosx", "linux", "freebsd". Platforms may have more than one valid identifier; e.g. Linux defines both "unix" and "linux". Note that, as of 0.6, Cygwin under Windows defines {"unix", "cygwin"} but *not* "windows". | 23 | * **supported_platforms** (array of strings) - If this array is not present, the rock is assumed to be portable to any platform. If present, this should contain strings containing LuaRocks platform identifiers, optionally preceded by a "!" to indicate a negative match. If only negative entries are listed, the rock is assumed to be portable to any platform except those listed. If any positive entry exists, then at least one entry must match positively to the currently running platform. Currently supported LuaRocks platform identifiers are: "unix", "windows", "win32", "cygwin", "macosx", "linux", "freebsd". Platforms may have more than one valid identifier; e.g. Linux defines both "unix" and "linux". Note that, as of 0.6, Cygwin under Windows defines {"unix", "cygwin"} but *not* "windows". |
24 | * **dependencies** (array of strings) - Each string represents a package this rock depends on, containing a package name followed by a comma-separated list of constraints. Example: `{"lfs >= 1.0, < 2.0"}`. Accepted operators are the relational operators of Lua: `==` `~=` `<` `>` `<=` `>=` , as well as a special operator, `~>`, inspired by the "pessimistic operator" of RubyGems (`"~> 2"` means `">= 2, < 3"`; `"~> 2.4"` means `">= 2.4, < 2.5"`). The absence of an operator means an implicit `==` (i.e., `"lfs 1.0"` is the same as `"lfs == 1.0"`). "lua" is an special dependency name; it matches not a rock, but the version of Lua in use. Supports [per-platform overrides](platform-overrides). | 24 | * **dependencies** (array of strings) - Each string represents a package this rock depends on, containing a package name followed by a comma-separated list of constraints. Example: `{"lfs >= 1.0, < 2.0"}`. Accepted operators are the relational operators of Lua: `==` `~=` `<` `>` `<=` `>=` , as well as a special operator, `~>`, inspired by the "pessimistic operator" of RubyGems (`"~> 2"` means `">= 2, < 3"`; `"~> 2.4"` means `">= 2.4, < 2.5"`). The absence of an operator means an implicit `==` (i.e., `"lfs 1.0"` is the same as `"lfs == 1.0"`). "lua" is an special dependency name; it matches not a rock, but the version of Lua in use. Supports [per-platform overrides](platform_overrides.md). |
25 | * **build_dependencies** (array of strings) (since 3.0) - Dependencies that apply at build-time only, but not when installing binary (`.<platform>.rock`) or pure-Lua (`.all.rock`) rocks. Each string represents a package this rock depends on at build time, containing a package name followed by a comma-separated list of constraints. The syntax in the same as the `dependencies` field. Supports [per-platform overrides](platform-overrides). | 25 | * **build_dependencies** (array of strings) (since 3.0) - Dependencies that apply at build-time only, but not when installing binary (`.<platform>.rock`) or pure-Lua (`.all.rock`) rocks. Each string represents a package this rock depends on at build time, containing a package name followed by a comma-separated list of constraints. The syntax in the same as the `dependencies` field. Supports [per-platform overrides](platform_overrides.md). |
26 | * **external_dependencies** (table) - For each key in the external_dependencies table in the rockspec file, four variables available to the build rules are created: <i>key</i>_DIR, <i>key</i>_BINDIR, <i>key</i>_INCDIR and <i>key</i>_LIBDIR. These are not overwritten if already set (e.g. by the LuaRocks config file or through the command-line). The base prefix for these can be given explicitly setting <i>key</i>_DIR in the config file or through the command-line, or implicitly, defaulting to the value of default_external_deps_dir, set in the config file. Values in the external_dependencies table are tables that may contain a "header" or a "library" field, with filenames to be tested for existence. Example: `{ EXPAT = { header = "expat.h" } }` -- on Unix, this will check that EXPAT_DIR/include/expat.h exists and will create variables accordingly. You can also use platform overrides or specify files of external dependencies in a [platform-agnostic manner](platform-agnostic-external-dependencies). Supports [per-platform overrides](platform-overrides). | 26 | * **external_dependencies** (table) - For each key in the external_dependencies table in the rockspec file, four variables available to the build rules are created: <i>key</i>_DIR, <i>key</i>_BINDIR, <i>key</i>_INCDIR and <i>key</i>_LIBDIR. These are not overwritten if already set (e.g. by the LuaRocks config file or through the command-line). The base prefix for these can be given explicitly setting <i>key</i>_DIR in the config file or through the command-line, or implicitly, defaulting to the value of default_external_deps_dir, set in the config file. Values in the external_dependencies table are tables that may contain a "header" or a "library" field, with filenames to be tested for existence. Example: `{ EXPAT = { header = "expat.h" } }` -- on Unix, this will check that EXPAT_DIR/include/expat.h exists and will create variables accordingly. You can also use platform overrides or specify files of external dependencies in a [platform-agnostic manner](platform_agnostic_external_dependencies.md). Supports [per-platform overrides](platform_overrides.md). |
27 | * **test_dependencies** (array of strings) (since 3.0) - Dependencies that apply at test-time only, that is, only needed when running `luarocks test`. Each string represents a package this rock depends on at test time, containing a package name followed by a comma-separated list of constraints. The syntax in the same as the `dependencies` field. Supports [per-platform overrides](platform-overrides). | 27 | * **test_dependencies** (array of strings) (since 3.0) - Dependencies that apply at test-time only, that is, only needed when running `luarocks test`. Each string represents a package this rock depends on at test time, containing a package name followed by a comma-separated list of constraints. The syntax in the same as the `dependencies` field. Supports [per-platform overrides](platform_overrides.md). |
28 | 28 | ||
29 | ## Build rules | 29 | ## Build rules |
30 | 30 | ||
31 | * **source** (table, mandatory field) - Contains information on how to fetch sources to build this rock. Supports [per-platform overrides](platform-overrides). | 31 | * **source** (table, mandatory field) - Contains information on how to fetch sources to build this rock. Supports [per-platform overrides](platform_overrides.md). |
32 | * **source.url** (string, mandatory field) - the URL of the package source archive. Examples: "http://github.com/downloads/keplerproject/wsapi/wsapi-1.3.4.tar.gz", "git://github.com/keplerproject/wsapi.git". Note that this field is ignored when running [luarocks make](luarocks_make.md), which uses the sources from your current directory instead. Different protocols are supported: | 32 | * **source.url** (string, mandatory field) - the URL of the package source archive. Examples: "https://github.com/keplerproject/wsapi/archive/v1.3.4.tar.gz, "git://github.com/keplerproject/wsapi.git". Note that this field is ignored when running [luarocks make](luarocks_make.md), which uses the sources from your current directory instead. Different protocols are supported: |
33 | * `cvs://` - for the CVS source control manager | 33 | * `cvs://` - for the CVS source control manager |
34 | * `file://` - for URLs in the local filesystem (note that for Unix paths, the root slash is the third slash, resulting in paths like `"file:///full/path/filename"` | 34 | * `file://` - for URLs in the local filesystem to archive file (note that for Unix paths, the root slash is the third slash, resulting in paths like `"file:///full/path/filename"`) |
35 | * `ftp://` - for FTP URLs | 35 | * `ftp://` - for FTP URLs to archive file |
36 | * `git://` - for the Git source control manager | 36 | * `git://` - for the Git source control manager |
37 | * `git+file://` - for the Git source control manager when using repositories that need file:// URLs | 37 | * `git+file://` - for the Git source control manager when using repositories that need file:// URLs |
38 | * `git+http://` - for the Git source control manager when using repositories that need http:// URLs | 38 | * `git+http://` - for the Git source control manager when using repositories that need http:// URLs |
@@ -42,18 +42,18 @@ Dependencies are represented in LuaRocks through strings with a package name fol | |||
42 | * `hg+http://` - for the Mercurial source control manager using repositories that need http:// URLs | 42 | * `hg+http://` - for the Mercurial source control manager using repositories that need http:// URLs |
43 | * `hg+https://` - for the Mercurial source control manager using repositories that need https:// URLs | 43 | * `hg+https://` - for the Mercurial source control manager using repositories that need https:// URLs |
44 | * `hg+ssh://` - for the Mercurial source control manager using repositories that need SSH login | 44 | * `hg+ssh://` - for the Mercurial source control manager using repositories that need SSH login |
45 | * `http://` - for HTTP URLs | 45 | * `http://` - for HTTP URLs to archive file |
46 | * `https://` - for HTTPS URLs | 46 | * `https://` - for HTTPS URLs to archive file |
47 | * `hg://` - for the Mercurial source control manager | ||
48 | * `sscm://` - for the SurroundSCM source control manager | 47 | * `sscm://` - for the SurroundSCM source control manager |
49 | * `svn://` - for the Subversion source control manager | 48 | * `svn://` - for the Subversion source control manager |
49 | * **Important:** A source control manager URL cannot start with `http://` `https://`, `ftp://` or `file://`. For example, `https://github.com/keplerproject/wsapi.git` is incorrect, even though it works perfectly fine with `git clone`. The correct one is `git+https://github.com/keplerproject/wsapi.git`. Also note that only for GitHub URLs `git://` is being automatically handled internally as if it was `git+https://`. This is due to preserve backwards compatibility while still working with [GitHub's increased default security](https://github.blog/security/application-security/improving-git-protocol-security-github/) measures in blocking insecure connection types. | ||
50 | * **source.md5** (string) - the MD5 sum for the source archive. Example: "9ca22fd9f9413b54802d3d40b38c4e5c" | 50 | * **source.md5** (string) - the MD5 sum for the source archive. Example: "9ca22fd9f9413b54802d3d40b38c4e5c" |
51 | * **source.file** (string) - the filename of the source archive. Can be omitted if it can be inferred from the `source.url` field. Example: "luasocket-2.0.1.tar.gz" | 51 | * **source.file** (string) - the filename of the source archive. Can be omitted if it can be inferred from the `source.url` field. Example: "luasocket-2.0.1.tar.gz" |
52 | * **source.dir** (string) - the name of the directory created when the source archive is unpacked. Can be omitted if it can be inferred from the `source.file` field. Example: "luasocket-2.0.1" | 52 | * **source.dir** (string) - the name of the directory created when the source archive is unpacked. Can be omitted if it can be inferred from the `source.file` field. Example: "luasocket-2.0.1" |
53 | * **source.tag** (string) - for SCM-based URL protocols such as "cvs://" and "git://", this field can be used to specify a tag for checking out sources. Example: "HEAD" (For compatibility reasons, `source.cvs_tag` is also accepted.) | 53 | * **source.tag** (string) - for SCM-based URL protocols such as "cvs://" and "git://", this field can be used to specify a tag for checking out sources. Example: "HEAD" (For compatibility reasons, `source.cvs_tag` is also accepted.) |
54 | * **source.branch** (string) - for SCM-based URL protocols such as "git://", this field can be used to specify a branch for checking out sources. Example: "v1.0" | 54 | * **source.branch** (string) - for SCM-based URL protocols such as "git://", this field can be used to specify a branch for checking out sources. Example: "v1.0" |
55 | * **source.module** (string) - for SCM-based URL protocols such as "cvs://" and "git://", this field can be used to specify the module to be checked out. Can be omitted if it is the same as the basename of the `source.url` field. Example: "cgilua" (For compatibility reasons, `source.cvs_module` is also accepted.) | 55 | * **source.module** (string) - for SCM-based URL protocols such as "cvs://" and "git://", this field can be used to specify the module to be checked out. Can be omitted if it is the same as the basename of the `source.url` field. Example: "cgilua" (For compatibility reasons, `source.cvs_module` is also accepted.) |
56 | * **build** (table) - Contains all information pertaining _how_ to build a rock. Supports [per-platform overrides](platform-overrides). | 56 | * **build** (table) - Contains all information pertaining _how_ to build a rock. Supports [per-platform overrides](platform_overrides.md). |
57 | * **build.type** (string) - The LuaRocks build back-end to use. Example: "make" | 57 | * **build.type** (string) - The LuaRocks build back-end to use. Example: "make" |
58 | * **build.install** (table) - For packages which don't provide means to install modules and expect the user to copy the .lua or library files by hand to the proper locations. This table contains categories of files. Each category is itself a table, where the array part is a list of filenames to be copied. For module directories only, in the hash part, other keys are identifiers in Lua module format, to indicate which subdirectory the file should be copied to. For example, `build.install.lua = {["foo.bar"] = "src/bar.lua"}` will copy src/bar.lua to the foo directory under the rock's Lua files directory. The available categories are: | 58 | * **build.install** (table) - For packages which don't provide means to install modules and expect the user to copy the .lua or library files by hand to the proper locations. This table contains categories of files. Each category is itself a table, where the array part is a list of filenames to be copied. For module directories only, in the hash part, other keys are identifiers in Lua module format, to indicate which subdirectory the file should be copied to. For example, `build.install.lua = {["foo.bar"] = "src/bar.lua"}` will copy src/bar.lua to the foo directory under the rock's Lua files directory. The available categories are: |
59 | * **build.install.lua** (table) - Lua modules written in Lua. | 59 | * **build.install.lua** (table) - Lua modules written in Lua. |
@@ -110,7 +110,7 @@ Variables expected by this back-end to be provided by the configuration file are | |||
110 | * **LIBFLAG** - Flag to be passed to the C compiler to instruct it to build a shared library. | 110 | * **LIBFLAG** - Flag to be passed to the C compiler to instruct it to build a shared library. |
111 | 111 | ||
112 | These are usually detected by the default configuration, but can be overridden | 112 | These are usually detected by the default configuration, but can be overridden |
113 | by the [configuration file](config-file-format). See also the "Variables" | 113 | by the [configuration file](config_file_format.md). See also the "Variables" |
114 | section of the [Config file format](config_file_format.md) specification for | 114 | section of the [Config file format](config_file_format.md) specification for |
115 | other path variables that are defined automatically, and the documentation on | 115 | other path variables that are defined automatically, and the documentation on |
116 | the `external_dependencies` entry above for variables that are automatically | 116 | the `external_dependencies` entry above for variables that are automatically |
@@ -142,7 +142,7 @@ A null build back-end. Indicates that there is no build to perform. | |||
142 | 142 | ||
143 | ## Test rules | 143 | ## Test rules |
144 | 144 | ||
145 | * **test** (table) - Contains all information pertaining how to test a rock. Supports [per-platform overrides](platform-overrides). | 145 | * **test** (table) - Contains all information pertaining how to test a rock. Supports [per-platform overrides](platform_overrides.md). |
146 | 146 | ||
147 | ### Test back-ends | 147 | ### Test back-ends |
148 | 148 | ||