From 7f4a7ff7ed3a1a5a1c5ac6a66801bb8f869bf843 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Wed, 10 Apr 2024 20:32:14 +0200 Subject: [PATCH] buildLuarocksPackage: rework fixup phase I was working on lua tests, enabling nlua and I started overriding postFixup, which removed the default phase for build-luarocks-package so instead let's make it a proper phase. --- .../interpreters/lua-5/build-luarocks-package.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix index 97ac535c93036..0040fca0ba2c7 100644 --- a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix +++ b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix @@ -94,6 +94,7 @@ let ]; inherit doCheck extraConfig rockspecFilename knownRockspec externalDeps nativeCheckInputs; + inherit dontWrapLuaPrograms; buildInputs = let # example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ] @@ -177,9 +178,11 @@ let runHook postBuild ''; - postFixup = lib.optionalString (!dontWrapLuaPrograms) '' - wrapLuaPrograms - '' + attrs.postFixup or ""; + fixupPhase = '' + runHook preFixup + ${lib.optionalString (!self.dontWrapLuaPrograms) "wrapLuaPrograms"} + runHook postFixup + ''; installPhase = '' runHook preInstall @@ -196,6 +199,7 @@ let # maybe we could reestablish dependency checking via passing --rock-trees nix_debug "ROCKSPEC $rockspecFilename" + # deps-mode=all tells luarocks to use every configured rocks_trees luarocks $LUAROCKS_EXTRA_ARGS make --deps-mode=all --tree=$out ''${rockspecFilename} runHook postInstall