1 { lib, stdenv, fetchurl, fetchpatch, fastjet, fastjet-contrib, ghostscript, hepmc, imagemagick, less, python3, rsync, texlive, yoda, which, makeWrapper }:
3 stdenv.mkDerivation rec {
8 url = "https://www.hepforge.org/archive/rivet/Rivet-${version}.tar.bz2";
9 hash = "sha256-HPbrtqedGBxEHR0MfG1iPEI4F8YQk/NvIa2q4j5nkJA=";
12 latex = texlive.combine { inherit (texlive)
15 collection-fontsrecommended
29 nativeBuildInputs = [ rsync makeWrapper ];
30 buildInputs = [ hepmc imagemagick python3 latex python3.pkgs.yoda ];
31 propagatedBuildInputs = [ fastjet fastjet-contrib ];
34 substituteInPlace bin/rivet-build.in \
35 --replace 'num_jobs=$(getconf _NPROCESSORS_ONLN)' 'num_jobs=''${NIX_BUILD_CORES:-$(getconf _NPROCESSORS_ONLN)}' \
36 --replace 'which' '"${which}/bin/which"' \
37 --replace 'mycxx=' 'mycxx=${stdenv.cc}/bin/${if stdenv.cc.isClang or false then "clang++" else "g++"} #' \
38 --replace 'mycxxflags="' "mycxxflags=\"$NIX_CFLAGS_COMPILE $NIX_CXXSTDLIB_COMPILE $NIX_CFLAGS_LINK "
42 substituteInPlace bin/make-plots \
43 --replace '"which"' '"${which}/bin/which"' \
44 --replace '"latex"' '"'$latex'/bin/latex"' \
45 --replace '"dvips"' '"'$latex'/bin/dvips"' \
46 --replace '"ps2pdf"' '"${ghostscript}/bin/ps2pdf"' \
47 --replace '"ps2eps"' '"${ghostscript}/bin/ps2eps"' \
48 --replace '"kpsewhich"' '"'$latex'/bin/kpsewhich"' \
49 --replace '"convert"' '"${imagemagick.out}/bin/convert"'
50 substituteInPlace bin/rivet \
51 --replace '"less"' '"${less}/bin/less"'
52 substituteInPlace bin/rivet-mkhtml \
53 --replace '"make-plots"' \"$out/bin/make-plots\" \
54 --replace '"rivet-cmphistos"' \"$out/bin/rivet-cmphistos\"
58 "--with-fastjet=${fastjet}"
60 ] ++ (if lib.versions.major hepmc.version == "3" then [
61 "--with-hepmc3=${hepmc}"
63 "--with-hepmc=${hepmc}"
66 enableParallelBuilding = true;
69 for prog in "$out"/bin/*; do
70 wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
75 description = "A framework for comparison of experimental measurements from high-energy particle colliders to theory predictions";
76 license = licenses.gpl3;
77 homepage = "https://rivet.hepforge.org";
78 platforms = platforms.unix;
79 maintainers = with maintainers; [ veprbl ];