2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
numpy,
|
|
|
|
pybind11,
|
|
|
|
wheel,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
graphviz,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyhepmc";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.13.2";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scikit-hep";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-M18Bq6WrAINpgPx5+uh8dufPBxIklRHpbBWUYMC8v10=";
|
2023-10-09 19:29:22 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ pybind11 ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ numpy ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|