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.
This commit is contained in:
Matthieu Coudron 2024-04-10 20:32:14 +02:00
parent c4e89ef905
commit ddefcf284c
1 changed files with 7 additions and 3 deletions

View File

@ -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