From 2e7c3920a07136c9b7321ba7b24dbdf5528d533f Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 21 Aug 2022 16:27:25 +0200 Subject: [PATCH] pythonPackages: fix cross compilation This fixes, again, the issue with the wrong headers being used when cross compiling python packages with extensions. For context, see https://github.com/NixOS/nixpkgs/pull/173435. --- pkgs/development/python-modules/setuptools/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index 883ca18e93e4..2d3c06d602f1 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -1,6 +1,7 @@ { stdenv , buildPythonPackage , fetchFromGitHub +, fetchpatch , python , bootstrapped-pip , lib @@ -27,6 +28,14 @@ let patches = [ ./tag-date.patch ./setuptools-distutils-C++.patch + # Fix cross compilation of extension modules + # https://github.com/pypa/distutils/pull/173 + (fetchpatch { + url = "https://github.com/pypa/distutils/commit/22b9bcf2e2d2a66f7dc96661312972e2f6bd9e01.patch"; + hash = "sha256-IVb1LLgLIHO6HPn2911uksrLB1jG0MyQetdxkq5wcG4="; + stripLen = 2; + extraPrefix = "setuptools/_distutils/"; + }) ]; buildPhase = ''