2021-06-28 23:13:55 +00:00
|
|
|
{ lib, stdenv, fetchurl, python, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lhapdf";
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "6.4.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.hepforge.org/archive/lhapdf/LHAPDF-${version}.tar.gz";
|
2021-10-28 06:52:43 +00:00
|
|
|
sha256 = "sha256-fS8CZ+LWWw3e4EhVOzQtfIk6bbq+HjJsrWLeABDdgQw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# The Apple SDK only exports locale_t from xlocale.h whereas glibc
|
|
|
|
# had decided that xlocale.h should be a part of locale.h
|
|
|
|
postPatch = lib.optionalString (stdenv.isDarwin && stdenv.cc.isGNU) ''
|
|
|
|
substituteInPlace src/GridPDF.cc --replace '#include <locale>' '#include <xlocale.h>'
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = [ python ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
passthru = {
|
2021-02-05 17:12:51 +00:00
|
|
|
pdf_sets = import ./pdf_sets.nix { inherit lib stdenv fetchurl; };
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/lhapdf --prefix PYTHONPATH : "$(toPythonPath "$out")"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A general purpose interpolator, used for evaluating Parton Distribution Functions from discretised data files";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.gpl2;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://lhapdf.hepforge.org";
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ veprbl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|