anchor.diff:    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" \
  
positive.code:     if [ -n "$doInstallCheck" ]; then
        $CC -Wall -std=c99 -O3 test.c -o test
      fi
    '';
  
    installPhase = ''
      install -vD "$libName" "$out/lib/$libName"
  
      mkdir -p "$hook/nix-support"
  
negative.code:     export LD_PRELOAD="$out/lib/$libName"
      ''}
      SETUP_HOOK
  
      runHook postInstall
    '';
  
    doInstallCheck = true;
  