From 30848378e38e4422854b5fb4e3a17e4b9e10435d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 23 Nov 2025 16:39:33 -0500 Subject: [PATCH] sherpa: don't apply autoPatchelfHook on darwin --- pkgs/by-name/sh/sherpa/package.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/sh/sherpa/package.nix b/pkgs/by-name/sh/sherpa/package.nix index 3367c42ec113..c05b4522f66c 100644 --- a/pkgs/by-name/sh/sherpa/package.nix +++ b/pkgs/by-name/sh/sherpa/package.nix @@ -31,8 +31,8 @@ stdenv.mkDerivation rec { gfortran cmake pkg-config - autoPatchelfHook - ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; buildInputs = [ libzip @@ -41,9 +41,13 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - preFixup = '' - patchelf --add-rpath $out/lib/SHERPA-MC $out/bin/Sherpa - ''; + preFixup = + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -add_rpath "$out"/lib/SHERPA-MC "$out"/bin/Sherpa + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + patchelf --add-rpath "$out"/lib/SHERPA-MC "$out"/bin/Sherpa + ''; meta = { description = "Monte Carlo event generator for the Simulation of High-Energy Reactions of PArticles";