2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
cmake,
|
|
|
|
setuptools,
|
|
|
|
boost,
|
|
|
|
eigen,
|
|
|
|
gmp,
|
|
|
|
cgal, # see https://github.com/NixOS/nixpkgs/pull/94875 about cgal
|
|
|
|
mpfr,
|
|
|
|
tbb,
|
|
|
|
numpy,
|
|
|
|
cython,
|
|
|
|
pybind11,
|
|
|
|
matplotlib,
|
|
|
|
scipy,
|
|
|
|
pytest,
|
|
|
|
enableTBB ? false,
|
2021-08-22 07:53:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gudhi";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "3.9.0";
|
|
|
|
pyproject = true;
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "GUDHI";
|
|
|
|
repo = "gudhi-devel";
|
|
|
|
rev = "tags/gudhi-release-${version}";
|
|
|
|
fetchSubmodules = true;
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-VL6RIPe8a2/cUHnHOql9e9EUMBB9QU311kMCaMZTbGI=";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
numpy
|
|
|
|
cython
|
|
|
|
pybind11
|
|
|
|
matplotlib
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
eigen
|
|
|
|
gmp
|
|
|
|
cgal
|
|
|
|
mpfr
|
|
|
|
] ++ lib.optionals enableTBB [ tbb ];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytest ];
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.cmakeBool "WITH_GUDHI_PYTHON" true)
|
|
|
|
(lib.cmakeFeature "Python_ADDITIONAL_VERSIONS" "3")
|
2021-08-22 07:53:02 +00:00
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace src/python/CMakeLists.txt \
|
|
|
|
--replace '"''${GUDHI_PYTHON_PATH_ENV}"' ""
|
|
|
|
'';
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
preBuild = ''
|
|
|
|
cd src/python
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
rm -r gudhi
|
2024-02-29 20:09:43 +00:00
|
|
|
ctest --output-on-failure
|
|
|
|
|
|
|
|
runHook postCheck
|
2021-08-22 07:53:02 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"gudhi"
|
|
|
|
"gudhi.hera"
|
|
|
|
"gudhi.point_cloud"
|
|
|
|
"gudhi.clustering"
|
|
|
|
];
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Library for Computational Topology and Topological Data Analysis (TDA)";
|
|
|
|
homepage = "https://gudhi.inria.fr/python/latest/";
|
|
|
|
downloadPage = "https://github.com/GUDHI/gudhi-devel";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = with lib.licenses; [
|
|
|
|
mit
|
|
|
|
gpl3
|
|
|
|
];
|
2021-08-22 07:53:02 +00:00
|
|
|
maintainers = with lib.maintainers; [ yl3dy ];
|
|
|
|
};
|
|
|
|
}
|