fetchurlBoot: Use Nix's builtin fetchurl function
This removes the need for curl in bootstrapTools, and enables https for bootstrap tarballs.
This commit is contained in:
parent
824a1fb5b9
commit
e6f61b4cf3
|
@ -0,0 +1,20 @@
|
||||||
|
let mirrors = import ./mirrors.nix; in
|
||||||
|
|
||||||
|
{ system }:
|
||||||
|
|
||||||
|
{ url ? builtins.head urls
|
||||||
|
, urls ? []
|
||||||
|
, sha256
|
||||||
|
}:
|
||||||
|
|
||||||
|
import <nix/fetchurl.nix> {
|
||||||
|
inherit system sha256;
|
||||||
|
|
||||||
|
url =
|
||||||
|
# Handle mirror:// URIs. Since <nix/fetchurl.nix> currently
|
||||||
|
# supports only one URI, use the first listed mirror.
|
||||||
|
let m = builtins.match "mirror://([a-z]+)/(.*)" url; in
|
||||||
|
if m == null then url
|
||||||
|
else builtins.head (mirrors.${builtins.elemAt m 0}) + (builtins.elemAt m 1);
|
||||||
|
|
||||||
|
}
|
|
@ -80,9 +80,9 @@ rec {
|
||||||
'';
|
'';
|
||||||
shell = "${bootstrapTools}/bin/bash";
|
shell = "${bootstrapTools}/bin/bash";
|
||||||
initialPath = [bootstrapTools];
|
initialPath = [bootstrapTools];
|
||||||
fetchurlBoot = import ../../build-support/fetchurl {
|
|
||||||
stdenv = stage0.stdenv;
|
fetchurlBoot = import ../../build-support/fetchurl/boot.nix {
|
||||||
curl = bootstrapTools;
|
inherit system;
|
||||||
};
|
};
|
||||||
|
|
||||||
cc = if isNull gccPlain
|
cc = if isNull gccPlain
|
||||||
|
@ -333,7 +333,6 @@ rec {
|
||||||
awk --version
|
awk --version
|
||||||
grep --version
|
grep --version
|
||||||
gcc --version
|
gcc --version
|
||||||
curl --version
|
|
||||||
|
|
||||||
ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
|
ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?)
|
||||||
export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
|
export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}"
|
||||||
|
|
|
@ -10,13 +10,6 @@ rec {
|
||||||
aclSupport = false;
|
aclSupport = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
curlMinimal = curl.override {
|
|
||||||
http2Support = false;
|
|
||||||
zlibSupport = false;
|
|
||||||
sslSupport = false;
|
|
||||||
scpSupport = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
busyboxMinimal = busybox.override {
|
busyboxMinimal = busybox.override {
|
||||||
useMusl = true;
|
useMusl = true;
|
||||||
enableStatic = true;
|
enableStatic = true;
|
||||||
|
@ -84,8 +77,6 @@ rec {
|
||||||
cp -d ${gnumake}/bin/* $out/bin
|
cp -d ${gnumake}/bin/* $out/bin
|
||||||
cp -d ${patch}/bin/* $out/bin
|
cp -d ${patch}/bin/* $out/bin
|
||||||
cp ${patchelf}/bin/* $out/bin
|
cp ${patchelf}/bin/* $out/bin
|
||||||
cp ${curlMinimal}/bin/curl $out/bin
|
|
||||||
cp -d ${curlMinimal}/lib/libcurl* $out/lib
|
|
||||||
|
|
||||||
cp -d ${gnugrep.pcre}/lib/libpcre*.so* $out/lib # needed by grep
|
cp -d ${gnugrep.pcre}/lib/libpcre*.so* $out/lib # needed by grep
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue