about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyhepmc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyhepmc/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyhepmc/default.nix69
1 files changed, 69 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyhepmc/default.nix b/nixpkgs/pkgs/development/python-modules/pyhepmc/default.nix
new file mode 100644
index 000000000000..7e59dbf9b112
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyhepmc/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, cmake
+, setuptools
+, setuptools-scm
+, numpy
+, pybind11
+, wheel
+, pytestCheckHook
+, pythonOlder
+, graphviz
+}:
+
+buildPythonPackage rec {
+  pname = "pyhepmc";
+  version = "2.12.0";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "scikit-hep";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-po1ad02dpY69RRhaRApskH6tdOaSIsCl5PgpjsAzyKo=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    cmake
+    setuptools
+    setuptools-scm
+    wheel
+  ];
+
+  buildInputs = [
+    pybind11
+  ];
+
+  propagatedBuildInputs = [
+    numpy
+  ];
+
+  dontUseCmakeConfigure = true;
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+  CMAKE_ARGS = [ "-DEXTERNAL_PYBIND11=ON" ];
+
+  preBuild = ''
+    export CMAKE_BUILD_PARALLEL_LEVEL="$NIX_BUILD_CORES"
+  '';
+
+  nativeCheckInputs = [
+    graphviz
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [ "pyhepmc" ];
+
+  meta = with lib; {
+    description = "Easy-to-use Python bindings for HepMC3";
+    homepage = "https://github.com/scikit-hep/pyhepmc";
+    changelog = "https://github.com/scikit-hep/pyhepmc/releases/tag/v${version}";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
+