jobcore/curl/PKGBUILD-arch

185 lines
5.4 KiB
Text
Raw Normal View History

2022-03-20 13:19:37 +01:00
# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Lucien Immink <l.immink@student.fnt.hvu.nl>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
pkgbase=curl
pkgname=(curl libcurl-compat libcurl-gnutls)
2024-07-25 13:06:08 +02:00
pkgver=8.9.0
2024-07-30 22:44:35 +02:00
pkgrel=2
2023-02-18 20:16:40 +01:00
pkgdesc='command line tool and library for transferring data with URLs'
2022-03-20 13:19:37 +01:00
arch=('x86_64')
2023-05-17 09:58:20 +02:00
url='https://curl.se/'
2022-03-20 13:19:37 +01:00
license=('MIT')
depends=('ca-certificates'
'brotli' 'libbrotlidec.so'
'krb5' 'libgssapi_krb5.so'
'libidn2' 'libidn2.so'
'libnghttp2' 'libnghttp2.so'
'libnghttp3' 'libnghttp3.so'
'libpsl' 'libpsl.so'
'libssh2' 'libssh2.so'
'zlib' 'libz.so'
'zstd' 'libzstd.so')
2023-02-16 23:42:27 +01:00
makedepends=('git' 'patchelf')
2024-03-29 01:15:41 +01:00
checkdepends=('valgrind')
2022-03-20 13:19:37 +01:00
validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg
2024-05-22 18:54:50 +02:00
source=("git+https://github.com/curl/curl.git#tag=curl-${pkgver//./_}?signed")
2024-07-25 13:06:08 +02:00
sha512sums=('3bb473767cc1482a4fccf871098d98923effce288d2f0c0631e077f075adde85774ca341285153d26de63e70ed89af909485bee4f46310db69987cf148a3dea1')
2022-03-20 13:19:37 +01:00
2023-02-16 23:42:27 +01:00
_backports=(
2024-07-30 22:44:35 +02:00
'17e6f06ea37136c36d2712b3433ef0d3b118ec0d' # https://github.com/curl/curl/issues/14280
2023-02-16 23:42:27 +01:00
)
_reverts=(
2022-03-20 13:19:37 +01:00
)
2023-01-04 00:59:35 +01:00
prepare() {
2023-02-16 23:42:27 +01:00
cd "$pkgbase"
local _c
for _c in "${_backports[@]}"; do
if [[ $_c == *..* ]]; then
git log --oneline --reverse "${_c}"
else
git log --oneline -1 "${_c}"
fi
git cherry-pick -n -m1 "${_c}"
done
for _c in "${_reverts[@]}"; do
git log --oneline -1 "${_c}"
git revert -n "${_c}"
done
2023-01-04 00:59:35 +01:00
2023-05-17 09:58:20 +02:00
# no '-DEV' in version, release date from tagged commit...
sed -i \
-e "/\WLIBCURL_VERSION\W/c #define LIBCURL_VERSION \"${pkgver}\"" \
2024-03-27 17:56:09 +01:00
-e "/\WLIBCURL_TIMESTAMP\W/c #define LIBCURL_TIMESTAMP \"$(git log -1 --format=%cs "curl-${pkgver//./_}")\"" \
2023-05-17 09:58:20 +02:00
include/curl/curlver.h
2023-02-23 00:08:29 +01:00
2023-02-16 23:42:27 +01:00
autoreconf -fi
2023-01-04 00:59:35 +01:00
}
2022-03-20 13:19:37 +01:00
build() {
2023-02-16 23:42:27 +01:00
local _configure_options=(
--prefix='/usr'
--mandir='/usr/share/man'
--disable-ldap
--disable-ldaps
--disable-manual
--enable-ipv6
--enable-threaded-resolver
--with-gssapi
--with-libssh2
--with-random='/dev/urandom'
--with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
)
2022-03-20 13:19:37 +01:00
mkdir build-curl{,-compat,-gnutls}
# build curl
cd "${srcdir}"/build-curl
2023-02-16 23:42:27 +01:00
"${srcdir}/${pkgbase}"/configure \
2022-03-20 13:19:37 +01:00
"${_configure_options[@]}" \
2024-03-29 01:15:41 +01:00
--enable-versioned-symbols \
--with-fish-functions-dir=/usr/share/fish/vendor_completions.d/ \
2022-10-27 06:18:57 +02:00
--with-openssl \
--with-openssl-quic \
2024-03-29 01:15:41 +01:00
--with-zsh-functions-dir=/usr/share/zsh/site-functions/
2022-03-20 13:19:37 +01:00
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
# build libcurl-compat
cd "${srcdir}"/build-curl-compat
2023-02-16 23:42:27 +01:00
"${srcdir}/${pkgbase}"/configure \
2022-03-20 13:19:37 +01:00
"${_configure_options[@]}" \
2024-03-29 01:15:41 +01:00
--disable-versioned-symbols \
2022-10-27 06:18:57 +02:00
--with-openssl \
2024-03-29 01:15:41 +01:00
--with-openssl-quic
2022-03-20 13:19:37 +01:00
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make -C lib
patchelf --set-soname 'libcurl-compat.so.4' ./lib/.libs/libcurl.so
2022-03-20 13:19:37 +01:00
# build libcurl-gnutls
cd "${srcdir}"/build-curl-gnutls
2023-02-16 23:42:27 +01:00
"${srcdir}/${pkgbase}"/configure \
2022-03-20 13:19:37 +01:00
"${_configure_options[@]}" \
--disable-versioned-symbols \
2024-03-29 01:15:41 +01:00
--with-gnutls \
--without-openssl
2022-03-20 13:19:37 +01:00
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make -C lib
2022-09-12 23:24:07 +02:00
patchelf --set-soname 'libcurl-gnutls.so.4' ./lib/.libs/libcurl.so
2022-03-20 13:19:37 +01:00
}
2024-03-27 17:56:09 +01:00
check() {
2024-03-29 01:15:41 +01:00
cd build-curl
# -v: verbose
# -a: keep going on failure (so we see everything which breaks, not just the first failing test)
# -k: keep test files after completion
# -am: automake style TAP output
# -p: print logs if test fails
# -j: parallelization
# disable test 433, since it requires the glibc debug info
make TFLAGS="-v -a -k -p -j$(nproc) !433" test-nonflaky
2024-03-27 17:56:09 +01:00
}
2022-03-20 13:19:37 +01:00
package_curl() {
depends+=('openssl' 'libcrypto.so' 'libssl.so')
provides=('libcurl.so')
2022-03-20 13:19:37 +01:00
cd build-curl
make DESTDIR="${pkgdir}" install
make DESTDIR="${pkgdir}" install -C scripts
2023-02-16 23:42:27 +01:00
cd "${srcdir}/${pkgname}"
2022-03-20 13:19:37 +01:00
# license
2023-02-16 23:42:27 +01:00
install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m0644 COPYING
2022-03-20 13:19:37 +01:00
}
package_libcurl-compat() {
2023-02-18 20:16:40 +01:00
pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols)'
depends=('curl')
2023-02-16 23:42:27 +01:00
provides=('libcurl-compat.so')
2022-03-20 13:19:37 +01:00
cd "${srcdir}"/build-curl-compat
make -C lib DESTDIR="${pkgdir}" install
2022-04-27 12:23:36 +02:00
mv "${pkgdir}"/usr/lib/libcurl{,-compat}.so.4.8.0
2022-03-20 13:19:37 +01:00
rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
2022-04-27 12:23:36 +02:00
for version in 3 4.0.0 4.1.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0; do
ln -s libcurl-compat.so.4.8.0 "${pkgdir}"/usr/lib/libcurl.so.${version}
ln -s libcurl-compat.so.4.8.0 "${pkgdir}"/usr/lib/libcurl-compat.so.${version}
2022-03-20 13:19:37 +01:00
done
install -dm 0755 "${pkgdir}"/usr/share/licenses
ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-compat
}
package_libcurl-gnutls() {
2023-02-18 20:16:40 +01:00
pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols, linked against gnutls)'
2022-03-20 13:19:37 +01:00
depends=('curl' 'gnutls')
2023-02-16 23:42:27 +01:00
provides=('libcurl-gnutls.so')
2022-03-20 13:19:37 +01:00
cd "${srcdir}"/build-curl-gnutls
make -C lib DESTDIR="${pkgdir}" install
2022-04-27 12:23:36 +02:00
mv "${pkgdir}"/usr/lib/libcurl{,-gnutls}.so.4.8.0
2022-03-20 13:19:37 +01:00
rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
2022-09-12 23:24:07 +02:00
ln -s libcurl-gnutls.so.4 "${pkgdir}"/usr/lib/libcurl-gnutls.so
2022-04-27 12:23:36 +02:00
for version in 3 4 4.0.0 4.1.0 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0; do
ln -s libcurl-gnutls.so.4.8.0 "${pkgdir}"/usr/lib/libcurl-gnutls.so.${version}
2022-03-20 13:19:37 +01:00
done
install -dm 0755 "${pkgdir}"/usr/share/licenses
ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-gnutls
}