diff options
-rw-r--r-- | .SRCINFO | 39 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 81 | ||||
-rw-r--r-- | ngtcp2-refactor.patch | 90 |
4 files changed, 215 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..50d673e40d8f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,39 @@ +pkgbase = curl-http3-ngtcp2 + pkgdesc = An URL retrieval utility and library - compiled with HTTP/3 support (using ngtcp2 and nghttp3) + pkgver = 8.0.1 + pkgrel = 4 + url = https://curl.se/ + arch = x86_64 + license = MIT + makedepends = git + makedepends = patchelf + depends = ca-certificates + depends = brotli + depends = libbrotlidec.so + depends = krb5 + depends = libgssapi_krb5.so + depends = libidn2 + depends = libidn2.so + depends = libnghttp2 + depends = libpsl + depends = libpsl.so + depends = libssh2 + depends = libssh2.so + depends = openssl + depends = zlib + depends = zstd + depends = libzstd.so + depends = nghttp3 + depends = libnghttp3.so + depends = ngtcp2 + depends = libngtcp2.so + provides = curl + provides = libcurl.so + conflicts = curl + source = git+https://github.com/curl/curl.git?signed#tag=6b77e19466486b37f93d07d2107579f9508a6645 + source = ngtcp2-refactor.patch + validpgpkeys = 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2 + sha512sums = SKIP + sha512sums = fd0496462866aa67b86bd536a9d051dcab9f546a4bda80bd21a28a93aaac57d0d15ed8d19a36ade9642e10ae41922cb0bb63d56a96b4d79e69dda202fd686da5 + +pkgname = curl-http3-ngtcp2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..a057b0392580 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/curl/ +/keys/ +/src/ +/pkg/ +*.tar* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..39ff30776da0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,81 @@ +# Maintainer: Ziah Jyothi <`echo 'Y29udGFjdEB6aWFoLmRldgo=' | base64 -d`> +pkgname=curl-http3-ngtcp2 +pkgver=8.0.1 +pkgrel=4 +pkgdesc="An URL retrieval utility and library - compiled with HTTP/3 support (using ngtcp2 and nghttp3)" +arch=('x86_64') +url='https://curl.se/' +license=('MIT') +depends=('ca-certificates' 'brotli' 'libbrotlidec.so' 'krb5' 'libgssapi_krb5.so' + 'libidn2' 'libidn2.so' 'libnghttp2' 'libpsl' 'libpsl.so' 'libssh2' 'libssh2.so' + 'openssl' 'zlib' 'zstd' 'libzstd.so' 'nghttp3' 'libnghttp3.so' 'ngtcp2' 'libngtcp2.so') +makedepends=('git' 'patchelf') +conflicts=('curl') +provides=('curl' 'libcurl.so') +validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg +_tag='6b77e19466486b37f93d07d2107579f9508a6645' # git rev-parse v${_tag_name} +source=("git+https://github.com/curl/curl.git?signed#tag=${_tag}" + "ngtcp2-refactor.patch") +sha512sums=('SKIP' + 'fd0496462866aa67b86bd536a9d051dcab9f546a4bda80bd21a28a93aaac57d0d15ed8d19a36ade9642e10ae41922cb0bb63d56a96b4d79e69dda202fd686da5') + +pkgver() { + cd "${srcdir}/curl" + git describe | sed -E 's/curl-([0-9]+)_([0-9]+)_([0-9]+)/\1.\2.\3/g' +} + +prepare() { + cd "${srcdir}/curl" + + # Patch curl + patch -Np1 -i ../ngtcp2-refactor.patch + + # no '-DEV' in version, please... + sed -i "/\WLIBCURL_VERSION\W/c #define LIBCURL_VERSION \"${pkgver}\"" include/curl/curlver.h + + autoreconf -fi +} + +build() { + mkdir -p "${srcdir}/build-curl" + + cd "${srcdir}/build-curl" + + "${srcdir}/curl/configure" \ + LDFLAGS="-Wl,-rpath,/usr/local/lib -fPIC" \ + --with-openssl \ + --with-nghttp3 \ + --with-ngtcp2 \ + --enable-versioned-symbols \ + --enable-alt-svc \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --disable-ldap \ + --disable-ldaps \ + --disable-manual \ + --enable-shared \ + --disable-static \ + --enable-ipv6 \ + --enable-threaded-resolver \ + --enable-websockets \ + --with-gssapi \ + --with-libssh2 \ + --without-librtmp \ + --disable-rtsp \ + --with-random=/dev/urandom \ + --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make -j "$(nproc)" +} + +package() { + cd "${srcdir}/build-curl" + + make DESTDIR="${pkgdir}" install + make DESTDIR="${pkgdir}" install -C scripts + + cd .. + + # License + install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m0644 "${srcdir}/curl"/COPYING +} diff --git a/ngtcp2-refactor.patch b/ngtcp2-refactor.patch new file mode 100644 index 000000000000..184d5ac5d9f3 --- /dev/null +++ b/ngtcp2-refactor.patch @@ -0,0 +1,90 @@ +diff --unified --recursive --text curl.orig/lib/vquic/curl_ngtcp2.c curl.new/lib/vquic/curl_ngtcp2.c +--- curl.orig/lib/vquic/curl_ngtcp2.c 2023-04-26 23:00:39.460374064 -0400 ++++ curl.new/lib/vquic/curl_ngtcp2.c 2023-04-26 23:05:28.030119170 -0400 +@@ -133,7 +133,7 @@ + uint32_t version; + ngtcp2_settings settings; + ngtcp2_transport_params transport_params; +- ngtcp2_connection_close_error last_error; ++ ngtcp2_ccerr last_error; + ngtcp2_crypto_conn_ref conn_ref; + #ifdef USE_OPENSSL + SSL_CTX *sslctx; +@@ -653,7 +653,7 @@ + DEBUGF(LOG_CF(data, cf, "[h3sid=%" PRId64 "] read_stream(len=%zu) -> %zd", + stream_id, buflen, nconsumed)); + if(nconsumed < 0) { +- ngtcp2_connection_close_error_set_application_error( ++ ngtcp2_ccerr_set_application_error( + &ctx->last_error, + nghttp3_err_infer_quic_app_error_code((int)nconsumed), NULL, 0); + return NGTCP2_ERR_CALLBACK_FAILURE; +@@ -712,7 +712,7 @@ + DEBUGF(LOG_CF(data, cf, "[h3sid=%" PRId64 "] quic close(err=%" + PRIu64 ") -> %d", stream3_id, app_error_code, rv)); + if(rv) { +- ngtcp2_connection_close_error_set_application_error( ++ ngtcp2_ccerr_set_application_error( + &ctx->last_error, nghttp3_err_infer_quic_app_error_code(rv), NULL, 0); + return NGTCP2_ERR_CALLBACK_FAILURE; + } +@@ -1202,7 +1202,7 @@ + int rc; + int64_t ctrl_stream_id, qpack_enc_stream_id, qpack_dec_stream_id; + +- if(ngtcp2_conn_get_max_local_streams_uni(ctx->qconn) < 3) { ++ if(ngtcp2_conn_get_streams_uni_left(ctx->qconn) < 3) { + return CURLE_QUIC_CONNECT_ERROR; + } + +@@ -1817,12 +1817,12 @@ + ngtcp2_strerror(rv))); + if(!ctx->last_error.error_code) { + if(rv == NGTCP2_ERR_CRYPTO) { +- ngtcp2_connection_close_error_set_transport_error_tls_alert( ++ ngtcp2_ccerr_set_tls_alert( + &ctx->last_error, + ngtcp2_conn_get_tls_alert(ctx->qconn), NULL, 0); + } + else { +- ngtcp2_connection_close_error_set_transport_error_liberr( ++ ngtcp2_ccerr_set_liberr( + &ctx->last_error, rv, NULL, 0); + } + } +@@ -1875,7 +1875,7 @@ + if(rv) { + failf(data, "ngtcp2_conn_handle_expiry returned error: %s", + ngtcp2_strerror(rv)); +- ngtcp2_connection_close_error_set_transport_error_liberr(&ctx->last_error, ++ ngtcp2_ccerr_set_liberr(&ctx->last_error, + rv, NULL, 0); + return CURLE_SEND_ERROR; + } +@@ -1904,7 +1904,7 @@ + if(veccnt < 0) { + failf(data, "nghttp3_conn_writev_stream returned error: %s", + nghttp3_strerror((int)veccnt)); +- ngtcp2_connection_close_error_set_application_error( ++ ngtcp2_ccerr_set_application_error( + &ctx->last_error, + nghttp3_err_infer_quic_app_error_code((int)veccnt), NULL, 0); + return CURLE_SEND_ERROR; +@@ -1962,7 +1962,7 @@ + assert(ndatalen == -1); + failf(data, "ngtcp2_conn_writev_stream returned error: %s", + ngtcp2_strerror((int)outlen)); +- ngtcp2_connection_close_error_set_transport_error_liberr( ++ ngtcp2_ccerr_set_liberr( + &ctx->last_error, (int)outlen, NULL, 0); + return CURLE_SEND_ERROR; + } +@@ -2277,7 +2277,7 @@ + ngtcp2_conn_set_tls_native_handle(ctx->qconn, ctx->ssl); + #endif + +- ngtcp2_connection_close_error_default(&ctx->last_error); ++ ngtcp2_ccerr_default(&ctx->last_error); + + ctx->conn_ref.get_conn = get_conn; + ctx->conn_ref.user_data = cf; |