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