about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2024-06-13 15:30:04 -0400
committerGitHub <noreply@github.com>2024-06-13 15:30:04 -0400
commit7f8666b1af8ace653c52c48cada07873d8df366c (patch)
tree007602f00c65c4cd5546d26da453b04f1d9b49ac /pkgs
parent302b68d2792f15e6ed09a4a8c85c99f97dbaf59e (diff)
professor: 2.3.3 -> 2.4.2 (#319402)
(cherry picked from commit 827fad6fceefd644f8803d4adb35ae46616b0cf4)

Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/science/physics/professor/default.nix52
1 files changed, 40 insertions, 12 deletions
diff --git a/pkgs/applications/science/physics/professor/default.nix b/pkgs/applications/science/physics/professor/default.nix
index 6d52951ee9c9b..c01e194034dd3 100644
--- a/pkgs/applications/science/physics/professor/default.nix
+++ b/pkgs/applications/science/physics/professor/default.nix
@@ -1,23 +1,51 @@
-{ lib, stdenv, fetchurl, eigen, makeWrapper, python3 }:
+{ lib
+, stdenv
+, fetchFromGitLab
+, eigen
+, makeWrapper
+, python3
+}:
 
 stdenv.mkDerivation rec {
   pname = "professor";
-  version = "2.3.3";
+  version = "2.4.2";
 
-  src = fetchurl {
-    name = "Professor-${version}.tar.gz";
-    url = "https://professor.hepforge.org/downloads/?f=Professor-${version}.tar.gz";
-    sha256 = "17q026r2fpfxzf74d1013ksy3a9m57rcr2q164n9x02ci40bmib0";
+  src = fetchFromGitLab {
+    owner = "hepcedar";
+    repo = "professor";
+    rev = "refs/tags/professor-2.4.2";
+    hash = "sha256-z2Ub7SUTz4Hj3ajnzOV/QXZ+cH2v6zJv9UZM2M2y1Hg=";
+    # workaround unpacking to case-sensitive filesystems
+    postFetch = ''
+      rm -rf $out/[Dd]ocker
+    '';
   };
 
-  postPatch = lib.optionalString stdenv.isDarwin ''
+  postPatch = ''
     substituteInPlace Makefile \
-      --replace '-shared -o' '-shared -install_name "$(out)/$@" -o'
+      --replace-fail 'pip install ' 'pip install --prefix $(out) '
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace-fail '-shared -o' '-shared -install_name "$(out)/$@" -o'
   '';
 
-  nativeBuildInputs = [ python3.pkgs.cython makeWrapper ];
-  buildInputs = [ python3 eigen ];
-  propagatedBuildInputs = with python3.pkgs; [ iminuit numpy matplotlib yoda ];
+  nativeBuildInputs = [
+    python3.pkgs.cython
+    python3.pkgs.pip
+    python3.pkgs.setuptools
+    python3.pkgs.wheel
+    makeWrapper
+  ];
+  buildInputs = [
+    python3
+    eigen
+  ];
+  propagatedBuildInputs = with python3.pkgs; [
+    iminuit
+    numpy
+    matplotlib
+    yoda
+  ];
 
   CPPFLAGS = [ "-I${eigen}/include/eigen3" ];
   PREFIX = placeholder "out";
@@ -34,7 +62,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "A tuning tool for Monte Carlo event generators";
     homepage = "https://professor.hepforge.org/";
-    license = licenses.unfree; # no license specified
+    license = licenses.gpl3Only;
     maintainers = [ maintainers.veprbl ];
     platforms = platforms.unix;
   };