1 /* This file defines the composition for Lua packages. It has
2 been factored out of all-packages.nix because there are many of
3 them. Also, because most Nix expressions for Lua packages are
4 trivial, most are actually defined here. I.e. there's no function
5 for each package in a separate file: the call to the function would
6 be almost as must code as the function itself. */
18 inherit (self) callPackage;
20 buildLuaApplication = args: buildLuarocksPackage ({ namePrefix = ""; } // args);
22 buildLuarocksPackage = lib.makeOverridable (callPackage ../development/interpreters/lua-5/build-luarocks-package.nix { });
24 luaLib = callPackage ../development/lua-modules/lib.nix { };
26 #define build lua package function
27 buildLuaPackage = callPackage ../development/lua-modules/generic { };
29 getPath = drv: pathListForVersion:
30 lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion;
35 # Dont take luaPackages from "global" pkgs scope to avoid mixing lua versions
38 # helper functions for dealing with LUA_PATH and LUA_CPATH
41 getLuaPath = drv: getPath drv luaLib.luaPathList;
42 getLuaCPath = drv: getPath drv luaLib.luaCPathList;
44 inherit (callPackage ../development/interpreters/lua-5/hooks { })
45 luarocksMoveDataFolder luarocksCheckHook;
48 inherit buildLuaPackage buildLuarocksPackage buildLuaApplication;
49 inherit (luaLib) luaOlder luaAtLeast isLua51 isLua52 isLua53 isLuaJIT
50 requiredLuaModules toLuaModule hasLuaModule;
52 # wraps programs in $out/bin with valid LUA_PATH/LUA_CPATH
53 wrapLua = callPackage ../development/interpreters/lua-5/wrap-lua.nix {
54 inherit (pkgs.buildPackages) makeSetupHook makeWrapper;
57 luarocks_bootstrap = toLuaModule (callPackage ../development/tools/misc/luarocks/default.nix { });
59 # a fork of luarocks used to generate nix lua derivations from rockspecs
60 luarocks-nix = toLuaModule (callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { });
62 lua-pam = callPackage({fetchFromGitHub, linux-pam, openpam}: buildLuaPackage rec {
64 version = "unstable-2015-07-03";
65 # Needed for `disabled`, overridden in buildLuaPackage
66 name = "${pname}-${version}";
68 src = fetchFromGitHub {
71 rev = "3818ee6346a976669d74a5cbc2a83ad2585c5953";
72 hash = "sha256-YlMZ5mM9Ij/9yRmgA0X1ahYVZMUx8Igj5OBvAMskqTg=";
73 fetchSubmodules = true;
76 # The makefile tries to link to `-llua<luaversion>`
79 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [linux-pam]
80 ++ lib.optionals stdenv.hostPlatform.isDarwin [openpam];
85 install -Dm755 pam.so $out/lib/lua/${lua.luaversion}/pam.so
90 # The package does not build with lua 5.4 or luaJIT
91 disabled = luaAtLeast "5.4" || isLuaJIT;
94 description = "Lua module for PAM authentication";
95 homepage = "https://github.com/devurandom/lua-pam";
96 license = licenses.mit;
97 maintainers = with maintainers; [ traxys ];
101 lua-resty-core = callPackage ({ fetchFromGitHub }: buildLuaPackage rec {
102 pname = "lua-resty-core";
105 src = fetchFromGitHub {
107 repo = "lua-resty-core";
109 sha256 = "sha256-RJ2wcHTu447wM0h1fa2qCBl4/p9XL6ZqX9pktRW64RI=";
112 propagatedBuildInputs = [ lua-resty-lrucache ];
115 description = "New FFI-based API for lua-nginx-module";
116 homepage = "https://github.com/openresty/lua-resty-core";
117 license = licenses.bsd3;
122 lua-resty-lrucache = callPackage ({ fetchFromGitHub }: buildLuaPackage rec {
123 pname = "lua-resty-lrucache";
126 src = fetchFromGitHub {
128 repo = "lua-resty-lrucache";
130 sha256 = "sha256-J8RNAMourxqUF8wPKd8XBhNwGC/x1KKvrVnZtYDEu4Q=";
134 description = "Lua-land LRU Cache based on LuaJIT FFI";
135 homepage = "https://github.com/openresty/lua-resty-lrucache";
136 license = licenses.bsd3;
141 luxio = callPackage ({ fetchurl, which, pkg-config }: buildLuaPackage rec {
146 url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-${version}.tar.bz2";
147 sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
150 nativeBuildInputs = [ which pkg-config ];
153 patchShebangs const-proc.lua
158 INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
159 INST_LUADIR="$out/share/lua/${lua.luaversion}"
160 LUA_BINDIR="$out/bin"
166 broken = stdenv.hostPlatform.isDarwin;
167 description = "Lightweight UNIX I/O and POSIX binding for Lua";
168 homepage = "https://www.gitano.org.uk/luxio/";
169 license = licenses.mit;
170 maintainers = with maintainers; [ richardipsum ];
171 platforms = platforms.unix;
175 nfd = callPackage ../development/lua-modules/nfd {
176 inherit (pkgs) zenity;
177 inherit (pkgs.darwin.apple_sdk.frameworks) AppKit;
180 vicious = callPackage ({ fetchFromGitHub }: stdenv.mkDerivation rec {
184 src = fetchFromGitHub {
185 owner = "vicious-widgets";
188 sha256 = "sha256-VlJ2hNou2+t7eSyHmFkC2xJ92OH/uJ/ewYHkFLQjUPQ=";
191 buildInputs = [ lua ];
194 mkdir -p $out/lib/lua/${lua.luaversion}/
195 cp -r . $out/lib/lua/${lua.luaversion}/vicious/
196 printf "package.path = '$out/lib/lua/${lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${lua.luaversion}/vicious.lua
200 description = "Modular widget library for the awesome window manager";
201 homepage = "https://vicious.rtfd.io";
202 changelog = "https://vicious.rtfd.io/en/v${version}/changelog.html";
203 license = licenses.gpl2Plus;
204 maintainers = with maintainers; [ makefu mic92 McSinyx ];
205 platforms = platforms.linux;