# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/danielstenberg.asc inherit autotools multilib-minimal multiprocessing prefix toolchain-funcs verify-sig DESCRIPTION="A Client that groks URLs" HOMEPAGE="https://curl.se/" if [[ ${PV} == 9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://github.com/curl/curl.git" else SRC_URI=" https://curl.se/download/${P}.tar.xz verify-sig? ( https://curl.se/download/${P}.tar.xz.asc ) " KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" fi LICENSE="BSD curl ISC test? ( BSD-4 )" SLOT="0" IUSE="+adns +alt-svc brotli +ftp gnutls gopher +hsts +http2 idn +imap kerberos ldap mbedtls nghttp3 +openssl +pop3" IUSE+=" +psl +progress-meter rtmp rustls samba +smtp ssh ssl sslv3 static-libs test telnet +tftp websockets zstd" # These select the default SSL implementation IUSE+=" curl_ssl_gnutls curl_ssl_mbedtls +curl_ssl_openssl curl_ssl_rustls" RESTRICT="!test? ( test )" # Only one default ssl provider can be enabled # The default ssl provider needs its USE satisfied # nghttp3 = https://bugs.gentoo.org/912029 REQUIRED_USE=" ssl? ( ^^ ( curl_ssl_gnutls curl_ssl_mbedtls curl_ssl_openssl curl_ssl_rustls ) ) curl_ssl_gnutls? ( gnutls ) curl_ssl_mbedtls? ( mbedtls ) curl_ssl_openssl? ( openssl ) curl_ssl_rustls? ( rustls ) nghttp3? ( !openssl alt-svc ) " # cURL's docs and CI/CD are great resources for confirming supported versions # particulary for fast-moving targets like HTTP/2 and TCP/2 e.g.: # - https://github.com/curl/curl/blob/master/docs/INTERNALS.md (core dependencies + minimum versions) # - https://github.com/curl/curl/blob/master/docs/HTTP3.md (example of a feature that moves quickly) # - https://github.com/curl/curl/blob/master/.github/workflows/quiche-linux.yml (CI/CD for TCP/2) # However 'supported' vs 'works' are two entirely different things; be sane but # don't be afraid to require a later version. RDEPEND=" >=sys-libs/zlib-1.1.4[${MULTILIB_USEDEP}] adns? ( net-dns/c-ares:=[${MULTILIB_USEDEP}] ) brotli? ( app-arch/brotli:=[${MULTILIB_USEDEP}] ) http2? ( >=net-libs/nghttp2-1.12.0:=[${MULTILIB_USEDEP}] ) idn? ( net-dns/libidn2:=[static-libs?,${MULTILIB_USEDEP}] ) kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] ) ldap? ( >=net-nds/openldap-2.0.0:=[static-libs?,${MULTILIB_USEDEP}] ) nghttp3? ( >=net-libs/nghttp3-0.15.0[${MULTILIB_USEDEP}] >=net-libs/ngtcp2-0.19.1[gnutls,ssl,-openssl,${MULTILIB_USEDEP}] ) psl? ( net-libs/libpsl[${MULTILIB_USEDEP}] ) rtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] ) ssh? ( >=net-libs/libssh2-1.0.0[${MULTILIB_USEDEP}] ) ssl? ( gnutls? ( app-misc/ca-certificates >=net-libs/gnutls-3.1.10:=[static-libs?,${MULTILIB_USEDEP}] dev-libs/nettle:=[${MULTILIB_USEDEP}] ) mbedtls? ( app-misc/ca-certificates net-libs/mbedtls:=[${MULTILIB_USEDEP}] ) openssl? ( >=dev-libs/openssl-0.9.7:=[sslv3(-)=,static-libs?,${MULTILIB_USEDEP}] ) rustls? ( >=net-libs/rustls-ffi-0.12.1:=[${MULTILIB_USEDEP}] > libcurl.pc || die } multilib_src_compile() { default if multilib_is_native_abi; then # Shell completions ! tc-is-cross-compiler && emake -C scripts fi } # There is also a pytest harness that tests for bugs in some very specific # situations; we can rely on upstream for this rather than adding additional test deps. multilib_src_test() { # See https://github.com/curl/curl/blob/master/tests/runtests.pl#L5721 # -n: no valgrind (unreliable in sandbox and doesn't work correctly on all arches) # -v: verbose # -a: keep going on failure (so we see everything which breaks, not just 1st test) # -k: keep test files after completion # -am: automake style TAP output # -p: print logs if test fails # Note: if needed, we can skip specific tests. See e.g. Fedora's packaging # or just read https://github.com/curl/curl/tree/master/tests#run. # Note: we don't run the testsuite for cross-compilation. # Upstream recommend 7*nproc as a starting point for parallel tests, but # this ends up breaking when nproc is huge (like -j80). # The network sandbox causes tests 241 and 1083 to fail; these are typically skipped # as most gentoo users don't have an 'ip6-localhost' multilib_is_native_abi && emake test TFLAGS="-n -v -a -k -am -p -j$((2*$(makeopts_jobs))) !241 !1083" } multilib_src_install() { emake DESTDIR="${D}" install if multilib_is_native_abi; then # Shell completions ! tc-is-cross-compiler && emake -C scripts DESTDIR="${D}" install fi } multilib_src_install_all() { einstalldocs find "${ED}" -type f -name '*.la' -delete || die rm -rf "${ED}"/etc/ || die }