python3Packages.mypy: fix build w/ glibc-2.44

Otherwiwse a bunch of tests break with
"warning: ‘_POSIX_C_SOURCE’ redefined".

Apparently this now happens, if software doesn't adhere to the rule of
`Python.h` having to be included first[1]. The applied patch focuses on
Python 3.15 support, but also happens to fix that.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2416110
This commit is contained in:
Maximilian Bosch
2026-08-24 01:24:00 +02:00
parent 9c912cb797
commit 31bb833ca2

View File

@@ -6,6 +6,7 @@
gitUpdater,
pythonAtLeast,
isPyPy,
fetchpatch,
# build-system
pathspec,
@@ -49,6 +50,15 @@ buildPythonPackage rec {
hash = "sha256-sm/pxQGxH5XuPH7B8i3fpp30KaFU9aSp6BT67UcDPvU=";
};
patches = [
# fix build w/ glibc-2.44
# If Python.h isn't included first, a const redefinition error now occurs otherwise.
(fetchpatch {
url = "https://github.com/python/mypy/commit/46acbe85c0e1703ebf2e6d4c699772edcdcf4652.patch";
hash = "sha256-KslHiKqinvvXZoxvCnZXOhCm7i8577PbSdNGudCsjZE=";
})
];
passthru.updateScript = gitUpdater {
rev-prefix = "v";
};