Skip to content

Commit

Permalink
Merge pull request #50556 from oxij/pkgs/curl-cleanup
Browse files Browse the repository at this point in the history
curl: move option defaults from `all-packages.nix` to the derivation itself
  • Loading branch information
matthewbauer committed Nov 19, 2018
2 parents 7f1943b + 50aef60 commit 0925c48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
14 changes: 7 additions & 7 deletions pkgs/tools/networking/curl/7_59.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
, http2Support ? true, nghttp2
, idnSupport ? false, libidn ? null
, ldapSupport ? false, openldap ? null
, zlibSupport ? false, zlib ? null
, sslSupport ? false, openssl ? null
, zlibSupport ? true, zlib ? null
, sslSupport ? zlibSupport, openssl ? null
, gnutlsSupport ? false, gnutls ? null
, scpSupport ? false, libssh2 ? null
, gssSupport ? false, kerberos ? null
, scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null
, gssSupport ? !stdenv.hostPlatform.isWindows, libkrb5 ? null
, c-aresSupport ? false, c-ares ? null
, brotliSupport ? false, brotli ? null
}:
Expand All @@ -21,7 +21,7 @@ assert gnutlsSupport -> gnutls != null;
assert scpSupport -> libssh2 != null;
assert c-aresSupport -> c-ares != null;
assert brotliSupport -> brotli != null;
assert gssSupport -> kerberos != null;
assert gssSupport -> libkrb5 != null;

stdenv.mkDerivation rec {
name = "curl-7.59.0";
Expand Down Expand Up @@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
optional idnSupport libidn ++
optional ldapSupport openldap ++
optional zlibSupport zlib ++
optional gssSupport kerberos ++
optional gssSupport libkrb5 ++
optional c-aresSupport c-ares ++
optional sslSupport openssl ++
optional gnutlsSupport gnutls ++
Expand All @@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
( if brotliSupport then "--with-brotli" else "--without-brotli" )
]
++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${libkrb5.dev}"
# For the 'urandom', maybe it should be a cross-system option
++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
"--with-random=/dev/urandom"
Expand Down
14 changes: 7 additions & 7 deletions pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
, http2Support ? true, nghttp2
, idnSupport ? false, libidn ? null
, ldapSupport ? false, openldap ? null
, zlibSupport ? false, zlib ? null
, sslSupport ? false, openssl ? null
, zlibSupport ? true, zlib ? null
, sslSupport ? zlibSupport, openssl ? null
, gnutlsSupport ? false, gnutls ? null
, scpSupport ? false, libssh2 ? null
, gssSupport ? false, kerberos ? null
, scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null
, gssSupport ? !stdenv.hostPlatform.isWindows, libkrb5 ? null
, c-aresSupport ? false, c-ares ? null
, brotliSupport ? false, brotli ? null
}:
Expand All @@ -21,7 +21,7 @@ assert gnutlsSupport -> gnutls != null;
assert scpSupport -> libssh2 != null;
assert c-aresSupport -> c-ares != null;
assert brotliSupport -> brotli != null;
assert gssSupport -> kerberos != null;
assert gssSupport -> libkrb5 != null;

stdenv.mkDerivation rec {
name = "curl-7.61.1";
Expand Down Expand Up @@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
optional idnSupport libidn ++
optional ldapSupport openldap ++
optional zlibSupport zlib ++
optional gssSupport kerberos ++
optional gssSupport libkrb5 ++
optional c-aresSupport c-ares ++
optional sslSupport openssl ++
optional gnutlsSupport gnutls ++
Expand Down Expand Up @@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
( if brotliSupport then "--with-brotli" else "--without-brotli" )
]
++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${libkrb5.dev}"
# For the 'urandom', maybe it should be a cross-system option
++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
"--with-random=/dev/urandom"
Expand Down
10 changes: 0 additions & 10 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2128,20 +2128,10 @@ with pkgs;

curl_7_59 = callPackage ../tools/networking/curl/7_59.nix rec {
fetchurl = fetchurlBoot;
http2Support = true;
zlibSupport = true;
sslSupport = zlibSupport;
scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
gssSupport = !stdenv.hostPlatform.isWindows;
};

curl = callPackage ../tools/networking/curl rec {
fetchurl = fetchurlBoot;
http2Support = true;
zlibSupport = true;
sslSupport = zlibSupport;
scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
gssSupport = !stdenv.hostPlatform.isWindows;
};

curl_unix_socket = callPackage ../tools/networking/curl-unix-socket rec { };
Expand Down

0 comments on commit 0925c48

Please sign in to comment.