···158 drv' = (lib.head outputsList).value;
159 in lib.deepSeq drv' drv';
160161-162- /* Tests whether a derivation can be used by the current platform
163- Returns the derivation if true, otherwise null. */
164- shouldUsePkgSystem = system: pkg_: let pkg = (builtins.tryEval pkg_).value;
165- in if lib.any (x: x == system) (pkg.meta.platforms or [])
166- then pkg
167- else null;
168-169- /* Returns a configure flag string in an autotools format
170- trueStr: Prepended when cond is true
171- falseStr: Prepended when cond is false
172- cond: The condition for the prepended string type and value
173- name: The flag name
174- val: The value of the flag only set when cond is true */
175- mkFlag = trueStr: falseStr: cond: name: val:
176- if cond == null then null else
177- "--${if cond != false then trueStr else falseStr}${name}"
178- + "${if val != null && cond != false then "=${val}" else ""}";
179-180- /* Flag setting helpers for autotools like packages */
181- mkEnable = mkFlag "enable-" "disable-";
182- mkWith = mkFlag "with-" "without-";
183- mkOther = mkFlag "" "" true;
184}
···232 || system == "armv7l-linux";
233 isBigEndian = system == "powerpc-linux";
234235- shouldUsePkg = lib.shouldUsePkgSystem system;
236-237 # Whether we should run paxctl to pax-mark binaries.
238 needsPax = isLinux;
239
···232 || system == "armv7l-linux";
233 isBigEndian = system == "powerpc-linux";
23400235 # Whether we should run paxctl to pax-mark binaries.
236 needsPax = isLinux;
237
+11-3
pkgs/tools/networking/curl/default.nix
···8, suffix ? ""
9}:
1011-with stdenv;
12-with stdenv.lib;
13let
00000000014 isLight = suffix == "light";
15 isFull = suffix == "full";
16- nameSuffix = optionalString (suffix != "") "-${suffix}";
1718 # Normal Depedencies
19 optZlib = if isLight then null else shouldUsePkg zlib;
···28 optOpenldap = if !isFull then null else shouldUsePkg openldap;
29 optLibidn = if !isFull then null else shouldUsePkg libidn;
30in
031stdenv.mkDerivation rec {
32 name = "curl${nameSuffix}-${version}";
33 version = "7.42.1";
···8, suffix ? ""
9}:
100011let
12+ mkFlag = trueStr: falseStr: cond: name: val:
13+ if cond == null then null else
14+ "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
15+ mkEnable = mkFlag "enable-" "disable-";
16+ mkWith = mkFlag "with-" "without-";
17+ mkOther = mkFlag "" "" true;
18+19+ shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
20+21 isLight = suffix == "light";
22 isFull = suffix == "full";
23+ nameSuffix = stdenv.lib.optionalString (suffix != "") "-${suffix}";
2425 # Normal Depedencies
26 optZlib = if isLight then null else shouldUsePkg zlib;
···35 optOpenldap = if !isFull then null else shouldUsePkg openldap;
36 optLibidn = if !isFull then null else shouldUsePkg libidn;
37in
38+with stdenv.lib;
39stdenv.mkDerivation rec {
40 name = "curl${nameSuffix}-${version}";
41 version = "7.42.1";