Skip to content

Commit

Permalink
curl: choose automatically quictl when building with http3
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Oct 28, 2024
1 parent 1661ad6 commit 6d086db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 9 additions & 4 deletions pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.9.1";
Expand Down Expand Up @@ -97,7 +101,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 ++
Expand Down Expand Up @@ -141,7 +145,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))
]
Expand Down Expand Up @@ -196,7 +200,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; }; };
Expand Down
1 change: 0 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6712,7 +6712,6 @@ with pkgs;
};

curlHTTP3 = curl.override {
openssl = quictls;
http3Support = true;
};

Expand Down

0 comments on commit 6d086db

Please sign in to comment.