diff options
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/check-meta.nix | 17 | ||||
-rw-r--r-- | pkgs/stdenv/linux/make-bootstrap-tools.nix | 29 |
2 files changed, 26 insertions, 20 deletions
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index b754230b0be..85a1051ceed 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -13,8 +13,7 @@ let # for why this defaults to false, but I (@copumpkin) want to default it to true soon. shouldCheckMeta = config.checkMeta or false; - allowUnfree = config.allowUnfree or false - || builtins.getEnv "NIXPKGS_ALLOW_UNFREE" == "1"; + allowUnfree = config.allowUnfree or false; whitelist = config.whitelistedLicenses or []; blacklist = config.blacklistedLicenses or []; @@ -36,16 +35,14 @@ let attrs ? meta.license; hasWhitelistedLicense = assert areLicenseListsValid; attrs: - hasLicense attrs && builtins.elem attrs.meta.license whitelist; + hasLicense attrs && lib.lists.any (l: builtins.elem l whitelist) (lib.lists.toList attrs.meta.license); hasBlacklistedLicense = assert areLicenseListsValid; attrs: - hasLicense attrs && builtins.elem attrs.meta.license blacklist; + hasLicense attrs && lib.lists.any (l: builtins.elem l blacklist) (lib.lists.toList attrs.meta.license); - allowBroken = config.allowBroken or false - || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1"; + allowBroken = config.allowBroken or false; - allowUnsupportedSystem = config.allowUnsupportedSystem or false - || builtins.getEnv "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM" == "1"; + allowUnsupportedSystem = config.allowUnsupportedSystem or false; isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses; @@ -73,9 +70,9 @@ let hasAllowedInsecure = attrs: (attrs.meta.knownVulnerabilities or []) == [] || allowInsecurePredicate attrs || - builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1"; + config.allowInsecure or false; - showLicense = license: license.shortName or "unknown"; + showLicense = license: toString (map (l: l.shortName or "unknown") (lib.lists.toList license)); pos_str = meta: meta.position or "«unknown-file»"; diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 8d513625df2..0c285f9661e 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -33,6 +33,15 @@ in with pkgs; rec { ''; }; + bootGCC = gcc.cc.override { enableLTO = false; }; + bootBinutils = binutils.bintools.override { + withAllTargets = false; + # Don't need two linkers, disable whatever's not primary/default. + gold = false; + # bootstrap is easier w/static + enableShared = false; + }; + build = stdenv.mkDerivation { @@ -109,12 +118,12 @@ in with pkgs; rec { cp -d ${gnugrep.pcre.out}/lib/libpcre*.so* $out/lib # needed by grep # Copy what we need of GCC. - cp -d ${gcc.cc.out}/bin/gcc $out/bin - cp -d ${gcc.cc.out}/bin/cpp $out/bin - cp -d ${gcc.cc.out}/bin/g++ $out/bin - cp -d ${gcc.cc.lib}/lib/libgcc_s.so* $out/lib - cp -d ${gcc.cc.lib}/lib/libstdc++.so* $out/lib - cp -rd ${gcc.cc.out}/lib/gcc $out/lib + cp -d ${bootGCC.out}/bin/gcc $out/bin + cp -d ${bootGCC.out}/bin/cpp $out/bin + cp -d ${bootGCC.out}/bin/g++ $out/bin + cp -d ${bootGCC.lib}/lib/libgcc_s.so* $out/lib + cp -d ${bootGCC.lib}/lib/libstdc++.so* $out/lib + cp -rd ${bootGCC.out}/lib/gcc $out/lib chmod -R u+w $out/lib rm -f $out/lib/gcc/*/*/include*/linux rm -f $out/lib/gcc/*/*/include*/sound @@ -122,11 +131,11 @@ in with pkgs; rec { rm -f $out/lib/gcc/*/*/include-fixed/asm rm -rf $out/lib/gcc/*/*/plugin #rm -f $out/lib/gcc/*/*/*.a - cp -rd ${gcc.cc.out}/libexec/* $out/libexec + cp -rd ${bootGCC.out}/libexec/* $out/libexec chmod -R u+w $out/libexec rm -rf $out/libexec/gcc/*/*/plugin mkdir -p $out/include - cp -rd ${gcc.cc.out}/include/c++ $out/include + cp -rd ${bootGCC.out}/include/c++ $out/include chmod -R u+w $out/include rm -rf $out/include/c++/*/ext/pb_ds rm -rf $out/include/c++/*/ext/parallel @@ -148,7 +157,7 @@ in with pkgs; rec { # Copy binutils. for i in as ld ar ranlib nm strip readelf objdump; do - cp ${binutils.bintools.out}/bin/$i $out/bin + cp ${bootBinutils.out}/bin/$i $out/bin done cp '${lib.getLib binutils.bintools}'/lib/* "$out/lib/" @@ -172,7 +181,7 @@ in with pkgs; rec { mv $out/.pack $out/pack mkdir $out/on-server - XZ_OPT=-9 tar cvJf $out/on-server/bootstrap-tools.tar.xz --hard-dereference --sort=name --numeric-owner --owner=0 --group=0 --mtime=@1 -C $out/pack . + XZ_OPT="-9 -e" tar cvJf $out/on-server/bootstrap-tools.tar.xz --hard-dereference --sort=name --numeric-owner --owner=0 --group=0 --mtime=@1 -C $out/pack . cp ${busyboxMinimal}/bin/busybox $out/on-server chmod u+w $out/on-server/busybox nuke-refs $out/on-server/busybox |