2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchpatch,
|
|
|
|
fetchPypi,
|
|
|
|
meson-python,
|
|
|
|
numpy,
|
|
|
|
python,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "scikit-fmm";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "2023.4.2";
|
2024-06-05 15:53:02 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-14ccR/ggdyq6kvJWUe8U5NJ96M45PArjwCqzxuJCPAs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# TODO: Remove these patches after another stable release is made.
|
|
|
|
# For now, these allow us to build with Python 3.12+ by switching to Meson
|
|
|
|
# and off the deprecated distutils.
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "first-try-at-meson-build.patch";
|
|
|
|
hash = "sha256-Kclg4YrQZL6ZSVsLh6X6DqdztPjDK35L5dp5PqYjzaY=";
|
|
|
|
url = "https://github.com/scikit-fmm/scikit-fmm/commit/a52c0eccb70077553607a5084152316d136b668b.patch";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "work-in-progress-on-meson-build.patch";
|
|
|
|
hash = "sha256-WvSwBz7exqe1H+CqdoMfT5jEoIHnyt/nbc/CryuEKiA=";
|
|
|
|
url = "https://github.com/scikit-fmm/scikit-fmm/commit/db0e7a5f51541745027c3d081d7841e74587793e.patch";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "re-cythonize-the-heap-wrapper.patch";
|
|
|
|
hash = "sha256-ro97+06R0szXQ9I8/sR4JAnFxoQwJeiImDcl1Yp9P0Y=";
|
|
|
|
url = "https://github.com/scikit-fmm/scikit-fmm/commit/4168323e209343facd5f6ba93a85893242e781a2.patch";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail "oldest-supported-numpy" "numpy"
|
|
|
|
'';
|
|
|
|
|
|
|
|
build-system = [ meson-python ];
|
|
|
|
|
|
|
|
dependencies = [ numpy ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
|
|
|
mkdir testdir; cd testdir
|
|
|
|
${python.interpreter} -c "import skfmm, sys; sys.exit(skfmm.test())"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Python extension module which implements the fast marching method";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/scikit-fmm/scikit-fmm";
|
|
|
|
license = licenses.bsd3;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|