diff options
Diffstat (limited to 'pkgs/stdenv/darwin')
-rw-r--r-- | pkgs/stdenv/darwin/default.nix | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 89c903b04a04..d202186c29b2 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -60,10 +60,40 @@ in rec { extraBuildInputs, allowedRequisites ? null}: let + buildPackages = lib.optionalAttrs (last ? stdenv) { + inherit (last) stdenv; + }; + + coreutils = { name = "coreutils-9.9.9"; outPath = bootstrapTools; }; + gnugrep = { name = "gnugrep-9.9.9"; outPath = bootstrapTools; }; + + bintools = import ../../build-support/bintools-wrapper { + inherit shell; + inherit (last) stdenvNoCC; + + nativeTools = false; + nativeLibc = false; + inherit buildPackages coreutils gnugrep; + libc = last.pkgs.darwin.Libsystem; + bintools = { name = "binutils-9.9.9"; outPath = bootstrapTools; }; + }; + + cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper { + inherit shell; + inherit (last) stdenvNoCC; + + nativeTools = false; + nativeLibc = false; + inherit buildPackages coreutils gnugrep bintools; + libc = last.pkgs.darwin.Libsystem; + isClang = true; + cc = { name = "clang-9.9.9"; outPath = bootstrapTools; }; + }; + thisStdenv = import ../generic { inherit config shell extraNativeBuildInputs extraBuildInputs; allowedRequisites = if allowedRequisites == null then null else allowedRequisites ++ [ - thisStdenv.cc.expand-response-params + cc.expand-response-params cc.bintools ]; name = "stdenv-darwin-boot-${toString step}"; @@ -72,24 +102,9 @@ in rec { hostPlatform = localSystem; targetPlatform = localSystem; - cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper { - inherit shell; - inherit (last) stdenvNoCC; - - 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; }; - binutils = { name = "binutils-9.9.9"; outPath = bootstrapTools; }; - coreutils = { name = "coreutils-9.9.9"; outPath = bootstrapTools; }; - gnugrep = { name = "gnugrep-9.9.9"; outPath = bootstrapTools; }; - }; + inherit cc; - preHook = stage0.stdenv.lib.optionalString (shell == "${bootstrapTools}/bin/bash") '' + preHook = lib.optionalString (shell == "${bootstrapTools}/bin/bash") '' # Don't patch #!/interpreter because it leads to retained # dependencies on the bootstrapTools in the final stdenv. dontPatchShebangs=1 @@ -328,9 +343,10 @@ in rec { buildPackages = { inherit (prevStage) stdenv; }; - inherit (pkgs) coreutils binutils gnugrep; - cc = pkgs.llvmPackages.clang-unwrapped; - libc = pkgs.darwin.Libsystem; + inherit (pkgs) coreutils gnugrep; + cc = pkgs.llvmPackages.clang-unwrapped; + bintools = pkgs.darwin.binutils; + libc = pkgs.darwin.Libsystem; }; extraNativeBuildInputs = []; @@ -349,8 +365,8 @@ in rec { xz.out xz.bin libcxx libcxxabi gmp.out gnumake findutils bzip2.out bzip2.bin llvmPackages.llvm llvmPackages.llvm.lib zlib.out zlib.dev libffi.out coreutils ed diffutils gnutar gzip ncurses.out ncurses.dev ncurses.man gnused bash gawk - gnugrep llvmPackages.clang-unwrapped patch pcre.out binutils-raw.out - binutils gettext + gnugrep llvmPackages.clang-unwrapped patch pcre.out gettext + binutils-raw.bintools binutils binutils.bintools cc.expand-response-params ]) ++ (with pkgs.darwin; [ dyld Libsystem CF cctools ICU libiconv locale |