Merge pull request #145610 from Izorkin/update-curl

curl: update build configuration

authored by Bernardo Meurer and committed by GitHub 336b2c85 0c4dc3b7

+64 -34
+55 -34
pkgs/tools/networking/curl/default.nix
··· 1 - { stdenv, lib, fetchurl, pkg-config, perl 2 - , http2Support ? true, nghttp2 3 - , idnSupport ? false, libidn ? null 4 - , ldapSupport ? false, openldap ? null 5 - , zlibSupport ? true, zlib ? null 6 - , opensslSupport ? zlibSupport, openssl ? null 7 , gnutlsSupport ? false, gnutls ? null 8 - , wolfsslSupport ? false, wolfssl ? null 9 - , scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null 10 , gssSupport ? with stdenv.hostPlatform; ( 11 !isWindows && 12 # disable gss becuase of: undefined reference to `k5_bcmp' ··· 17 # not worth the effort. 18 !(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform)) 19 ), libkrb5 ? null 20 - , c-aresSupport ? false, c-ares ? null 21 - , brotliSupport ? false, brotli ? null 22 }: 23 24 # Note: this package is used for bootstrapping fetchurl, and thus ··· 26 # cgit) that are needed here should be included directly in Nixpkgs as 27 # files. 28 29 - assert http2Support -> nghttp2 != null; 30 - assert idnSupport -> libidn != null; 31 - assert ldapSupport -> openldap != null; 32 - assert zlibSupport -> zlib != null; 33 - assert opensslSupport -> openssl != null; 34 assert !(gnutlsSupport && opensslSupport); 35 assert !(gnutlsSupport && wolfsslSupport); 36 assert !(opensslSupport && wolfsslSupport); 37 assert gnutlsSupport -> gnutls != null; 38 assert wolfsslSupport -> wolfssl != null; 39 - assert scpSupport -> libssh2 != null; 40 - assert c-aresSupport -> c-ares != null; 41 - assert brotliSupport -> brotli != null; 42 - assert gssSupport -> libkrb5 != null; 43 44 stdenv.mkDerivation rec { 45 pname = "curl"; ··· 70 # "-lz -lssl", which aren't necessary direct build inputs of 71 # applications that use Curl. 72 propagatedBuildInputs = with lib; 73 optional http2Support nghttp2 ++ 74 - optional idnSupport libidn ++ 75 optional ldapSupport openldap ++ 76 - optional zlibSupport zlib ++ 77 - optional gssSupport libkrb5 ++ 78 - optional c-aresSupport c-ares ++ 79 optional opensslSupport openssl ++ 80 - optional gnutlsSupport gnutls ++ 81 optional wolfsslSupport wolfssl ++ 82 - optional scpSupport libssh2 ++ 83 - optional brotliSupport brotli; 84 85 # for the second line see https://curl.haxx.se/mail/tracker-2014-03/0087.html 86 preConfigure = '' ··· 89 ''; 90 91 configureFlags = [ 92 # Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback 93 # to nss-cacert from the default profile. 94 "--without-ca-bundle" 95 "--without-ca-path" 96 # The build fails when using wolfssl with --with-ca-fallback 97 (lib.withFeature (!wolfsslSupport) "ca-fallback") 98 - "--disable-manual" 99 - (lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl)) 100 (lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls)) 101 (lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2)) 102 - (lib.enableFeature ldapSupport "ldap") 103 - (lib.enableFeature ldapSupport "ldaps") 104 - (lib.withFeatureAs idnSupport "libidn" (lib.getDev libidn)) 105 - (lib.withFeature brotliSupport "brotli") 106 ] 107 - ++ lib.optional wolfsslSupport "--with-wolfssl=${lib.getDev wolfssl}" 108 - ++ lib.optional c-aresSupport "--enable-ares=${c-ares}" 109 ++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}" 110 # For the 'urandom', maybe it should be a cross-system option 111 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
··· 1 + { lib, stdenv, fetchurl, pkg-config, perl 2 + , brotliSupport ? false, brotli ? null 3 + , c-aresSupport ? false, c-ares ? null 4 , gnutlsSupport ? false, gnutls ? null 5 + , gsaslSupport ? false, gsasl ? null 6 , gssSupport ? with stdenv.hostPlatform; ( 7 !isWindows && 8 # disable gss becuase of: undefined reference to `k5_bcmp' ··· 13 # not worth the effort. 14 !(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform)) 15 ), libkrb5 ? null 16 + , http2Support ? true, nghttp2 ? null 17 + , http3Support ? false, nghttp3, ngtcp2 ? null 18 + , idnSupport ? false, libidn2 ? null 19 + , ldapSupport ? false, openldap ? null 20 + , opensslSupport ? zlibSupport, openssl ? null 21 + , pslSupport ? false, libpsl ? null 22 + , rtmpSupport ? false, rtmpdump ? null 23 + , scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null 24 + , wolfsslSupport ? false, wolfssl ? null 25 + , zlibSupport ? true, zlib ? null 26 + , zstdSupport ? false, zstd ? null 27 }: 28 29 # Note: this package is used for bootstrapping fetchurl, and thus ··· 31 # cgit) that are needed here should be included directly in Nixpkgs as 32 # files. 33 34 assert !(gnutlsSupport && opensslSupport); 35 assert !(gnutlsSupport && wolfsslSupport); 36 assert !(opensslSupport && wolfsslSupport); 37 + assert brotliSupport -> brotli != null; 38 + assert c-aresSupport -> c-ares != null; 39 assert gnutlsSupport -> gnutls != null; 40 + assert gsaslSupport -> gsasl != null; 41 + assert gssSupport -> libkrb5 != null; 42 + assert http2Support -> nghttp2 != null; 43 + assert http3Support -> nghttp3 != null; 44 + assert http3Support -> ngtcp2 != null; 45 + assert idnSupport -> libidn2 != null; 46 + assert ldapSupport -> openldap != null; 47 + assert opensslSupport -> openssl != null; 48 + assert pslSupport -> libpsl !=null; 49 + assert rtmpSupport -> rtmpdump !=null; 50 + assert scpSupport -> libssh2 != null; 51 assert wolfsslSupport -> wolfssl != null; 52 + assert zlibSupport -> zlib != null; 53 + assert zstdSupport -> zstd != null; 54 55 stdenv.mkDerivation rec { 56 pname = "curl"; ··· 81 # "-lz -lssl", which aren't necessary direct build inputs of 82 # applications that use Curl. 83 propagatedBuildInputs = with lib; 84 + optional brotliSupport brotli ++ 85 + optional c-aresSupport c-ares ++ 86 + optional gnutlsSupport gnutls ++ 87 + optional gsaslSupport gsasl ++ 88 + optional gssSupport libkrb5 ++ 89 optional http2Support nghttp2 ++ 90 + optionals http3Support [ nghttp3 ngtcp2 ] ++ 91 + optional idnSupport libidn2 ++ 92 optional ldapSupport openldap ++ 93 optional opensslSupport openssl ++ 94 + optional pslSupport libpsl ++ 95 + optional rtmpSupport rtmpdump ++ 96 + optional scpSupport libssh2 ++ 97 optional wolfsslSupport wolfssl ++ 98 + optional zlibSupport zlib ++ 99 + optional zstdSupport zstd; 100 101 # for the second line see https://curl.haxx.se/mail/tracker-2014-03/0087.html 102 preConfigure = '' ··· 105 ''; 106 107 configureFlags = [ 108 + # Build without manual 109 + "--disable-manual" 110 # Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback 111 # to nss-cacert from the default profile. 112 "--without-ca-bundle" 113 "--without-ca-path" 114 + (lib.enableFeature c-aresSupport "ares") 115 + (lib.enableFeature ldapSupport "ldap") 116 + (lib.enableFeature ldapSupport "ldaps") 117 # The build fails when using wolfssl with --with-ca-fallback 118 (lib.withFeature (!wolfsslSupport) "ca-fallback") 119 + (lib.withFeature http3Support "nghttp3") 120 + (lib.withFeature http3Support "ngtcp2") 121 + (lib.withFeature rtmpSupport "librtmp") 122 + (lib.withFeature zstdSupport "zstd") 123 + (lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli)) 124 (lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls)) 125 + (lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2)) 126 + (lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl)) 127 (lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2)) 128 + (lib.withFeatureAs wolfsslSupport "wolfssl" (lib.getDev wolfssl)) 129 ] 130 ++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}" 131 # For the 'urandom', maybe it should be a cross-system option 132 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+9
pkgs/top-level/all-packages.nix
··· 4464 4465 curlFull = curl.override { 4466 ldapSupport = true; 4467 }; 4468 4469 curl = curlMinimal.override ({ 4470 idnSupport = true; 4471 } // lib.optionalAttrs (!stdenv.hostPlatform.isStatic) { 4472 gssSupport = true; 4473 brotliSupport = true;
··· 4464 4465 curlFull = curl.override { 4466 ldapSupport = true; 4467 + gsaslSupport = true; 4468 + rtmpSupport = true; 4469 + pslSupport = true; 4470 + }; 4471 + 4472 + curlHTTP3 = curl.override { 4473 + openssl = quictls; 4474 + http3Support = true; 4475 }; 4476 4477 curl = curlMinimal.override ({ 4478 idnSupport = true; 4479 + zstdSupport = true; 4480 } // lib.optionalAttrs (!stdenv.hostPlatform.isStatic) { 4481 gssSupport = true; 4482 brotliSupport = true;