nixpkgs/pkgs/development/libraries/physics/rivet/default.nix

81 lines
2.5 KiB
Nix
Raw Normal View History

2019-08-05 22:54:56 +02:00
{ stdenv, fetchurl, fastjet, ghostscript, gsl, hepmc2, imagemagick, less, python2, texlive, yoda, which, makeWrapper }:
2016-06-11 22:48:18 +02:00
stdenv.mkDerivation rec {
pname = "rivet";
2019-06-27 16:45:49 +02:00
version = "2.7.2";
2016-06-11 22:48:18 +02:00
src = fetchurl {
url = "https://www.hepforge.org/archive/rivet/Rivet-${version}.tar.bz2";
sha256 = "1bxcb99a3l5d2gl93zgfzgw6v95kx1ss5045mkz3ciyw8w5nmb9l";
2016-06-11 22:48:18 +02:00
};
2017-01-07 09:00:04 +01:00
patches = [
./darwin.patch # configure relies on impure sw_vers to -Dunix
];
2016-06-11 22:48:18 +02:00
latex = texlive.combine { inherit (texlive)
scheme-basic
collection-pstricks
collection-fontsrecommended
2019-06-11 00:00:18 +02:00
l3kernel
l3packages
2016-06-11 22:48:18 +02:00
mathastext
pgf
relsize
sfmath
2019-06-11 00:00:18 +02:00
siunitx
2016-06-11 22:48:18 +02:00
xcolor
xkeyval
2019-06-11 00:00:18 +02:00
xstring
2016-06-11 22:48:18 +02:00
;};
2019-08-05 22:54:56 +02:00
buildInputs = [ hepmc2 imagemagick python2 latex makeWrapper ];
propagatedBuildInputs = [ fastjet ghostscript gsl yoda ];
2016-06-11 22:48:18 +02:00
2017-12-24 00:13:03 +01:00
preConfigure = ''
2018-08-14 23:49:47 +02:00
substituteInPlace analyses/Makefile.in \
--replace "!(tmp)" ""
2017-12-24 00:13:03 +01:00
substituteInPlace bin/rivet-buildplugin.in \
2019-02-18 18:42:40 +01:00
--replace 'which' '"${which}/bin/which"' \
2017-12-24 00:13:03 +01:00
--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 22:48:18 +02: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}"
2019-08-05 22:54:56 +02:00
"--with-hepmc=${hepmc2}"
2016-06-11 22:48:18 +02:00
"--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;
maintainers = with stdenv.lib.maintainers; [ veprbl ];
2016-06-11 22:48:18 +02:00
};
}