diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-11-06 10:16:39 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-11-06 10:16:39 +0100 |
commit | 0518ccf5af90017df31c445f52badaff45b6b7cd (patch) | |
tree | f60c912ecd598722d76947f6bd5230955210eb66 /pkgs/stdenv | |
parent | c96407720010658b44dcd2a8801b05879105b9ff (diff) | |
parent | 782a12e450a58b815cd702c65da75855124d1572 (diff) | |
download | nixlib-0518ccf5af90017df31c445f52badaff45b6b7cd.tar nixlib-0518ccf5af90017df31c445f52badaff45b6b7cd.tar.gz nixlib-0518ccf5af90017df31c445f52badaff45b6b7cd.tar.bz2 nixlib-0518ccf5af90017df31c445f52badaff45b6b7cd.tar.lz nixlib-0518ccf5af90017df31c445f52badaff45b6b7cd.tar.xz nixlib-0518ccf5af90017df31c445f52badaff45b6b7cd.tar.zst nixlib-0518ccf5af90017df31c445f52badaff45b6b7cd.zip |
Merge remote-tracking branch 'origin/master' into staging
Conflicts: pkgs/stdenv/generic/default.nix
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 827e0a260df8..ce78475f5fad 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -34,11 +34,13 @@ let { nixpkgs.config.allow${unfreeOrBroken} = true; } in configuration.nix to override this. If you use Nix standalone, you can add { allow${unfreeOrBroken} = true; } - to ~/.nixpkgs/config.nix. - ''; + to ~/.nixpkgs/config.nix.''; unsafeGetAttrPos = builtins.unsafeGetAttrPos or (n: as: null); + isUnfree = licenses: lib.lists.any (l: + !l.free or true || l == "unfree" || l == "unfree-redistributable") licenses; + extraBuildInputs' = extraBuildInputs ++ [ ../../build-support/setup-hooks/move-docs.sh ../../build-support/setup-hooks/compress-man-pages.sh @@ -60,20 +62,18 @@ let unsafeGetAttrPos "name" attrs; pos' = if pos != null then "‘" + pos.file + ":" + toString pos.line + "’" else "«unknown-file»"; in - if !allowUnfree - && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) - && !allowUnfreePredicate attrs then + if !allowUnfree && isUnfree (lib.lists.toList attrs.meta.license or []) && !allowUnfreePredicate attrs then throw '' - Package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate. - ${forceEvalHelp "Unfree"}'' + Package ‘${attrs.name}’ in ${pos'} has an unfree license, refusing to evaluate. + ${forceEvalHelp "Unfree"}'' else if !allowBroken && attrs.meta.broken or false then - throw '' - Package ‘${attrs.name}’ in ${pos'} is marked as broken, refusing to evaluate. - ${forceEvalHelp "Broken"}'' + throw '' + Package ‘${attrs.name}’ in ${pos'} is marked as broken, refusing to evaluate. + ${forceEvalHelp "Broken"}'' else if !allowBroken && attrs.meta.platforms or null != null && !lib.lists.elem result.system attrs.meta.platforms then - throw '' - Package ‘${attrs.name}’ in ${pos'} is not supported on ‘${result.system}’, refusing to evaluate. - ${forceEvalHelp "Broken"}'' + throw '' + Package ‘${attrs.name}’ in ${pos'} is not supported on ‘${result.system}’, refusing to evaluate. + ${forceEvalHelp "Broken"}'' else lib.addPassthru (derivation ( (removeAttrs attrs ["meta" "passthru" "crossAttrs"]) |