Merge pull request #314704 from ConnorBaker/fix/python3Packages.scikit-fmm

python3Packages.scikit-fmm: fix build on Python 3.12+
This commit is contained in:
Sandro 2024-05-26 20:43:55 +02:00 committed by GitHub
commit b5995681aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,9 @@
{ {
lib, lib,
buildPythonPackage, buildPythonPackage,
fetchpatch,
fetchPypi, fetchPypi,
meson-python,
numpy, numpy,
python, python,
}: }:
@ -9,14 +11,42 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "scikit-fmm"; pname = "scikit-fmm";
version = "2023.4.2"; version = "2023.4.2";
format = "setuptools"; pyproject = true;
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
hash = "sha256-14ccR/ggdyq6kvJWUe8U5NJ96M45PArjwCqzxuJCPAs="; hash = "sha256-14ccR/ggdyq6kvJWUe8U5NJ96M45PArjwCqzxuJCPAs=";
}; };
propagatedBuildInputs = [ numpy ]; # 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";
})
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "oldest-supported-numpy" "numpy"
'';
build-system = [ meson-python ];
dependencies = [ numpy ];
checkPhase = '' checkPhase = ''
mkdir testdir; cd testdir mkdir testdir; cd testdir