From 45ed0fed81214baded760449d740a0098e47e99c Mon Sep 17 00:00:00 2001 From: Phillip Susemiehl Date: Thu, 12 Mar 2026 12:26:04 +0100 Subject: [PATCH 1/2] mcrl2: fixed darwin build --- pkgs/by-name/mc/mcrl2/package.nix | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/mc/mcrl2/package.nix b/pkgs/by-name/mc/mcrl2/package.nix index 0118eecc98a9..c08219fe7d18 100644 --- a/pkgs/by-name/mc/mcrl2/package.nix +++ b/pkgs/by-name/mc/mcrl2/package.nix @@ -7,6 +7,7 @@ libGL, qt6, boost, + ninja, }: stdenv.mkDerivation rec { @@ -19,7 +20,33 @@ stdenv.mkDerivation rec { hash = "sha256-Ur7GGXbYvVmrEUq/CTRyuVNLDHKfFrYHJibo0JvYhyM="; }; - nativeBuildInputs = [ cmake ]; + postInstall = lib.optional stdenv.hostPlatform.isDarwin '' + mkdir $out/Applications + mv $out/mCRL2.app $out/Applications + ''; + + 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 @@ -30,7 +57,6 @@ stdenv.mkDerivation rec { 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, From ca60c04e7b0213e04c783bdc91566f7ef77a21fc Mon Sep 17 00:00:00 2001 From: Phillip Susemiehl Date: Thu, 2 Apr 2026 14:06:34 +0200 Subject: [PATCH 2/2] mcrl2: added wrapper --- pkgs/by-name/mc/mcrl2/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/mc/mcrl2/package.nix b/pkgs/by-name/mc/mcrl2/package.nix index c08219fe7d18..eda177c67e3d 100644 --- a/pkgs/by-name/mc/mcrl2/package.nix +++ b/pkgs/by-name/mc/mcrl2/package.nix @@ -8,6 +8,7 @@ qt6, boost, ninja, + makeWrapper, }: stdenv.mkDerivation rec { @@ -23,6 +24,8 @@ stdenv.mkDerivation rec { 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 '' @@ -52,7 +55,8 @@ stdenv.mkDerivation rec { libGL qt6.qtbase boost - ]; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ makeWrapper ]; dontWrapQtApps = true;