1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 19:51:17 +00:00

libredirect: Add missing phase hooks

This commit is contained in:
Niklas Hambüchen 2021-05-23 16:59:43 +02:00 committed by Pascal Bach
parent bb1058f1f0
commit 5ca0265505

View file

@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
outputs = ["out" "hook"];
buildPhase = ''
runHook preBuild
$CC -Wall -std=c99 -O3 -fPIC -ldl -shared \
${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/$libName"} \
-o "$libName" \
@ -22,9 +24,13 @@ stdenv.mkDerivation rec {
if [ -n "$doInstallCheck" ]; then
$CC -Wall -std=c99 -O3 test.c -o test
fi
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -vD "$libName" "$out/lib/$libName"
mkdir -p "$hook/nix-support"
@ -36,6 +42,8 @@ stdenv.mkDerivation rec {
export LD_PRELOAD="$out/lib/$libName"
''}
SETUP_HOOK
runHook postInstall
'';
doInstallCheck = true;