summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/cpython/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters/python/cpython/default.nix')
-rw-r--r--pkgs/development/interpreters/python/cpython/default.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 32aa355d3aa..43d2d159e36 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -17,6 +17,7 @@
 # For the Python package set
 , packageOverrides ? (self: super: {})
 , buildPackages
+, pythonForBuild ? buildPackages.${"python${sourceVersion.major}${sourceVersion.minor}"}
 , sourceVersion
 , sha256
 , passthruFun
@@ -63,7 +64,7 @@ let
 
   hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false);
 
-  pythonForBuild = buildPackages.${"python${sourceVersion.major}${sourceVersion.minor}"};
+  inherit pythonForBuild;
 
   pythonForBuildInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then
     "$out/bin/python"
@@ -100,7 +101,7 @@ in with passthru; stdenv.mkDerivation {
   ] ++ optionals isPy35 [
     # Backports support for LD_LIBRARY_PATH from 3.6
     ./3.5/ld_library_path.patch
-  ] ++ optionals isPy37 [
+  ] ++ optionals (isPy37 || isPy38) [
     # Fix darwin build https://bugs.python.org/issue34027
     (fetchpatch {
       url = https://bugs.python.org/file47666/darwin-libutil.patch;
@@ -114,7 +115,7 @@ in with passthru; stdenv.mkDerivation {
     (
       if isPy35 then
         ./3.5/python-3.x-distutils-C++.patch
-      else if isPy37 then
+      else if isPy37 || isPy38 then
         ./3.7/python-3.x-distutils-C++.patch
       else
         fetchpatch {