diff options
Diffstat (limited to 'pkgs/development/lua-modules')
-rw-r--r-- | pkgs/development/lua-modules/lib.nix | 69 | ||||
-rw-r--r-- | pkgs/development/lua-modules/nfd/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/lua-modules/overrides.nix | 11 |
3 files changed, 45 insertions, 37 deletions
diff --git a/pkgs/development/lua-modules/lib.nix b/pkgs/development/lua-modules/lib.nix index 189e3464e81a7..5841547073d39 100644 --- a/pkgs/development/lua-modules/lib.nix +++ b/pkgs/development/lua-modules/lib.nix @@ -74,7 +74,11 @@ rec { }; }); - /* generate luarocks config + + /* generate a luarocks config conforming to: + https://github.com/luarocks/luarocks/wiki/Config-file-format + + The config lists folders where to find lua dependencies Example: generateLuarocksConfig { @@ -89,7 +93,6 @@ rec { externalDeps ? [] # a list of lua derivations , requiredLuaRocks ? [] - , extraVariables ? {} , rocksSubdir ? "rocks-subdir" , ... }@args: let @@ -119,33 +122,37 @@ rec { externalDepsDirs = map (x: builtins.toString x) (lib.filter (lib.isDerivation) externalDeps); - in toLua { asBindings = true; } ({ - local_cache = ""; - # To prevent collisions when creating environments, we install the rock - # files into per-package subdirectories - rocks_subdir = rocksSubdir; - # first tree is the default target where new rocks are installed, - # any other trees in the list are treated as additional sources of installed rocks for matching dependencies. - rocks_trees = ( - [{name = "current"; root = "${placeholder "out"}"; rocks_dir = "current"; }] ++ - rocksTrees - ); - } // lib.optionalAttrs lua.pkgs.isLuaJIT { - # Luajit provides some additional functionality built-in; this exposes - # that to luarock's dependency system - rocks_provided = { - jit = "${lua.luaversion}-1"; - ffi = "${lua.luaversion}-1"; - luaffi = "${lua.luaversion}-1"; - bit = "${lua.luaversion}-1"; - }; - } // { - # For single-output external dependencies - external_deps_dirs = externalDepsDirs; - # Some needed machinery to handle multiple-output external dependencies, - # as per https://github.com/luarocks/luarocks/issues/766 - variables = (depVariables // extraVariables); - } - // removeAttrs args [ "rocksSubdir" "extraVariables" "requiredLuaRocks" "externalDeps" ] - ); + + generatedConfig = ({ + local_cache = ""; + + # To prevent collisions when creating environments, we install the rock + # files into per-package subdirectories + rocks_subdir = rocksSubdir; + + # first tree is the default target where new rocks are installed, + # any other trees in the list are treated as additional sources of installed rocks for matching dependencies. + rocks_trees = ( + [{name = "current"; root = "${placeholder "out"}"; rocks_dir = "current"; }] ++ + rocksTrees + ); + } // lib.optionalAttrs lua.pkgs.isLuaJIT { + # Luajit provides some additional functionality built-in; this exposes + # that to luarock's dependency system + rocks_provided = { + jit = "${lua.luaversion}-1"; + ffi = "${lua.luaversion}-1"; + luaffi = "${lua.luaversion}-1"; + bit = "${lua.luaversion}-1"; + }; + } // { + # For single-output external dependencies + external_deps_dirs = externalDepsDirs; + # Some needed machinery to handle multiple-output external dependencies, + # as per https://github.com/luarocks/luarocks/issues/766 + variables = depVariables; + } + // removeAttrs args [ "requiredLuaRocks" "externalDeps" ] + ); + in generatedConfig; } diff --git a/pkgs/development/lua-modules/nfd/default.nix b/pkgs/development/lua-modules/nfd/default.nix index a02fd0a1df4d9..5c2ffabc9b543 100644 --- a/pkgs/development/lua-modules/nfd/default.nix +++ b/pkgs/development/lua-modules/nfd/default.nix @@ -22,7 +22,7 @@ buildLuarocksPackage { ]; knownRockspec = "lua/nfd-scm-1.rockspec"; - extraVariables.LUA_LIBDIR = "${lua}/lib"; + luarocksConfig.LUA_LIBDIR = "${lua}/lib"; nativeBuildInputs = [ pkg-config ]; buildInputs = lib.optionals stdenv.isDarwin [ AppKit ]; diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index 20641092e7b19..a0ad250439208 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -164,7 +164,7 @@ with prev; }); ldbus = prev.ldbus.overrideAttrs (oa: { - extraVariables = { + luarocksConfig.variables = { DBUS_DIR = "${dbus.lib}"; DBUS_ARCH_INCDIR = "${dbus.lib}/lib/dbus-1.0/include"; DBUS_INCDIR = "${dbus.dev}/include/dbus-1.0"; @@ -309,7 +309,7 @@ with prev; }); luadbi-mysql = prev.luadbi-mysql.overrideAttrs (oa: { - extraVariables = { + luarocksConfig.variables = { # Can't just be /include and /lib, unfortunately needs the trailing 'mysql' MYSQL_INCDIR = "${libmysqlclient.dev}/include/mysql"; MYSQL_LIBDIR = "${libmysqlclient}/lib/mysql"; @@ -520,7 +520,7 @@ with prev; buildInputs = [ libuv ]; # Use system libuv instead of building local and statically linking - extraVariables = { + luarocksConfig.variables = { WITH_SHARED_LIBUV = "ON"; }; @@ -573,6 +573,7 @@ with prev; ''; }); + # upstream broken, can't be generated, so moved out from the generated set readline = final.callPackage({ buildLuarocksPackage, fetchurl, luaAtLeast, luaOlder, lua, luaposix }: buildLuarocksPackage ({ pname = "readline"; @@ -588,7 +589,7 @@ with prev; sha256 = "1mk9algpsvyqwhnq7jlw4cgmfzj30l7n2r6ak4qxgdxgc39f48k4"; }; - extraVariables = rec { + luarocksConfig.variables = rec { READLINE_INCDIR = "${readline.dev}/include"; HISTORY_INCDIR = READLINE_INCDIR; }; @@ -597,7 +598,6 @@ with prev; tar xf *.tar.gz ''; - disabled = (luaOlder "5.1") || (luaAtLeast "5.5"); propagatedBuildInputs = [ lua luaposix readline.out ]; @@ -606,6 +606,7 @@ with prev; homepage = "http://pjb.com.au/comp/lua/readline.html"; description = "Interface to the readline library"; license.fullName = "MIT/X11"; + broken = (luaOlder "5.1") || (luaAtLeast "5.5"); }; })) {}; |