diff options
-rw-r--r-- | .SRCINFO | 31 | ||||
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | 0002-nghttp2-static.patch | 24 | ||||
-rw-r--r-- | 0003-libpsl-static-libs.patch | 41 | ||||
-rw-r--r-- | 0004-more-static-fixes.patch | 24 | ||||
-rw-r--r-- | PKGBUILD | 74 |
6 files changed, 200 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..843dd6fec1ec --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,31 @@ +pkgbase = android-x86-curl + pkgdesc = An URL retrival utility and library (android) + pkgver = 8.5.0 + pkgrel = 1 + url = https://curl.haxx.se + arch = any + license = MIT + makedepends = android-configure + depends = android-x86-brotli + depends = android-x86-libidn2 + depends = android-x86-libnghttp2 + depends = android-x86-libnghttp3 + depends = android-x86-libpsl + depends = android-x86-libssh2 + depends = android-x86-openssl + depends = android-x86-zstd + depends = android-x86-zlib + options = !strip + options = !buildflags + options = staticlibs + options = !emptydirs + source = https://curl.haxx.se/download/curl-8.5.0.tar.bz2 + source = 0002-nghttp2-static.patch + source = 0003-libpsl-static-libs.patch + source = 0004-more-static-fixes.patch + sha256sums = ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b + sha256sums = 3ee9c75a3046f86f91290c143170179230c9adc6eabfbb79eb26f708a165b719 + sha256sums = 7492d019036b5bec251bfbc3c0b40e5f16d3dd6b2515068835e087a6c21f19ad + sha256sums = 590eb65e90e756eaad993d52a101f29091ada2c742c5a607684e88fc5c560d54 + +pkgname = android-x86-curl diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..b5b03b115225 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +pkg +src +*.tar.xz +*.tar.gz +*.tar.bz2 +*.asc diff --git a/0002-nghttp2-static.patch b/0002-nghttp2-static.patch new file mode 100644 index 000000000000..24a53bdbada8 --- /dev/null +++ b/0002-nghttp2-static.patch @@ -0,0 +1,24 @@ +--- curl-7.86.0/lib/Makefile.am.orig 2022-10-29 12:03:24 +0000 ++++ curl-7.86.0/lib/Makefile.am 2022-10-29 12:05:35 +0000 +@@ -107,7 +107,8 @@ + endif + + if USE_CPPFLAG_CURL_STATICLIB +-libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB ++libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB -DNGHTTP2_STATICLIB ++libcurl_la_CFLAGS_EXTRA += -DNGHTTP2_STATICLIB + else + if OS_WINDOWS + libcurl_la_SOURCES += $(LIB_RCFILES) +@@ -124,9 +125,9 @@ + libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) + libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) + +-libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS ++libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DNGHTTP2_STATICLIB -DUNITTESTS + libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) +-libcurlu_la_CFLAGS = $(AM_CFLAGS) ++libcurlu_la_CFLAGS = $(AM_CFLAGS) -DNGHTTP2_STATICLIB + + CHECKSRC = $(CS_$(V)) + CS_0 = @echo " RUN " $@; diff --git a/0003-libpsl-static-libs.patch b/0003-libpsl-static-libs.patch new file mode 100644 index 000000000000..ce33b87eedb5 --- /dev/null +++ b/0003-libpsl-static-libs.patch @@ -0,0 +1,41 @@ +--- curl-7.64.1.orig/configure.ac 2019-03-29 18:14:22.692813700 -0400 ++++ curl-7.64.1/configure.ac 2019-03-29 18:52:44.514352300 -0400 +@@ -2747,14 +2747,30 @@ + with_libpsl=$withval, + with_libpsl=yes) + if test $with_libpsl != "no"; then +- AC_SEARCH_LIBS(psl_builtin, psl, +- [curl_psl_msg="enabled"; +- AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled]) +- ], +- [curl_psl_msg="no (libpsl not found)"; +- AC_MSG_WARN([libpsl was not found]) +- ] +- ) ++ CURL_CHECK_PKGCONFIG(libpsl) ++ if test "$PKGCONFIG" != "no" ; then ++ LIB_PSL=`$PKGCONFIG --libs-only-l libpsl` ++ LD_PSL=`$PKGCONFIG --libs-only-L libpsl` ++ CPP_PSL=`$PKGCONFIG --cflags-only-I libpsl` ++ version=`$PKGCONFIG --modversion libpsl` ++ DIR_PSL=`echo $LD_PSL | $SED -e 's/-L//'` ++ ++ AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled]) ++ LDFLAGS="$LDFLAGS $LD_PSL" ++ CPPFLAGS="$CPPFLAGS $CPP_PSL" ++ LIBS="$LIB_PSL $LIBS" ++ else ++ dnl no nghttp2 pkg-config found, deal with it ++ AC_SEARCH_LIBS(psl_builtin, psl, ++ [curl_psl_msg="enabled"; ++ AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled]) ++ ], ++ [curl_psl_msg="no (libpsl not found)"; ++ AC_MSG_WARN([libpsl was not found]) ++ ] ++ ) ++ fi ++ + fi + AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"]) + diff --git a/0004-more-static-fixes.patch b/0004-more-static-fixes.patch new file mode 100644 index 000000000000..09e41931194a --- /dev/null +++ b/0004-more-static-fixes.patch @@ -0,0 +1,24 @@ +diff -urN curl-7.84.0/libcurl.pc.in.orig curl-7.84.0/libcurl.pc.in +--- curl-7.84.0/libcurl.pc.in.orig 2022-06-22 11:49:29.000000000 +0200 ++++ curl-7.84.0/libcurl.pc.in 2022-06-30 18:10:26.835823300 +0200 +@@ -36,6 +36,8 @@ + URL: https://curl.se/ + Description: Library to transfer files with ftp, http, etc. + Version: @CURLVERSION@ ++Requires.private: libidn2 libbrotlidec + Libs: -L${libdir} -lcurl @LIBCURL_NO_SHARED@ + Libs.private: @LIBCURL_LIBS@ + Cflags: -I${includedir} @CPPFLAG_CURL_STATICLIB@ ++Cflags.private: -DCURL_STATICLIB +diff -urN curl-7.84.0/configure.ac.orig curl-7.84.0/configure.ac +--- curl-7.84.0/configure.ac.orig 2022-06-30 18:13:08.954675200 +0200 ++++ curl-7.84.0/configure.ac 2022-06-30 18:18:29.024823500 +0200 +@@ -1914,7 +1914,7 @@ + + dnl link required libraries for USE_WIN32_CRYPTO or USE_SCHANNEL + if test "x$USE_WIN32_CRYPTO" = "x1" -o "x$USE_SCHANNEL" = "x1"; then +- LIBS="-ladvapi32 -lcrypt32 $LIBS" ++ LIBS="-ladvapi32 -lcrypt32 -lbcrypt $LIBS" + fi + + case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$BEARSSL_ENABLED$AMISSL_ENABLED$RUSTLS_ENABLED" diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0fb526749782 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,74 @@ +# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com> +# Contributor: drakkan <nicola.murino at gmail dot com> +# Contributor: Andrew Sun <adsun701 at gmail dot com> +# Contributor: ant32 <antreimer at gmail dot com> + +_android_arch=x86 + +pkgname=android-${_android_arch}-curl +pkgver=8.5.0 +pkgrel=1 +arch=('any') +pkgdesc="An URL retrival utility and library (android)" +url="https://curl.haxx.se" +license=("MIT") +depends=("android-${_android_arch}-brotli" + "android-${_android_arch}-libidn2" + "android-${_android_arch}-libnghttp2" + "android-${_android_arch}-libnghttp3" + "android-${_android_arch}-libpsl" + "android-${_android_arch}-libssh2" + "android-${_android_arch}-openssl" + "android-${_android_arch}-zstd" + "android-${_android_arch}-zlib") +makedepends=('android-configure') +options=(!strip !buildflags staticlibs !emptydirs) +source=("${url}/download/curl-${pkgver}.tar.bz2" + "0002-nghttp2-static.patch" + "0003-libpsl-static-libs.patch" + "0004-more-static-fixes.patch") +sha256sums=('ce4b6a6655431147624aaf582632a36fe1ade262d5fab385c60f78942dd8d87b' + '3ee9c75a3046f86f91290c143170179230c9adc6eabfbb79eb26f708a165b719' + '7492d019036b5bec251bfbc3c0b40e5f16d3dd6b2515068835e087a6c21f19ad' + '590eb65e90e756eaad993d52a101f29091ada2c742c5a607684e88fc5c560d54') + +prepare() { + cd "${srcdir}/curl-${pkgver}" + source android-env ${_android_arch} + + patch -Np1 -i ../0002-nghttp2-static.patch + patch -Np1 -i ../0003-libpsl-static-libs.patch + patch -Np1 -i ../0004-more-static-fixes.patch + + autoreconf -vfi +} + +build() { + cd "${srcdir}/curl-${pkgver}" + source android-env ${_android_arch} + + android-${_android_arch}-configure \ + --enable-static \ + --enable-shared \ + --with-openssl \ + --enable-ipv6 \ + --with-libidn2 \ + --with-libssh2 \ + --without-ca-bundle \ + --without-random \ + --with-libpsl \ + --with-brotli \ + --with-zstd + make $MAKEFLAGS +} + +package() { + cd "${srcdir}/curl-${pkgver}" + source android-env ${_android_arch} + + make DESTDIR="$pkgdir" install + rm -r "${pkgdir}/${ANDROID_PREFIX_BIN}/curl" + rm -rf "${pkgdir}/${ANDROID_PREFIX_SHARE}" + ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so + ${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_PREFIX_LIB}/*.a +} |