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.
This commit is contained in:
Thomas Watson 2024-10-02 21:10:11 -05:00
parent 78389c563c
commit d6011f0085

View File

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