Skip to content

Commit

Permalink
python38: fix build on macOS
Browse files Browse the repository at this point in the history
Python 3.8 fails to build on macOS for two reasons:

* python-3.x-distutils-C++.patch fails to apply cleanly.
* An #include for <util.h> 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 <util.h>.
  • Loading branch information
strager authored and FRidh committed Oct 15, 2019
1 parent 1f42959 commit 81d1594
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/development/interpreters/python/cpython/default.nix
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/interpreters/python/default.nix
Expand Up @@ -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;
Expand Down

0 comments on commit 81d1594

Please sign in to comment.