2021-05-20 23:08:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, python, root, makeWrapper, zlib, withRootSupport ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "yoda";
|
2021-04-08 16:26:57 +00:00
|
|
|
version = "1.9.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.hepforge.org/archive/yoda/YODA-${version}.tar.bz2";
|
2021-04-08 16:26:57 +00:00
|
|
|
sha256 = "1x7xi6w7lb92x8202kbaxgqg1sly534wana4f38l3gpbzw9dwmcs";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
patches = [
|
|
|
|
# fix a minor bug
|
|
|
|
# https://gitlab.com/hepcedar/yoda/-/merge_requests/38
|
|
|
|
(fetchpatch {
|
|
|
|
name = "yoda-fix-fuzzy-compare-bin2d.patch";
|
|
|
|
url = "https://gitlab.com/hepcedar/yoda/-/commit/a2999d78cb3d9ed874f367bad375dc39a1a11148.diff";
|
|
|
|
sha256 = "sha256-BsaVm+4VtCvRoEuN4r6A4bj9XwgMe75UesKzN+b56Qw=";
|
|
|
|
})
|
|
|
|
# fix a regression
|
|
|
|
# https://gitlab.com/hepcedar/yoda/-/merge_requests/40
|
|
|
|
(fetchpatch {
|
|
|
|
name = "yoda-fix-for-yodagz.patch";
|
|
|
|
url = "https://gitlab.com/hepcedar/yoda/-/commit/3338ba5a7466599ac6969e4ae462f133d6cf4fd8.diff";
|
|
|
|
sha256 = "sha256-MZTOIt468bdPCS7UVfr5hQZUsVy3TpY/TjRrNySIL70=";
|
|
|
|
excludes = [ "ChangeLog" ];
|
|
|
|
})
|
2021-07-21 07:28:18 +00:00
|
|
|
# fix a minor bug
|
|
|
|
# https://gitlab.com/hepcedar/yoda/-/merge_requests/45
|
|
|
|
(fetchpatch {
|
|
|
|
name = "yoda-fix-yodascale-for-gz.patch";
|
|
|
|
url = "https://gitlab.com/hepcedar/yoda/-/commit/b03162aeaa2c99e38512ba6e4818d2e0a825b757.diff";
|
|
|
|
sha256 = "sha256-IMuPalQ/GKcdJOKAlwE/IRWtxDdu0inoj+A9nbRl6Gs=";
|
|
|
|
})
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = with python.pkgs; [ cython makeWrapper ];
|
|
|
|
buildInputs = [ python ]
|
|
|
|
++ (with python.pkgs; [ numpy matplotlib ])
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional withRootSupport root;
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ zlib ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
touch pyext/yoda/*.{pyx,pxd}
|
2020-05-29 06:06:01 +00:00
|
|
|
patchShebangs .
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for prog in "$out"/bin/*; do
|
|
|
|
wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "check";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Provides small set of data analysis (specifically histogramming) classes";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl3;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://yoda.hepforge.org";
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ veprbl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|