about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix b/nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix
new file mode 100644
index 000000000000..64b88dcc3d4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, boost, hepmc, lhapdf, pythia, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "sacrifice-${version}";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/agile/Sacrifice-1.0.0.tar.gz";
+    sha256 = "10bvpq63kmszy1habydwncm0j1dgvam0fkrmvkgbkvf804dcjp6g";
+  };
+
+  buildInputs = [ boost hepmc lhapdf pythia ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  patches = [
+    ./compat.patch
+  ];
+
+  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 = [
+    "--with-HepMC=${hepmc}"
+    "--with-pythia=${pythia}"
+  ];
+
+  postInstall = if stdenv.isDarwin then ''
+    install_name_tool -add_rpath ${pythia}/lib "$out"/bin/run-pythia
+  '' else ''
+    wrapProgram $out/bin/run-pythia \
+      --prefix LD_LIBRARY_PATH : "${pythia}/lib"
+  '';
+
+  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;
+    platforms   = stdenv.lib.platforms.unix;
+    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+  };
+}