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)
9 _tag='6b77e19466486b37f93d07d2107579f9508a6645' # git rev-parse v${_tag_name}
11 pkgver="${_tag_name//_/.}"
13 pkgdesc='command line tool and library for transferring data with URLs'
15 url='https://curl.haxx.se/'
17 depends=('ca-certificates' 'brotli' 'libbrotlidec.so' 'krb5' 'libgssapi_krb5.so'
18 'libidn2' 'libidn2.so' 'libnghttp2' 'libpsl' 'libpsl.so' 'libssh2' 'libssh2.so'
19 'openssl' 'zlib' 'zstd' 'libzstd.so')
20 makedepends=('git' 'patchelf')
21 provides=('libcurl.so')
22 validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg
23 source=("git+https://github.com/bagder/curl.git#tag=${_tag}?signed")
36 for _c in "${_backports[@]}"; do
37 if [[ $_c == *..* ]]; then
38 git log --oneline --reverse "${_c}"
40 git log --oneline -1 "${_c}"
42 git cherry-pick -n -m1 "${_c}"
44 for _c in "${_reverts[@]}"; do
45 git log --oneline -1 "${_c}"
49 # no '-DEV' in version, please...
50 sed -i "/\WLIBCURL_VERSION\W/c #define LIBCURL_VERSION \"${pkgver}\"" include/curl/curlver.h
56 local _configure_options=(
58 --mandir='/usr/share/man'
63 --enable-threaded-resolver
66 --with-random='/dev/urandom'
67 --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
70 mkdir build-curl{,-compat,-gnutls}
73 cd "${srcdir}"/build-curl
75 "${srcdir}/${pkgbase}"/configure \
76 "${_configure_options[@]}" \
78 --enable-versioned-symbols
79 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
82 # build libcurl-compat
83 cd "${srcdir}"/build-curl-compat
85 "${srcdir}/${pkgbase}"/configure \
86 "${_configure_options[@]}" \
88 --disable-versioned-symbols
89 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
92 # build libcurl-gnutls
93 cd "${srcdir}"/build-curl-gnutls
95 "${srcdir}/${pkgbase}"/configure \
96 "${_configure_options[@]}" \
97 --disable-versioned-symbols \
100 sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
102 patchelf --set-soname 'libcurl-gnutls.so.4' ./lib/.libs/libcurl.so
108 make DESTDIR="${pkgdir}" install
109 make DESTDIR="${pkgdir}" install -C scripts
111 cd "${srcdir}/${pkgname}"
114 install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m0644 COPYING
117 package_libcurl-compat() {
118 pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols)'
119 depends=('curl' 'openssl')
120 provides=('libcurl-compat.so')
122 cd "${srcdir}"/build-curl-compat
124 make -C lib DESTDIR="${pkgdir}" install
126 mv "${pkgdir}"/usr/lib/libcurl{,-compat}.so.4.8.0
127 rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
128 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
129 ln -s libcurl-compat.so.4.8.0 "${pkgdir}"/usr/lib/libcurl.so.${version}
132 install -dm 0755 "${pkgdir}"/usr/share/licenses
133 ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-compat
136 package_libcurl-gnutls() {
137 pkgdesc='command line tool and library for transferring data with URLs (no versioned symbols, linked against gnutls)'
138 depends=('curl' 'gnutls')
139 provides=('libcurl-gnutls.so')
141 cd "${srcdir}"/build-curl-gnutls
143 make -C lib DESTDIR="${pkgdir}" install
145 mv "${pkgdir}"/usr/lib/libcurl{,-gnutls}.so.4.8.0
146 rm "${pkgdir}"/usr/lib/libcurl.{a,so}*
147 ln -s libcurl-gnutls.so.4 "${pkgdir}"/usr/lib/libcurl-gnutls.so
148 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
149 ln -s libcurl-gnutls.so.4.8.0 "${pkgdir}"/usr/lib/libcurl-gnutls.so.${version}
152 install -dm 0755 "${pkgdir}"/usr/share/licenses
153 ln -s curl "${pkgdir}"/usr/share/licenses/libcurl-gnutls