mcrl2: fixed darwin build (#499239)

This commit is contained in:
Marcin Serwin
2026-04-10 18:36:00 +00:00
committed by GitHub
+33 -3
View File
@@ -7,6 +7,8 @@
libGL,
qt6,
boost,
ninja,
makeWrapper,
}:
stdenv.mkDerivation rec {
@@ -19,18 +21,46 @@ stdenv.mkDerivation rec {
hash = "sha256-Ur7GGXbYvVmrEUq/CTRyuVNLDHKfFrYHJibo0JvYhyM=";
};
nativeBuildInputs = [ cmake ];
postInstall = lib.optional stdenv.hostPlatform.isDarwin ''
mkdir $out/Applications
mv $out/mCRL2.app $out/Applications
mkdir $out/bin
makeWrapper "$out/Applications/mCRL2.app/Contents/MacOS/mCRL2" "$out/bin/mcrl2ide"
'';
postFixup = lib.optional stdenv.hostPlatform.isDarwin ''
APP_DIR="$out/Applications/mCRL2.app/Contents"
find "$APP_DIR/lib" -name "*.dylib" | while read lib; do
install_name_tool -id "@rpath/$(basename "$lib")" "$lib" || true
otool -L "$lib" | grep "$out" | awk '{print $1}' | while read old_path; do
install_name_tool -change "$old_path" "@rpath/$(basename "$old_path")" "$lib" || true
done
done
find "$APP_DIR/bin" -type f | while read bin; do
install_name_tool -add_rpath "@loader_path/../lib" "$bin" || true
otool -L "$bin" | grep "$out" | awk '{print $1}' | while read old_path; do
libname=$(basename "$old_path")
install_name_tool -change "$old_path" "@rpath/$libname" "$bin" || true
done
done
'';
nativeBuildInputs = [
cmake
ninja
];
buildInputs = [
libGLU
libGL
qt6.qtbase
boost
];
]
++ lib.optional stdenv.hostPlatform.isDarwin [ makeWrapper ];
dontWrapQtApps = true;
meta = {
broken = stdenv.hostPlatform.isDarwin;
description = "Toolset for model-checking concurrent systems and protocols";
longDescription = ''
A formal specification language with an associated toolset,