Files
nixpkgs/pkgs/by-name/ri/rivet/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

120 lines
3.1 KiB
Nix

{
lib,
stdenv,
fetchurl,
fastjet,
fastjet-contrib,
ghostscript,
graphicsmagick-imagemagick-compat,
hdf5,
hepmc3,
highfive,
less,
pkg-config,
python3,
rsync,
texliveBasic,
yoda,
which,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "rivet";
version = "4.1.1";
src = fetchurl {
url = "https://www.hepforge.org/archive/rivet/Rivet-${version}.tar.bz2";
hash = "sha256-vR1RM1XD9y8PiKly853Z8RRM6uLLRyVC5dMGD+q08cw=";
};
latex = texliveBasic.withPackages (
ps: with ps; [
collection-pstricks
collection-fontsrecommended
l3kernel
l3packages
mathastext
pgf
relsize
sansmath
sfmath
siunitx
xcolor
xkeyval
xstring
]
);
nativeBuildInputs = [
rsync
makeWrapper
pkg-config
];
buildInputs = [
graphicsmagick-imagemagick-compat
hepmc3
highfive
python3
latex
python3.pkgs.yoda
];
propagatedBuildInputs = [
hdf5
fastjet
fastjet-contrib
];
preConfigure = ''
substituteInPlace configure \
--replace-fail 'if test $HEPMC_VERSION -le 310; then' 'if false; then'
substituteInPlace bin/rivet-build.in \
--replace-fail 'num_jobs=$(getconf _NPROCESSORS_ONLN)' 'num_jobs=''${NIX_BUILD_CORES:-$(getconf _NPROCESSORS_ONLN)}' \
--replace-fail 'which' '"${which}/bin/which"' \
--replace-fail 'mycxx=' 'mycxx=${stdenv.cc}/bin/${
if stdenv.cc.isClang or false then "clang++" else "g++"
} #' \
--replace-fail 'mycxxflags="' "mycxxflags=\"$NIX_CFLAGS_COMPILE $NIX_CXXSTDLIB_COMPILE $NIX_CFLAGS_LINK "
'';
preInstall = ''
substituteInPlace bin/make-plots \
--replace-fail '"which"' '"${which}/bin/which"' \
--replace-fail '"latex"' '"'$latex'/bin/latex"' \
--replace-fail '"dvips"' '"'$latex'/bin/dvips"' \
--replace-fail '"ps2pdf"' '"${ghostscript}/bin/ps2pdf"' \
--replace-fail '"ps2eps"' '"${ghostscript}/bin/ps2eps"' \
--replace-fail '"kpsewhich"' '"'$latex'/bin/kpsewhich"' \
--replace-fail '"convert"' '"${graphicsmagick-imagemagick-compat.out}/bin/convert"'
substituteInPlace bin/rivet \
--replace-fail '"less"' '"${less}/bin/less"'
substituteInPlace bin/rivet-mkhtml-tex \
--replace-fail '"make-plots"' \"$out/bin/make-plots\" \
--replace-fail '"rivet-cmphistos"' \"$out/bin/rivet-cmphistos\" \
--replace-fail 'ch_cmd = [sys.executable, os.path.join(os.path.dirname(__file__),' 'ch_cmd = [('
'';
configureFlags = [
"--with-fastjet=${fastjet}"
"--with-yoda=${yoda}"
"--with-hepmc3=${hepmc3}"
"--with-highfive=${highfive}"
];
enableParallelBuilding = true;
postInstall = ''
for prog in "$out"/bin/*; do
wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
done
'';
meta = {
description = "Framework for comparison of experimental measurements from high-energy particle colliders to theory predictions";
license = lib.licenses.gpl3;
homepage = "https://rivet.hepforge.org";
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ veprbl ];
};
}