diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2017-08-21 04:44:40 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2017-08-21 04:44:40 +0200 |
commit | 6bbc3a0b245ccf392a8ddbce41b372c17409f0e9 (patch) | |
tree | 7c76fd40defb9e9907c2b352f9cb98874a84eca0 /pkgs/stdenv | |
parent | 96457d26dded05bcba8e9fbb9bf0255596654aab (diff) | |
parent | 3b29468313bc8604fe8f85c8d9316fd276d3985c (diff) |
Merge commit '3b29468313bc8604fe8f85c8d9316fd276d3985c' into HEAD
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/check-meta.nix | 4 | ||||
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 34 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 23 |
3 files changed, 32 insertions, 29 deletions
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 8b2cf01f169b7..8544d932f81ce 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -40,6 +40,8 @@ let allowBroken = config.allowBroken or false || builtins.getEnv "NIXPKGS_ALLOW_BROKEN" == "1"; + allowUnsupportedSystem = config.allowUnsupportedSystem or false; + isUnfree = licenses: lib.lists.any (l: !l.free or true || l == "unfree" || l == "unfree-redistributable") licenses; @@ -177,7 +179,7 @@ let { valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; } else if !allowBroken && attrs.meta.broken or false then { valid = false; reason = "broken"; errormsg = "is marked as broken"; } - else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem system attrs.meta.platforms then + else if !allowUnsupportedSystem && !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem system attrs.meta.platforms then { valid = false; reason = "broken"; errormsg = "is not supported on ‘${system}’"; } else if !(hasAllowedInsecure attrs) then { valid = false; reason = "insecure"; errormsg = "is marked as insecure"; } diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index be271daf8c8eb..74d387e353c5c 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -43,29 +43,21 @@ rec { , propagatedSandboxProfile ? "" , ... } @ attrs: let - dependencies = [ - (map (drv: drv.nativeDrv or drv) nativeBuildInputs) + dependencies = map lib.chooseDevOutputs [ + (map (drv: drv.nativeDrv or drv) nativeBuildInputs + ++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh + ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh) (map (drv: drv.crossDrv or drv) buildInputs) ]; - propagatedDependencies = [ + propagatedDependencies = map lib.chooseDevOutputs [ (map (drv: drv.nativeDrv or drv) propagatedNativeBuildInputs) (map (drv: drv.crossDrv or drv) propagatedBuildInputs) ]; - in let outputs' = outputs ++ (if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []); - dependencies' = let - justMap = map lib.chooseDevOutputs dependencies; - nativeBuildInputs = lib.head justMap - ++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh - ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh; - in [ nativeBuildInputs ] ++ lib.tail justMap; - - propagatedDependencies' = map lib.chooseDevOutputs propagatedDependencies; - derivationArg = (removeAttrs attrs ["meta" "passthru" "crossAttrs" "pos" @@ -73,13 +65,13 @@ rec { "sandboxProfile" "propagatedSandboxProfile"]) // (let computedSandboxProfile = - lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies'); + lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies); computedPropagatedSandboxProfile = - lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists propagatedDependencies'); + lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists propagatedDependencies); computedImpureHostDeps = - lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies')); + lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists dependencies)); computedPropagatedImpureHostDeps = - lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies')); + lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists propagatedDependencies)); in { name = name + lib.optionalString @@ -92,11 +84,11 @@ rec { userHook = config.stdenv.userHook or null; __ignoreNulls = true; - nativeBuildInputs = lib.elemAt dependencies' 0; - buildInputs = lib.elemAt dependencies' 1; + nativeBuildInputs = lib.elemAt dependencies 0; + buildInputs = lib.elemAt dependencies 1; - propagatedNativeBuildInputs = lib.elemAt propagatedDependencies' 0; - propagatedBuildInputs = lib.elemAt propagatedDependencies' 1; + propagatedNativeBuildInputs = lib.elemAt propagatedDependencies 0; + propagatedBuildInputs = lib.elemAt propagatedDependencies 1; # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck configureFlags = let inherit (lib) optional elem; in diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index c475d2d1e9279..61262e1a64e58 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -299,13 +299,22 @@ in shellPackage = prevStage.bash; }; - /* outputs TODO - allowedRequisites = with prevStage; - [ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk - glibc gnumake gnused gnutar gnugrep gnupatch patchelf attr acl - paxctl zlib pcre linuxHeaders ed gcc gcc.cc libsigsegv - ] ++ lib.optional (system == "aarch64-linux") prevStage.updateAutotoolsGnuConfigScriptsHook; - */ + # Mainly avoid reference to bootstrap tools + allowedRequisites = with prevStage; with lib; + # Simple executable tools + concatMap (p: [ (getBin p) (getLib p) ]) + [ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk + gnumake gnused gnutar gnugrep gnupatch patchelf ed paxctl + ] + # Library dependencies + ++ map getLib [ attr acl zlib pcre libsigsegv ] + # More complicated cases + ++ [ + glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders + gcc gcc.cc gcc.cc.lib gcc.expandResponseParams + ] + ++ lib.optionals (system == "aarch64-linux") + [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ]; overrides = self: super: { inherit (prevStage) |