nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix

49 lines
1.3 KiB
Nix
Raw Normal View History

2019-08-05 22:54:56 +02:00
{ stdenv, fetchurl, boost, hepmc2, lhapdf, pythia, makeWrapper }:
2016-07-25 08:01:27 +02:00
2019-08-13 23:52:01 +02:00
stdenv.mkDerivation {
pname = "sacrifice";
2016-07-25 08:01:27 +02:00
version = "1.0.0";
src = fetchurl {
url = "https://www.hepforge.org/archive/agile/Sacrifice-1.0.0.tar.gz";
2016-07-25 08:01:27 +02:00
sha256 = "10bvpq63kmszy1habydwncm0j1dgvam0fkrmvkgbkvf804dcjp6g";
};
2019-08-05 22:54:56 +02:00
buildInputs = [ boost hepmc2 lhapdf pythia ];
nativeBuildInputs = [ makeWrapper ];
2016-07-25 08:01:27 +02:00
patches = [
./compat.patch
2020-10-08 02:28:19 +02:00
./pythia83xx.patch
2016-07-25 08:01:27 +02:00
];
preConfigure = ''
substituteInPlace configure --replace HAVE_LCG=yes HAVE_LCG=no
''
+ stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace configure --replace LIB_SUFFIX=\"so\" LIB_SUFFIX=\"dylib\"
'';
configureFlags = [
2019-08-05 22:54:56 +02:00
"--with-HepMC=${hepmc2}"
2016-07-25 08:01:27 +02:00
"--with-pythia=${pythia}"
];
postInstall = if stdenv.isDarwin then ''
2018-04-25 20:58:23 +02:00
install_name_tool -add_rpath ${pythia}/lib "$out"/bin/run-pythia
'' else ''
wrapProgram $out/bin/run-pythia \
--prefix LD_LIBRARY_PATH : "${pythia}/lib"
2018-04-25 20:58:23 +02:00
'';
2016-07-25 08:01:27 +02:00
enableParallelBuilding = true;
meta = {
description = "A standalone contribution to AGILe for steering Pythia 8";
license = stdenv.lib.licenses.gpl2;
homepage = "https://agile.hepforge.org/trac/wiki/Sacrifice";
2016-07-25 08:01:27 +02:00
platforms = stdenv.lib.platforms.unix;
maintainers = with stdenv.lib.maintainers; [ veprbl ];
2016-07-25 08:01:27 +02:00
};
}