1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 23:20:55 +00:00

stdenv: cleanup darwin bootstrapping

Also gets rid of the full python and some of it's dependencies in the
stdenv build closure.
This commit is contained in:
Daiderd Jordan 2018-07-15 10:33:23 +02:00
parent 2c07921cff
commit 93c34c7616
No known key found for this signature in database
GPG key ID: D02435D05B810C96
3 changed files with 26 additions and 19 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, CF, configd, coreutils }: { stdenv, fetchurl, configd, CF, coreutils }:
with stdenv.lib; with stdenv.lib;

View file

@ -188,7 +188,18 @@ in rec {
}; };
stage1 = prevStage: let stage1 = prevStage: let
persistent = _: super: { python = super.python.override { configd = null; }; }; persistent = self: super: with prevStage; {
cmake = super.cmake.override {
majorVersion = "3.9"; # FIXME: update ApplicationServices patch
isBootstrap = true;
useSharedLibraries = false;
};
python = super.callPackage ../../development/interpreters/python/cpython/2.7/boot.nix {
CF = null; # use CoreFoundation from bootstrap-tools
configd = null;
};
};
in with prevStage; stageFun 1 prevStage { in with prevStage; stageFun 1 prevStage {
extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\""; extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\"";
extraNativeBuildInputs = []; extraNativeBuildInputs = [];
@ -239,6 +250,9 @@ in rec {
openssh sqlite sed serf openldap db cyrus-sasl expat apr-util openssh sqlite sed serf openldap db cyrus-sasl expat apr-util
findfreetype libssh curl cmake autoconf automake libtool cpio; findfreetype libssh curl cmake autoconf automake libtool cpio;
# Avoid pulling in a full python and it's extra dependencies for the llvm/clang builds.
libxml2 = super.libxml2.override { pythonSupport = false; };
llvmPackages_5 = super.llvmPackages_5 // (let llvmPackages_5 = super.llvmPackages_5 // (let
libraries = super.llvmPackages_5.libraries.extend (_: _: { libraries = super.llvmPackages_5.libraries.extend (_: _: {
inherit (llvmPackages_5) libcxx libcxxabi; inherit (llvmPackages_5) libcxx libcxxabi;
@ -281,6 +295,15 @@ in rec {
ncurses libffi zlib gmp pcre gnugrep ncurses libffi zlib gmp pcre gnugrep
coreutils findutils diffutils patchutils; coreutils findutils diffutils patchutils;
# Hack to make sure we don't link ncurses in bootstrap tools. The proper
# solution is to avoid passing -L/nix-store/...-bootstrap-tools/lib,
# quite a sledgehammer just to get the C runtime.
gettext = super.gettext.overrideAttrs (drv: {
configureFlags = drv.configureFlags ++ [
"--disable-curses"
];
});
llvmPackages_5 = super.llvmPackages_5 // (let llvmPackages_5 = super.llvmPackages_5 // (let
tools = super.llvmPackages_5.tools.extend (llvmSelf: _: { tools = super.llvmPackages_5.tools.extend (llvmSelf: _: {
inherit (llvmPackages_5) llvm clang-unwrapped; inherit (llvmPackages_5) llvm clang-unwrapped;
@ -303,16 +326,7 @@ in rec {
extraPreHook = '' extraPreHook = ''
export PATH_LOCALE=${pkgs.darwin.locale}/share/locale export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
''; '';
overrides = lib.composeExtensions persistent (self: super: { overrides = persistent;
# Hack to make sure we don't link ncurses in bootstrap tools. The proper
# solution is to avoid passing -L/nix-store/...-bootstrap-tools/lib,
# quite a sledgehammer just to get the C runtime.
gettext = super.gettext.overrideAttrs (old: {
configureFlags = old.configureFlags ++ [
"--disable-curses"
];
});
});
}; };
stdenvDarwin = prevStage: let stdenvDarwin = prevStage: let

View file

@ -6873,13 +6873,6 @@ with pkgs;
inherit (stdenvAdapters) overrideCC; inherit (stdenvAdapters) overrideCC;
buildLlvmTools = buildPackages.llvmPackages_5.tools; buildLlvmTools = buildPackages.llvmPackages_5.tools;
targetLlvmLibraries = targetPackages.llvmPackages_5.libraries; targetLlvmLibraries = targetPackages.llvmPackages_5.libraries;
} // stdenv.lib.optionalAttrs (stdenv.isDarwin && hostPlatform == buildPlatform) {
cmake = buildPackages.cmake.override {
isBootstrap = true;
majorVersion = "3.9"; # 3.10.2: 'ApplicationServices/ApplicationServices.h' file not found
};
libxml2 = libxml2.override { pythonSupport = false; };
python2 = callPackage ../development/interpreters/python/cpython/2.7/boot.nix { inherit (darwin) CF configd; };
} // stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) { } // stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
stdenv = overrideCC stdenv buildPackages.gcc6; # with gcc-7: undefined reference to `__divmoddi4' stdenv = overrideCC stdenv buildPackages.gcc6; # with gcc-7: undefined reference to `__divmoddi4'
}); });