2016-10-21 02:01:55 +01:00
|
|
|
{ stdenv, fetchurl, fastjet, ghostscript, gsl, hepmc, imagemagick, less, python2, texlive, yoda, which, makeWrapper }:
|
2016-06-11 21:48:18 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "rivet-${version}";
|
2017-12-23 23:13:03 +00:00
|
|
|
version = "2.6.0";
|
2016-06-11 21:48:18 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://www.hepforge.org/archive/rivet/Rivet-${version}.tar.bz2";
|
2018-03-29 23:24:09 +01:00
|
|
|
sha256 = "007rwal8wx2k9gs0r6kym6ix0siz0x9l55q9myq41siirpf2jcpv";
|
2016-06-11 21:48:18 +01:00
|
|
|
};
|
|
|
|
|
2017-01-07 08:00:04 +00:00
|
|
|
patches = [
|
|
|
|
./darwin.patch # configure relies on impure sw_vers to -Dunix
|
|
|
|
];
|
|
|
|
|
2016-06-11 21:48:18 +01:00
|
|
|
latex = texlive.combine { inherit (texlive)
|
|
|
|
scheme-basic
|
|
|
|
collection-pstricks
|
|
|
|
collection-fontsrecommended
|
|
|
|
mathastext
|
|
|
|
pgf
|
|
|
|
relsize
|
|
|
|
sfmath
|
|
|
|
xcolor
|
|
|
|
xkeyval
|
|
|
|
;};
|
2017-04-05 03:37:35 +01:00
|
|
|
buildInputs = [ hepmc imagemagick python2 latex makeWrapper ];
|
|
|
|
propagatedBuildInputs = [ fastjet ghostscript gsl yoda ];
|
2016-06-11 21:48:18 +01:00
|
|
|
|
2017-12-23 23:13:03 +00:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace bin/rivet-buildplugin.in \
|
|
|
|
--replace '"which"' '"${which}/bin/which"' \
|
|
|
|
--replace 'mycxx=' 'mycxx=${stdenv.cc}/bin/${if stdenv.cc.isClang or false then "clang++" else "g++"} #' \
|
|
|
|
--replace 'mycxxflags="' "mycxxflags=\"-std=c++11 $NIX_CFLAGS_COMPILE $NIX_CXXSTDLIB_COMPILE $NIX_CFLAGS_LINK "
|
|
|
|
'';
|
|
|
|
|
2016-06-11 21:48:18 +01:00
|
|
|
preInstall = ''
|
|
|
|
substituteInPlace bin/make-plots \
|
|
|
|
--replace '"which"' '"${which}/bin/which"' \
|
|
|
|
--replace '"latex"' '"${latex}/bin/latex"' \
|
|
|
|
--replace '"dvips"' '"${latex}/bin/dvips"' \
|
|
|
|
--replace '"ps2pdf"' '"${ghostscript}/bin/ps2pdf"' \
|
|
|
|
--replace '"ps2eps"' '"${ghostscript}/bin/ps2eps"' \
|
|
|
|
--replace '"kpsewhich"' '"${latex}/bin/kpsewhich"' \
|
|
|
|
--replace '"convert"' '"${imagemagick.out}/bin/convert"'
|
|
|
|
substituteInPlace bin/rivet \
|
|
|
|
--replace '"less"' '"${less}/bin/less"'
|
|
|
|
substituteInPlace bin/rivet-mkhtml \
|
|
|
|
--replace '"make-plots"' \"$out/bin/make-plots\" \
|
|
|
|
--replace '"rivet-cmphistos"' \"$out/bin/rivet-cmphistos\"
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-fastjet=${fastjet}"
|
|
|
|
"--with-hepmc=${hepmc}"
|
|
|
|
"--with-yoda=${yoda}"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for prog in "$out"/bin/*; do
|
|
|
|
wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A framework for comparison of experimental measurements from high-energy particle colliders to theory predictions";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
homepage = https://rivet.hepforge.org;
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2016-10-22 11:05:23 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ veprbl ];
|
2016-06-11 21:48:18 +01:00
|
|
|
};
|
|
|
|
}
|