From 98f9f1f05447a3fd97af44c2702ca71554ddfac2 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 5 Jun 2022 15:10:43 +0200 Subject: [PATCH] luaPackages.luv: fix build --- maintainers/scripts/update-luarocks-packages | 1 - pkgs/development/lua-modules/overrides.nix | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages index 631bc897c352..cab63ca44e38 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 3ca4b219950c..ad8b30daf3a9 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;