summary refs log tree commit diff
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2018-07-03 13:29:07 -0400
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2018-07-03 13:29:07 -0400
commitea08cf9e6c0d77c08dfc557b61270a9559f8eddc (patch)
tree223bd001cf80feba4a54e48da0e2375ac059fb80
parent29c3f32841d1fe5421f4d3360480a1c1331e1e9e (diff)
downloadnixpkgs-ea08cf9e6c0d77c08dfc557b61270a9559f8eddc.tar
nixpkgs-ea08cf9e6c0d77c08dfc557b61270a9559f8eddc.tar.gz
nixpkgs-ea08cf9e6c0d77c08dfc557b61270a9559f8eddc.tar.bz2
nixpkgs-ea08cf9e6c0d77c08dfc557b61270a9559f8eddc.tar.lz
nixpkgs-ea08cf9e6c0d77c08dfc557b61270a9559f8eddc.tar.xz
nixpkgs-ea08cf9e6c0d77c08dfc557b61270a9559f8eddc.tar.zst
nixpkgs-ea08cf9e6c0d77c08dfc557b61270a9559f8eddc.zip
python37: apply distutils patch
-rw-r--r--pkgs/development/interpreters/python/cpython/3.7/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/python/cpython/3.7/default.nix b/pkgs/development/interpreters/python/cpython/3.7/default.nix
index 410d07ebc61..329851b5d65 100644
--- a/pkgs/development/interpreters/python/cpython/3.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/3.7/default.nix
@@ -39,6 +39,8 @@ let
     ++ optionals x11Support [ tcl tk libX11 xproto ]
     ++ optionals stdenv.isDarwin [ CF configd ];
 
+  hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false);
+
 in stdenv.mkDerivation {
   name = "python3-${version}";
   pythonVersion = majorVersion;
@@ -63,6 +65,15 @@ in stdenv.mkDerivation {
 
   patches = [
     ./no-ldconfig.patch
+  ] ++ optionals hasDistutilsCxxPatch [
+    # Fix for http://bugs.python.org/issue1222585
+    # Upstream distutils is calling C compiler to compile C++ code, which
+    # only works for GCC and Apple Clang. This makes distutils to call C++
+    # compiler when needed.
+    (fetchpatch {
+      url = "https://bugs.python.org/file47669/python-3.8-distutils-C++.patch";
+      sha256 = "0s801d7ww9yrk6ys053jvdhl0wicbznx08idy36f1nrrxsghb3ii";
+    })
   ];
 
   postPatch = ''
@@ -147,7 +158,7 @@ in stdenv.mkDerivation {
   passthru = let
     pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;};
   in rec {
-    inherit libPrefix sitePackages x11Support;
+    inherit libPrefix sitePackages x11Support hasDistutilsCxxPatch;
     executable = "${libPrefix}m";
     buildEnv = callPackage ../../wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
     withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};