Skip to content

Commit 9ce11f6

Browse files
authored
[Backport release-25.11] sherpa: don't apply autoPatchelfHook on darwin (#468219)
2 parents 15182e5 + b0219d4 commit 9ce11f6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pkgs/by-name/sh/sherpa/package.nix

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ stdenv.mkDerivation rec {
3131
gfortran
3232
cmake
3333
pkg-config
34-
autoPatchelfHook
35-
];
34+
]
35+
++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
3636

3737
buildInputs = [
3838
libzip
@@ -41,9 +41,13 @@ stdenv.mkDerivation rec {
4141

4242
enableParallelBuilding = true;
4343

44-
preFixup = ''
45-
patchelf --add-rpath $out/lib/SHERPA-MC $out/bin/Sherpa
46-
'';
44+
preFixup =
45+
lib.optionalString stdenv.hostPlatform.isDarwin ''
46+
install_name_tool -add_rpath "$out"/lib/SHERPA-MC "$out"/bin/Sherpa
47+
''
48+
+ lib.optionalString stdenv.hostPlatform.isLinux ''
49+
patchelf --add-rpath "$out"/lib/SHERPA-MC "$out"/bin/Sherpa
50+
'';
4751

4852
meta = {
4953
description = "Monte Carlo event generator for the Simulation of High-Energy Reactions of PArticles";

0 commit comments

Comments
 (0)