Unverified Commit 97c2bae1 authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

curl: choose automatically quictl when building with http3

parent 581fd657
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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; }; };
+0 −1
Original line number Diff line number Diff line
@@ -3055,7 +3055,6 @@ with pkgs;
  };
  curlHTTP3 = curl.override {
    openssl = quictls;
    http3Support = true;
  };