stdenv: bootstrap darwin with python3

- Replaced python override from the final stdenv, instead we
  propagate our bootstrap python to stage4 and override both
  CF and xnu to use it.

- Removed CF argument from python interpreters, this is redundant
  since it's not overidden anymore.

- Inherit CF from stage4, making it the same as the stdenv.
This commit is contained in:
Daiderd Jordan
2020-01-13 11:34:36 +01:00
parent 73db5d8c38
commit 6328518e98
5 changed files with 22 additions and 137 deletions
+10 -23
View File
@@ -190,13 +190,10 @@ in rec {
useSharedLibraries = false;
};
python = super.callPackage ../../development/interpreters/python/cpython/2.7/boot.nix {
CF = null; # use CoreFoundation from bootstrap-tools
configd = null;
};
python2 = self.python;
python3 = super.python3Minimal;
ninja = super.ninja.override { buildDocs = false; };
darwin = super.darwin // {
cctools = super.darwin.cctools.override {
enableTapiSupport = false;
@@ -218,11 +215,11 @@ in rec {
stage2 = prevStage: let
persistent = self: super: with prevStage; {
inherit
zlib patchutils m4 scons flex perl bison unifdef unzip openssl python
zlib patchutils m4 scons flex perl bison unifdef unzip openssl python3
libxml2 gettext sharutils gmp libarchive ncurses pkg-config libedit groff
openssh sqlite sed serf openldap db cyrus-sasl expat apr-util subversion xz
findfreetype libssh curl cmake autoconf automake libtool ed cpio coreutils
libssh2 nghttp2 libkrb5 python2 ninja;
libssh2 nghttp2 libkrb5 ninja;
darwin = super.darwin // {
inherit (darwin)
@@ -252,11 +249,11 @@ in rec {
stage3 = prevStage: let
persistent = self: super: with prevStage; {
inherit
patchutils m4 scons flex perl bison unifdef unzip openssl python
patchutils m4 scons flex perl bison unifdef unzip openssl python3
gettext sharutils libarchive pkg-config groff bash subversion
openssh sqlite sed serf openldap db cyrus-sasl expat apr-util
findfreetype libssh curl cmake autoconf automake libtool cpio
libssh2 nghttp2 libkrb5 python2 ninja;
libssh2 nghttp2 libkrb5 ninja;
# Avoid pulling in a full python and its extra dependencies for the llvm/clang builds.
libxml2 = super.libxml2.override { pythonSupport = false; };
@@ -302,7 +299,7 @@ in rec {
stage4 = prevStage: let
persistent = self: super: with prevStage; {
inherit
gnumake gzip gnused bzip2 gawk ed xz patch bash
gnumake gzip gnused bzip2 gawk ed xz patch bash python3
ncurses libffi zlib gmp pcre gnugrep
coreutils findutils diffutils patchutils ninja;
@@ -332,7 +329,7 @@ in rec {
libxml2-nopython = super.libxml2.override { pythonSupport = false; };
CF = super.darwin.CF.override {
libxml2 = libxml2-nopython;
python = prevStage.python;
python3 = prevStage.python3;
};
};
};
@@ -365,17 +362,6 @@ in rec {
});
in { inherit tools libraries; } // tools // libraries);
# N.B: the important thing here is to ensure that python == python2
# == python27 or you get weird issues with inconsistent package sets.
# In a particularly subtle bug, I overrode python2 instead of python27
# here, and it caused gnome-doc-utils to complain about:
# "PyThreadState_Get: no current thread". This is because Python gets
# really unhappy if you have Python A which loads a native python lib
# which was linked against Python B, which in our case was happening
# because we didn't override python "deeply enough". Anyway, this works
# and I'm just leaving this blurb here so people realize why it matters
python27 = super.python27.override { CF = prevStage.darwin.CF; };
darwin = super.darwin // {
inherit (darwin) dyld ICU Libsystem libiconv;
} // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) {
@@ -438,7 +424,8 @@ in rec {
inherit cc;
darwin = super.darwin // {
xnu = super.darwin.xnu.override { python = super.python.override { configd = null; }; };
inherit (prevStage.darwin) CF;
xnu = super.darwin.xnu.override { inherit (prevStage) python3; };
};
});
};