Unverified Commit f0325441 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by GitHub
Browse files

Merge pull request #215867 from veprbl/pr/nnpdf_4_0_6

nnpdf: 4.0.4 -> 4.0.6, provide n3fit
parents 5b7b4ed3 34ccf74c
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, pkg-config
, apfel
@@ -16,22 +15,15 @@

stdenv.mkDerivation rec {
  pname = "nnpdf";
  version = "4.0.4";
  version = "4.0.6";

  src = fetchFromGitHub {
    owner = "NNPDF";
    repo = pname;
    rev = version;
    sha256 = "sha256-Alx4W0TkPzJBsnRXcKBrlEU6jWTnOjrji/IPk+dNCw0=";
    hash = "sha256-mwOMNlYFhHZq/wakO1/HGwcxvKGKh5OyFa2D9d3Y3IA=";
  };

  patches = [
    (fetchpatch {
      url = "https://github.com/NNPDF/nnpdf/commit/7943b62a91d3a41fd4f6366b18881d50695f4b45.diff";
      hash = "sha256-UXhTO7vZgJiY8h3bgjg7SQC0gMUQsYQ/V/PgtCEQ7VU=";
    })
  ];

  postPatch = ''
    for file in CMakeLists.txt buildmaster/CMakeLists.txt; do
      substituteInPlace $file \
+50 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, hyperopt
, keras
, nnpdf
, psutil
, tensorflow
, validphys2
}:

buildPythonPackage rec {
  pname = "n3fit";
  version = "4.0";
  format = "setuptools";

  inherit (nnpdf) src;

  prePatch = ''
    cd n3fit
  '';

  postPatch = ''
    substituteInPlace src/n3fit/version.py \
      --replace '= __give_git()' '= "'$version'"'
  '';

  propagatedBuildInputs = [
    hyperopt
    keras
    psutil
    tensorflow
    validphys2
  ];

  postInstall = ''
    for prog in "$out"/bin/*; do
      wrapProgram "$prog" --set PYTHONPATH "$PYTHONPATH:$(toPythonPath "$out")"
    done
  '';

  doCheck = false; # no tests
  pythonImportsCheck = [ "n3fit" ];

  meta = with lib; {
    description = "NNPDF fitting framework";
    homepage = "https://docs.nnpdf.science";
    inherit (nnpdf.meta) license;
    maintainers = with maintainers; [ veprbl ];
  };
}
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ buildPythonPackage rec {

  postPatch = ''
    substituteInPlace src/validphys/version.py \
      --replace '= __give_git()' '= "${version}"'
      --replace '= __give_git()' '= "'$version'"'
  '';

  propagatedBuildInputs = [
+2 −0
Original line number Diff line number Diff line
@@ -6196,6 +6196,8 @@ self: super: with self; {

  myst-parser = callPackage ../development/python-modules/myst-parser { };

  n3fit = callPackage ../development/python-modules/n3fit { };

  nad-receiver = callPackage ../development/python-modules/nad-receiver { };

  nagiosplugin = callPackage ../development/python-modules/nagiosplugin { };