From 69fe6e919a916e5b7584aec358cf6311e298772f Mon Sep 17 00:00:00 2001 From: sempiternal-aurora <78790545+sempiternal-aurora@users.noreply.github.com> Date: Sat, 27 Jun 2026 22:25:21 +1000 Subject: [PATCH] python3Packages.numpy: fix build Remove old distutils patches. Distutils as a build system has been deprecated for a while in favor of meson, and we don't use it anymore. They've finally fully removed all the upstream distutils code, so remove the distutils patch as it isn't needed anymore --- pkgs/development/python-modules/numpy/2.nix | 7 ----- .../numpy/numpy-distutils-C++.patch | 30 ------------------- 2 files changed, 37 deletions(-) delete mode 100644 pkgs/development/python-modules/numpy/numpy-distutils-C++.patch diff --git a/pkgs/development/python-modules/numpy/2.nix b/pkgs/development/python-modules/numpy/2.nix index 712130d6a0a8..e097ad7bb298 100644 --- a/pkgs/development/python-modules/numpy/2.nix +++ b/pkgs/development/python-modules/numpy/2.nix @@ -48,13 +48,6 @@ buildPythonPackage (finalAttrs: { hash = "sha256-RiC1dLoDamK5B2VzHBL0V//K/Vix25q11wNGcl3Witk="; }; - patches = lib.optionals python.hasDistutilsCxxPatch [ - # We patch cpython/distutils to fix https://bugs.python.org/issue1222585 - # Patching of numpy.distutils is needed to prevent it from undoing the - # patch to distutils. - ./numpy-distutils-C++.patch - ]; - postPatch = '' # remove needless reference to full Python path stored in built wheel substituteInPlace numpy/meson.build \ diff --git a/pkgs/development/python-modules/numpy/numpy-distutils-C++.patch b/pkgs/development/python-modules/numpy/numpy-distutils-C++.patch deleted file mode 100644 index 6c75f34ce07a..000000000000 --- a/pkgs/development/python-modules/numpy/numpy-distutils-C++.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py ---- a/numpy/distutils/unixccompiler.py -+++ b/numpy/distutils/unixccompiler.py -@@ -37,8 +37,6 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts - if opt not in llink_s: - self.linker_so = llink_s.split() + opt.split() - -- display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src) -- - # gcc style automatic dependencies, outputs a makefile (-MF) that lists - # all headers needed by a c file as a side effect of compilation (-MMD) - if getattr(self, '_auto_depends', False): -@@ -47,8 +45,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts - deps = [] - - try: -- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps + -- extra_postargs, display = display) -+ if self.detect_language(src) == 'c++': -+ display = '%s: %s' % (os.path.basename(self.compiler_so_cxx[0]), src) -+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + deps + -+ extra_postargs, display = display) -+ else: -+ display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src) -+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + deps + -+ extra_postargs, display = display) -+ - except DistutilsExecError as e: - msg = str(e) - raise CompileError(msg)