3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix

49 lines
1.3 KiB
Nix
Raw Normal View History

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