@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, boost, hepmc, lhapdf, pythia }:
1+{ stdenv, fetchurl, boost, hepmc, lhapdf, pythia, makeWrapper }:
22
33stdenv.mkDerivation rec {
44 name = "sacrifice-${version}";
@@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
1010 };
1111
1212 buildInputs = [ boost hepmc lhapdf pythia ];
13+ nativeBuildInputs = [ makeWrapper ];
1314
1415 patches = [
1516 ./compat.patch
@@ -27,8 +28,11 @@ stdenv.mkDerivation rec {
2728 "--with-pythia=${pythia}"
2829 ];
2930
30− postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
31+ postInstall = if stdenv.isDarwin then ''
3132 install_name_tool -add_rpath ${pythia}/lib "$out"/bin/run-pythia
33+ '' else ''
34+ wrapProgram $out/bin/run-pythia \
35+ --prefix LD_LIBRARY_PATH : "${pythia}/lib"
3236 '';
3337
3438 enableParallelBuilding = true;