From 31bb833ca2b358a8d557e1a8cfae13f2214e4b60 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 24 Aug 2026 01:24:00 +0200 Subject: [PATCH] python3Packages.mypy: fix build w/ glibc-2.44 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- pkgs/development/python-modules/mypy/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/python-modules/mypy/default.nix b/pkgs/development/python-modules/mypy/default.nix index 68587c7c345f..a50eb9c32761 100644 --- a/pkgs/development/python-modules/mypy/default.nix +++ b/pkgs/development/python-modules/mypy/default.nix @@ -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"; };