From 3b6e7fe123ad8dec62e780bac6efe7754a3cbca4 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 31 Aug 2017 12:37:48 -0400 Subject: [PATCH 1/2] darwin-stdenv: Don't use `nativeTools` Now, we'll actually use the wrapped ld to link --- pkgs/stdenv/darwin/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 6739ce3f5c8..9070f4b6dca 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -79,15 +79,17 @@ in rec { inherit shell; inherit (last) stdenv; - nativeTools = true; - nativePrefix = bootstrapTools; + nativeTools = false; nativeLibc = false; buildPackages = lib.optionalAttrs (last ? stdenv) { inherit (last) stdenv; }; libc = last.pkgs.darwin.Libsystem; isClang = true; - cc = { name = "clang-9.9.9"; outPath = bootstrapTools; }; + cc = { name = "clang-9.9.9"; outPath = bootstrapTools; }; + binutils = { name = "binutils-9.9.9"; outPath = bootstrapTools; }; + coreutils = { name = "coreutils-9.9.9"; outPath = bootstrapTools; }; + gnugrep = { name = "gnugrep-9.9.9"; outPath = bootstrapTools; }; }; preHook = stage0.stdenv.lib.optionalString (shell == "${bootstrapTools}/bin/bash") '' From 8dbdc5dd514cd727eb20d5af4c4d303e39a5b49c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 31 Aug 2017 18:07:29 -0400 Subject: [PATCH 2/2] darwin-stdenv: Hack around impurity with --disable configure flag --- pkgs/stdenv/darwin/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 9070f4b6dca..f4801d674e8 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -269,7 +269,16 @@ in rec { extraPreHook = '' export PATH_LOCALE=${pkgs.darwin.locale}/share/locale ''; - overrides = persistent; + overrides = self: super: (persistent self super) // { + # 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