summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xmaintainers/scripts/update-luarocks-packages1
-rw-r--r--pkgs/development/lua-modules/overrides.nix18
2 files changed, 12 insertions, 7 deletions
diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages
index 631bc897c3527..cab63ca44e388 100755
--- a/maintainers/scripts/update-luarocks-packages
+++ b/maintainers/scripts/update-luarocks-packages
@@ -159,7 +159,6 @@ def generate_pkg_nix(plug: LuaPlugin):
     '''
     log.debug("Generating nix expression for %s", plug.name)
     custom_env = os.environ.copy()
-    # TODO check
     custom_env['LUAROCKS_CONFIG'] = LUAROCKS_CONFIG
 
     cmd = [ "luarocks", "nix"]
diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix
index 3ca4b219950c9..ad8b30daf3a96 100644
--- a/pkgs/development/lua-modules/overrides.nix
+++ b/pkgs/development/lua-modules/overrides.nix
@@ -332,15 +332,23 @@ with prev;
   # we shouldn't use luarocks machinery to build complex cmake components
   libluv = pkgs.stdenv.mkDerivation {
 
-    inherit (prev.luv) pname version meta src;
+    pname = "libluv";
+    inherit (prev.luv) version meta src;
 
       cmakeFlags = [
         "-DBUILD_SHARED_LIBS=ON"
         "-DBUILD_MODULE=OFF"
         "-DWITH_SHARED_LIBUV=ON"
+        "-DLUA_BUILD_TYPE=System"
+        "-DWITH_LUA_ENGINE=${if isLuaJIT then "LuaJit" else "Lua"}"
       ];
 
-      buildInputs = [ pkgs.libuv ];
+      # to make sure we dont use bundled deps
+      postUnpack = ''
+        rm -rf deps/lua deps/libuv
+      '';
+
+      buildInputs = [ pkgs.libuv final.lua ];
 
       nativeBuildInputs = [ pkgs.pkg-config pkgs.cmake ]
         ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.fixDarwinDylibNames ];
@@ -350,18 +358,16 @@ with prev;
 
     buildInputs = [ pkgs.pkg-config pkgs.libuv ];
 
-    doInstallCheck = true;
-
     # Use system libuv instead of building local and statically linking
     extraVariables = {
       "WITH_SHARED_LIBUV" = "ON";
     };
 
     # we unset the LUA_PATH since the hook erases the interpreter defaults (To fix)
-    installCheckPhase = ''
+    # tests is not run since they are not part of the tarball anymore
+    preCheck = ''
       unset LUA_PATH
       rm tests/test-{dns,thread}.lua
-      lua tests/run.lua
     '';
 
     passthru.libluv = final.libluv;