@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
1414 outputs = ["out" "hook"];
1515
1616 buildPhase = ''
17+ runHook preBuild
18+
1719 $CC -Wall -std=c99 -O3 -fPIC -ldl -shared \
1820 ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/$libName"} \
1921 -o "$libName" \
@@ -22,9 +24,18 @@ stdenv.mkDerivation rec {
2224 if [ -n "$doInstallCheck" ]; then
2325 $CC -Wall -std=c99 -O3 test.c -o test
2426 fi
27+
28+ runHook postBuild
2529 '';
2630
31+ # We want to retain debugging info to be able to use GDB on libredirect.so
32+ # to more easily investigate which function overrides are missing or why
33+ # existing ones do not have the intended effect.
34+ dontStrip = true;
35+
2736 installPhase = ''
37+ runHook preInstall
38+
2839 install -vD "$libName" "$out/lib/$libName"
2940
3041 mkdir -p "$hook/nix-support"
@@ -36,6 +47,8 @@ stdenv.mkDerivation rec {
3647 export LD_PRELOAD="$out/lib/$libName"
3748 ''}
3849 SETUP_HOOK
50+
51+ runHook postInstall
3952 '';
4053
4154 doInstallCheck = true;