9 stdenv.mkDerivation rec {
14 url = "https://www.hepforge.org/archive/lhapdf/LHAPDF-${version}.tar.gz";
15 sha256 = "sha256-JEOksyzDsFl8gki9biVwOs6ckaeiU8X2CxtUKO+chp4=";
18 # The Apple SDK only exports locale_t from xlocale.h whereas glibc
19 # had decided that xlocale.h should be a part of locale.h
20 postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.cc.isGNU) ''
21 substituteInPlace src/GridPDF.cc --replace '#include <locale>' '#include <xlocale.h>'
26 ++ lib.optionals (python != null && lib.versionAtLeast python.version "3.10") [
29 buildInputs = [ python ];
31 configureFlags = lib.optionals (python == null) [ "--disable-python" ];
33 preBuild = lib.optionalString (python != null && lib.versionAtLeast python.version "3.10") ''
34 rm wrappers/python/lhapdf.cpp
37 enableParallelBuilding = true;
40 pdf_sets = import ./pdf_sets.nix { inherit lib stdenv fetchurl; };
44 wrapProgram $out/bin/lhapdf --prefix PYTHONPATH : "$(toPythonPath "$out")"
48 description = "General purpose interpolator, used for evaluating Parton Distribution Functions from discretised data files";
49 license = licenses.gpl2;
50 homepage = "http://lhapdf.hepforge.org";
51 platforms = platforms.unix;
52 maintainers = with maintainers; [ veprbl ];