From d6011f008571b5d87614007bb94a6781d29a052a Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 2 Oct 2024 21:10:11 -0500 Subject: [PATCH] btor2tools: fix on darwin `-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON` is necessary so the executable is pointed to its shared library on Darwin. Also add an `installCheckPhase` to ensure this doesn't break in the future. --- .../science/logic/btor2tools/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/applications/science/logic/btor2tools/default.nix b/pkgs/applications/science/logic/btor2tools/default.nix index 2b547eeb9221..19bb53fb766b 100644 --- a/pkgs/applications/science/logic/btor2tools/default.nix +++ b/pkgs/applications/science/logic/btor2tools/default.nix @@ -21,11 +21,24 @@ stdenv.mkDerivation rec { cp -v lib/libbtor2parser.* $lib/lib ''; + doInstallCheck = true; + + installCheckPhase = '' + runHook preInstallCheck + + # make sure shared libraries are present and program can be executed + $out/bin/btorsim -h > /dev/null + + runHook postInstallCheck + ''; + outputs = [ "out" "dev" "lib" ]; cmakeFlags = [ # RPATH of binary /nix/store/.../bin/btorsim contains a forbidden reference to /build/ "-DCMAKE_SKIP_BUILD_RPATH=ON" + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" ]; meta = with lib; {