Skip to content

Instantly share code, notes, and snippets.

@LnL7
Last active January 16, 2020 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LnL7/c080534a30823e07672034e947498f97 to your computer and use it in GitHub Desktop.
Save LnL7/c080534a30823e07672034e947498f97 to your computer and use it in GitHub Desktop.
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 82365d986b8..f2ff6d6508d 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -29,10 +29,10 @@ let
sha256 = "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63";
};
# HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM
- normal-src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl {
+ normal-src = fetchurl {
url = "mirror://gnu/binutils/${basename}-${version}.tar.bz2";
sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
- });
+ };
in
stdenv.mkDerivation {
diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix
index 14c69b84eb4..59495083f94 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix
@@ -136,13 +136,7 @@ let
};
fetchApple = version: sha256: name: let
- # When cross-compiling, fetchurl depends on libiconv, resulting
- # in an infinite recursion without this. It's not clear why this
- # worked fine when not cross-compiling
- fetch = if name == "libiconv"
- then stdenv.fetchurlBoot
- else fetchurl;
- in fetch {
+ in fetchurl {
url = "http://www.opensource.apple.com/tarballs/${name}/${name}-${versions.${version}.${name}}.tar.gz";
inherit sha256;
};
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index 2b57840b1a4..fe24959c1f1 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -142,15 +148,101 @@ in
})
+ (prevStage: stageFun prevStage rec {
+ name = "bootstrap-stage2";
+ allowedRequisites = [ bootstrapTools ]
+ ++ (with prevStage; [ ccBoot bintoolsBoot libcxxBoot libcBoot cfBoot ]);
+ overrides = self: super: {
+
+ fetchurl = fetchurlBoot;
+ curl = super.curl.override { http2Support = false; gssSupport = false; };
+
+ pkgsBuildHost = {
+ inherit (self) stdenv perl perl530 zlib;
+ };
+
+ inherit (prevStage)
+ stdenvNoCC ccBoot bintoolsBoot libcBoot libcxxBoot cfBoot;
+ };
+ })
+
+ (prevStage: stageFun prevStage rec {
+ name = "bootstrap-stage2";
+ allowedRequisites = [ bootstrapTools ]
+ ++ (with prevStage; [ ccBoot bintoolsBoot libcxxBoot libcBoot cfBoot ]);
+ overrides = self: super: {
+
+ python3 = super.python3Minimal;
+
+ inherit (prevStage) bzip2 curl coreutils gnum4 patchutils_0_3_3 perl perl530 pkgconfig unzip xz zlib;
+
+ pkgsBuildHost = prevStage // {
+ };
+
+ inherit (prevStage)
+ stdenvNoCC ccBoot bintoolsBoot libcBoot libcxxBoot cfBoot;
+ };
+ })
+
+ (prevStage: stageFun prevStage rec {
+ name = "bootstrap-stage3";
+ allowedRequisites = [ bootstrapTools ]
+ ++ (with prevStage; [ ccBoot bintoolsBoot libcxxBoot libcBoot cfBoot ]);
+ overrides = self: super: {
+
+ cmake = super.cmake.override { useSharedLibraries = false; };
+ ninja = super.ninja.override { buildDocs = false; };
+
+ inherit (prevStage) coreutils curl gnum4 patchutils_0_3_3 perl perl530 python3 pkgconfig unzip xz zlib;
+
+ pkgsBuildHost = prevStage // {
+ };
+
+ inherit (prevStage)
+ stdenvNoCC ccBoot bintoolsBoot libcBoot libcxxBoot cfBoot;
+ };
+ })
+
+ (prevStage: stageFun prevStage rec {
+ name = "bootstrap-stage4";
+ allowedRequisites = [];
+ overrides = self: super: {
+
+ stdenv = import ../generic {
+ name = "stdenv-darwin";
+ inherit allowedRequisites config;
+
+ cc = prevStage.clang;
+
+ initialPath = [ prevStage.coreutils ];
+
+ shell = "${bootstrapTools}/bin/bash";
+ buildPlatform = localSystem;
+ hostPlatform = localSystem;
+ targetPlatform = localSystem;
+
+ extraAttrs = {
+ inherit platform;
+ };
+ };
};
})
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index d2fab31f8b7..02b950cd660 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -12,10 +12,6 @@ let lib = import ../../../lib; in lib.makeOverridable (
, shell
, allowedRequisites ? null, extraAttrs ? {}, overrides ? (self: super: {}), config
-, # The `fetchurl' to use for downloading curl and its dependencies
- # (see all-packages.nix).
- fetchurlBoot
-
, setupScript ? ./setup.sh
, extraNativeBuildInputs ? []
@@ -152,8 +148,6 @@ let
# packages don't have to do that themselves.
inherit lib;
- inherit fetchurlBoot;
-
inherit overrides;
inherit cc hasCC;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e21f68951c7..023559a78f6 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -294,55 +294,7 @@ in
fetchhg = callPackage ../build-support/fetchhg { };
- # `fetchurl' downloads a file from the network.
- fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform
- then buildPackages.fetchurl # No need to do special overrides twice,
- else makeOverridable (import ../build-support/fetchurl) {
- inherit lib stdenvNoCC buildPackages;
- curl = buildPackages.curl.override (old: rec {
- # break dependency cycles
- fetchurl = stdenv.fetchurlBoot;
- zlib = buildPackages.zlib.override { fetchurl = stdenv.fetchurlBoot; };
- pkgconfig = buildPackages.pkgconfig.override { fetchurl = stdenv.fetchurlBoot; };
- perl = buildPackages.perl.override { fetchurl = stdenv.fetchurlBoot; };
- openssl = buildPackages.openssl.override {
- fetchurl = stdenv.fetchurlBoot;
- coreutils = buildPackages.coreutils.override {
- fetchurl = stdenv.fetchurlBoot;
- inherit perl;
- xz = buildPackages.xz.override { fetchurl = stdenv.fetchurlBoot; };
- gmp = null;
- aclSupport = false;
- attrSupport = false;
- };
- inherit perl;
- buildPackages = { inherit perl; };
- };
- libssh2 = buildPackages.libssh2.override {
- fetchurl = stdenv.fetchurlBoot;
- inherit zlib openssl;
- };
- # On darwin, libkrb5 needs bootstrap_cmds which would require
- # converting many packages to fetchurl_boot to avoid evaluation cycles.
- # So turn gssSupport off there, and on Windows.
- # On other platforms, keep the previous value.
- gssSupport =
- if stdenv.isDarwin || stdenv.hostPlatform.isWindows
- then false
- else old.gssSupport or true; # `? true` is the default
- libkrb5 = buildPackages.libkrb5.override {
- fetchurl = stdenv.fetchurlBoot;
- inherit pkgconfig perl openssl;
- keyutils = buildPackages.keyutils.override { fetchurl = stdenv.fetchurlBoot; };
- };
- nghttp2 = buildPackages.nghttp2.override {
- fetchurl = stdenv.fetchurlBoot;
- inherit zlib pkgconfig openssl;
- c-ares = buildPackages.c-ares.override { fetchurl = stdenv.fetchurlBoot; };
- libev = buildPackages.libev.override { fetchurl = stdenv.fetchurlBoot; };
- };
- });
- };
+ fetchurl = callPackage ../build-support/fetchurl { };
fetchRepoProject = callPackage ../build-support/fetchrepoproject { };
@@ -393,7 +345,7 @@ in
makeInitrd = callPackage ../build-support/kernel/make-initrd.nix; # Args intentionally left out
- makeWrapper = makeSetupHook { deps = [ dieHook ]; substitutions = { shell = pkgs.runtimeShell; }; }
+ makeWrapper = makeSetupHook { deps = [ dieHook ]; substitutions = { shell = stdenv.shell; }; }
../build-support/setup-hooks/make-wrapper.sh;
makeModulesClosure = { kernel, firmware, rootModules, allowMissing ? false }:
@@ -7577,9 +7529,6 @@ in
### SHELLS
- runtimeShell = "${runtimeShellPackage}${runtimeShellPackage.shellPath}";
- runtimeShellPackage = bash;
-
any-nix-shell = callPackage ../shells/any-nix-shell { };
bash = lowPrio (callPackage ../shells/bash/4.4.nix { });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment