about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2013-10-21 21:56:45 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2013-10-21 22:55:01 +0200
commitfc687b393f24e3a014d935b04e5860fb19bb36e4 (patch)
treeb1b101c77c7edcadad747474302e3f4349ae2885 /pkgs/stdenv
parent0a4d53cc5eec4cd5b88866652fc9d6daf3fb29c9 (diff)
downloadnixlib-fc687b393f24e3a014d935b04e5860fb19bb36e4.tar
nixlib-fc687b393f24e3a014d935b04e5860fb19bb36e4.tar.gz
nixlib-fc687b393f24e3a014d935b04e5860fb19bb36e4.tar.bz2
nixlib-fc687b393f24e3a014d935b04e5860fb19bb36e4.tar.lz
nixlib-fc687b393f24e3a014d935b04e5860fb19bb36e4.tar.xz
nixlib-fc687b393f24e3a014d935b04e5860fb19bb36e4.tar.zst
nixlib-fc687b393f24e3a014d935b04e5860fb19bb36e4.zip
Small fix in handling of "unfree" meta.license attributes
meta.license is can be a string or a list of strings. But there is one
unhandled case where "unfree" (or "unfree-redistributable") is a part of
a list. It will currently not be detected as an "unfree" package and
Hydra will attempt to build it. This should fix it.

Example: http://hydra.nixos.org/build/6553461
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 0b1003a73921..f8aff33a327f 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -49,7 +49,7 @@ let
         # Add a utility function to produce derivations that use this
         # stdenv and its shell.
         mkDerivation = attrs:
-          if !allowUnfree && (let l = attrs.meta.license or ""; in l == "unfree" || l == "unfree-redistributable") then
+          if !allowUnfree && (let l = lib.lists.toList attrs.meta.license or []; in lib.lists.elem "unfree" l || lib.lists.elem "unfree-redistributable" l) then
             throw "package ‘${attrs.name}’ has an unfree license, refusing to evaluate"
           else
             lib.addPassthru (derivation (