nixpkgs/doc/languages-frameworks/lua.xml

37 lines
1.9 KiB
XML
Raw Normal View History

<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-language-lua">
2018-05-02 00:54:21 +01:00
<title>Lua</title>
2018-05-02 00:54:21 +01:00
<para>
2019-09-18 21:12:54 +01:00
Lua packages are built by the <varname>buildLuaPackage</varname> function. This function is implemented in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules/generic/default.nix"> <filename>pkgs/development/lua-modules/generic/default.nix</filename></link> and works similarly to <varname>buildPerlPackage</varname>. (See <xref linkend="sec-language-perl"/> for details.)
2018-05-02 00:54:21 +01:00
</para>
2018-05-02 00:54:21 +01:00
<para>
2019-09-18 21:12:54 +01:00
Lua packages are defined in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/lua-packages.nix"><filename>pkgs/top-level/lua-packages.nix</filename></link>. Most of them are simple. For example:
2018-05-02 00:54:21 +01:00
<programlisting>
fileSystem = buildLuaPackage {
name = "filesystem-1.6.2";
src = fetchurl {
url = "https://github.com/keplerproject/luafilesystem/archive/v1_6_2.tar.gz";
sha256 = "1n8qdwa20ypbrny99vhkmx8q04zd2jjycdb5196xdhgvqzk10abz";
};
meta = {
homepage = "https://github.com/keplerproject/luafilesystem";
hydraPlatforms = stdenv.lib.platforms.linux;
maintainers = with maintainers; [ flosse ];
};
};
2019-06-17 11:17:16 +01:00
</programlisting>
2018-05-02 00:54:21 +01:00
</para>
2018-05-02 00:54:21 +01:00
<para>
2019-09-18 21:12:54 +01:00
Though, more complicated package should be placed in a seperate file in <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua-modules"><filename>pkgs/development/lua-modules</filename></link>.
2018-05-02 00:54:21 +01:00
</para>
2018-05-02 00:54:21 +01:00
<para>
2019-09-18 21:12:54 +01:00
Lua packages accept additional parameter <varname>disabled</varname>, which defines the condition of disabling package from luaPackages. For example, if package has <varname>disabled</varname> assigned to <literal>lua.luaversion != "5.1"</literal>, it will not be included in any luaPackages except lua51Packages, making it only be built for lua 5.1.
2018-05-02 00:54:21 +01:00
</para>
</section>