about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2021-03-25 16:07:55 -0400
committerGitHub <noreply@github.com>2021-03-25 16:07:55 -0400
commitbf5c995ad2a36073f94e4cd61bff05c6e04f8b3b (patch)
treef1ba51a6fa646e10933d07c59328b35fe0277616 /pkgs/applications
parentc8f68e43a1e1febed17a98a1d08421e55a67baaf (diff)
parent7adf3f81277a4eea6aeecfd2142de3924c229a8a (diff)
downloadnixlib-bf5c995ad2a36073f94e4cd61bff05c6e04f8b3b.tar
nixlib-bf5c995ad2a36073f94e4cd61bff05c6e04f8b3b.tar.gz
nixlib-bf5c995ad2a36073f94e4cd61bff05c6e04f8b3b.tar.bz2
nixlib-bf5c995ad2a36073f94e4cd61bff05c6e04f8b3b.tar.lz
nixlib-bf5c995ad2a36073f94e4cd61bff05c6e04f8b3b.tar.xz
nixlib-bf5c995ad2a36073f94e4cd61bff05c6e04f8b3b.tar.zst
nixlib-bf5c995ad2a36073f94e4cd61bff05c6e04f8b3b.zip
Merge pull request #116487 from veprbl/pr/professor_init
professor: init at 2.3.3
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/science/physics/professor/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/applications/science/physics/professor/default.nix b/pkgs/applications/science/physics/professor/default.nix
new file mode 100644
index 000000000000..6d52951ee9c9
--- /dev/null
+++ b/pkgs/applications/science/physics/professor/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, eigen, makeWrapper, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "professor";
+  version = "2.3.3";
+
+  src = fetchurl {
+    name = "Professor-${version}.tar.gz";
+    url = "https://professor.hepforge.org/downloads/?f=Professor-${version}.tar.gz";
+    sha256 = "17q026r2fpfxzf74d1013ksy3a9m57rcr2q164n9x02ci40bmib0";
+  };
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace '-shared -o' '-shared -install_name "$(out)/$@" -o'
+  '';
+
+  nativeBuildInputs = [ python3.pkgs.cython makeWrapper ];
+  buildInputs = [ python3 eigen ];
+  propagatedBuildInputs = with python3.pkgs; [ iminuit numpy matplotlib yoda ];
+
+  CPPFLAGS = [ "-I${eigen}/include/eigen3" ];
+  PREFIX = placeholder "out";
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+      wrapProgram "$prog" --set PYTHONPATH "$PYTHONPATH:$(toPythonPath "$out")"
+    done
+  '';
+
+  doInstallCheck = true;
+  installCheckTarget = "check";
+
+  meta = with lib; {
+    description = "A tuning tool for Monte Carlo event generators";
+    homepage = "https://professor.hepforge.org/";
+    license = licenses.unfree; # no license specified
+    maintainers = [ maintainers.veprbl ];
+    platforms = platforms.unix;
+  };
+}