curl: choose automatically quictl when building with http3

This commit is contained in:
Sandro Jäckel
2024-12-27 14:23:08 +01:00
parent 581fd657d5
commit 97c2bae1b9
2 changed files with 9 additions and 5 deletions
+9 -4
View File
@@ -14,7 +14,7 @@
!(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform))
), libkrb5
, http2Support ? true, nghttp2
, http3Support ? false, nghttp3, ngtcp2
, http3Support ? false, nghttp3, ngtcp2, quictls
, websocketSupport ? false
, idnSupport ? false, libidn2
, ldapSupport ? false, openldap
@@ -47,6 +47,10 @@
assert !((lib.count (x: x) [ gnutlsSupport opensslSupport wolfsslSupport rustlsSupport ]) > 1);
let
openssl' = if http3Support then quictls else openssl;
in
stdenv.mkDerivation (finalAttrs: {
pname = "curl";
version = "8.11.0";
@@ -106,7 +110,7 @@ stdenv.mkDerivation (finalAttrs: {
lib.optionals http3Support [ nghttp3 ngtcp2 ] ++
lib.optional idnSupport libidn2 ++
lib.optional ldapSupport openldap ++
lib.optional opensslSupport openssl ++
lib.optional opensslSupport openssl' ++
lib.optional pslSupport libpsl ++
lib.optional rtmpSupport rtmpdump ++
lib.optional scpSupport libssh2 ++
@@ -150,7 +154,7 @@ stdenv.mkDerivation (finalAttrs: {
(lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli))
(lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls))
(lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2))
(lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl))
(lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl'))
(lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2))
(lib.withFeatureAs wolfsslSupport "wolfssl" (lib.getDev wolfssl))
]
@@ -205,7 +209,8 @@ stdenv.mkDerivation (finalAttrs: {
passthru = let
useThisCurl = attr: attr.override { curl = finalAttrs.finalPackage; };
in {
inherit opensslSupport openssl;
inherit opensslSupport;
openssl = openssl';
tests = {
withCheck = finalAttrs.finalPackage.overrideAttrs (_: { doCheck = true; });
fetchpatch = tests.fetchpatch.simple.override { fetchpatch = (fetchpatch.override { fetchurl = useThisCurl fetchurl; }) // { version = 1; }; };
-1
View File
@@ -3055,7 +3055,6 @@ with pkgs;
};
curlHTTP3 = curl.override {
openssl = quictls;
http3Support = true;
};