1 # Maintainer: Dave Reisner <dreisner@archlinux.org>
2 # Contributor: Angel Velasquez <angvp@archlinux.org>
3 # Contributor: Eric Belanger <eric@archlinux.org>
4 # Contributor: Lucien Immink <l.immink@student.fnt.hvu.nl>
5 # Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
8 pkgname=(curl libcurl-compat libcurl-gnutls)
11 pkgdesc='An URL retrieval utility and library'
13 url='https://curl.haxx.se'
16 depends=('ca-certificates' 'brotli' 'libbrotlidec.so' 'krb5' 'libgssapi_krb5.so'
17 'libidn2' 'libidn2.so' 'libnghttp2' 'libpsl' 'libpsl.so' 'libssh2' 'libssh2.so'
18 'openssl' 'zlib' 'zstd' 'libzstd.so')
19 provides=('libcurl.so')
20 source=("https://curl.haxx.se/download/${pkgname}-${pkgver}.tar.gz"{,.asc}
21 '0001-select-do-not-return-fatal-error-on-EINTR-from-poll.patch')
22 sha512sums=('8133baf48dfd93531ce0a226b54cb153fd58bb0c1ffe8159cee0c0aa23ce210192c572e8ee01f3d75a87b609a580e76929df1e66635be59c177b0cb8076043b2'
24 '3d771caae23f4b602e57788c61d3f4eaccbd3a73e7256ef7dc2699e574554246280afde1f9eac10c54a498aa0d25de6e696ea36f65389e45ec8ec9abcb3bfb88')
25 validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg
29 --mandir='/usr/share/man'
34 --enable-threaded-resolver
38 --with-random='/dev/urandom'
39 --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
43 cd "${srcdir}/${pkgbase}-${pkgver}"
45 patch -Np1 < ../0001-select-do-not-return-fatal-error-on-EINTR-from-poll.patch
49 mkdir build-curl{,-compat,-gnutls}
52 cd "${srcdir}"/build-curl
54 "${srcdir}/${pkgbase}-${pkgver}"/configure \
55 "${_configure_options[@]}" \
56 --enable-versioned-symbols
57 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
60 # build libcurl-compat
61 cd "${srcdir}"/build-curl-compat
63 "${srcdir}/${pkgbase}-${pkgver}"/configure \
64 "${_configure_options[@]}" \
65 --disable-versioned-symbols
66 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
69 # build libcurl-gnutls
70 cd "${srcdir}"/build-curl-gnutls
72 "${srcdir}/${pkgbase}-${pkgver}"/configure \
73 "${_configure_options[@]}" \
74 --disable-versioned-symbols \
77 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
84 make DESTDIR="${pkgdir}" install
85 make DESTDIR="${pkgdir}" install -C scripts
87 cd "${srcdir}/${pkgname}-${pkgver}"
90 install -Dt "${pkgdir}/usr/share/licenses/$pkgname" -m0644 COPYING
93 package_libcurl-compat() {
94 pkgdesc='An URL retrieval library (without versioned symbols)'
95 depends=('curl' 'openssl')
97 cd "${srcdir}"/build-curl-compat
99 make -C lib DESTDIR="${pkgdir}" install
101 mv "${pkgdir}"/usr/lib/libcurl{,-compat}.so.4.8.0
102 rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
103 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
104 ln -s libcurl-compat.so.4.8.0 "${pkgdir}"/usr/lib/libcurl.so.${version}
107 install -dm 0755 "${pkgdir}"/usr/share/licenses
108 ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-compat
111 package_libcurl-gnutls() {
112 pkgdesc='An URL retrieval library (without versioned symbols and linked against gnutls)'
113 depends=('curl' 'gnutls')
115 cd "${srcdir}"/build-curl-gnutls
117 make -C lib DESTDIR="${pkgdir}" install
119 mv "${pkgdir}"/usr/lib/libcurl{,-gnutls}.so.4.8.0
120 rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
121 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
122 ln -s libcurl-gnutls.so.4.8.0 "${pkgdir}"/usr/lib/libcurl-gnutls.so.${version}
125 install -dm 0755 "${pkgdir}"/usr/share/licenses
126 ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-gnutls