From 81d15948cc19c2584f13031518349327ce353c82 Mon Sep 17 00:00:00 2001 From: Matthew Glazar Date: Mon, 14 Oct 2019 21:49:46 -0700 Subject: [PATCH] python38: fix build on macOS Python 3.8 fails to build on macOS for two reasons: * python-3.x-distutils-C++.patch fails to apply cleanly. * An #include for is missing, causing a build failure: ./Modules/posixmodule.c:6586:9: error: implicit declaration of function 'openpty' is invalid in C99 if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0) ^ Use the correct version of python-3.x-distutils-C++.patch, and add a patch to #include . --- pkgs/development/interpreters/python/cpython/default.nix | 4 ++-- pkgs/development/interpreters/python/default.nix | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 32aa355d3aa..09c324716bd 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -100,7 +100,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 +114,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 { diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 4c207ea067a..43a3125d8a0 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -28,6 +28,7 @@ with pkgs; isPy35 = pythonVersion == "3.5"; isPy36 = pythonVersion == "3.6"; isPy37 = pythonVersion == "3.7"; + isPy38 = pythonVersion == "3.8"; isPy2 = lib.strings.substring 0 1 pythonVersion == "2"; isPy3 = lib.strings.substring 0 1 pythonVersion == "3"; isPy3k = isPy3;