Introduce mapNullable into lib and use it in a few places
Also simply some configure flag logic my grep also alerted me too.
This commit is contained in:
@@ -31,11 +31,10 @@ with stdenv;
|
||||
with stdenv.lib;
|
||||
let
|
||||
inherit (python2Packages) python;
|
||||
mkFlag = trueStr: falseStr: cond: name: val:
|
||||
if cond == null then null else
|
||||
"--${if cond != false then trueStr else falseStr}${name}"
|
||||
+ "${if val != null && cond != false then "=${val}" else ""}";
|
||||
|
||||
mkFlag = trueStr: falseStr: cond: name: val: "--"
|
||||
+ (if cond then trueStr else falseStr)
|
||||
+ name
|
||||
+ optionalString (val != null && cond != false) "=${val}";
|
||||
mkEnable = mkFlag "enable-" "disable-";
|
||||
mkWith = mkFlag "with-" "without-";
|
||||
mkOther = mkFlag "" "" true;
|
||||
|
||||
Reference in New Issue
Block a user