2018-07-04 23:57:29 +02:00
|
|
|
# $Id$
|
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
|
2018-12-11 20:34:54 +01:00
|
|
|
_pkg_arch=armv7a-eabi
|
2018-12-29 20:08:48 +01:00
|
|
|
_android_arch=armeabi-v7a
|
|
|
|
_android_platform_arch=arch-arm
|
2018-12-11 20:34:54 +01:00
|
|
|
_pkgname=openssl
|
2024-02-03 16:53:57 +01:00
|
|
|
_pkgver=3.2.1
|
2018-07-04 23:57:29 +02:00
|
|
|
|
2018-12-11 20:34:54 +01:00
|
|
|
pkgname=android-$_pkg_arch-$_pkgname
|
2018-07-04 23:57:29 +02:00
|
|
|
# use a pacman compatible version scheme
|
2022-12-03 17:08:41 +01:00
|
|
|
pkgver=${_pkgver/[a-z]/.${_pkgver//[0-9.]/}}
|
2022-06-06 23:12:21 +02:00
|
|
|
pkgrel=1
|
2018-12-11 20:34:54 +01:00
|
|
|
pkgdesc="The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (Android, $_pkg_arch)"
|
2018-07-04 23:57:29 +02:00
|
|
|
arch=('any')
|
|
|
|
url='https://www.openssl.org'
|
2024-02-03 16:53:57 +01:00
|
|
|
license=('Apache-2.0')
|
2018-07-04 23:57:29 +02:00
|
|
|
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
|
2018-12-11 20:34:54 +01:00
|
|
|
depends=('android-sdk' 'android-ndk')
|
2019-09-14 20:14:27 +02:00
|
|
|
makedepends=('android-environment' 'android-sdk-build-tools')
|
2018-12-11 20:34:54 +01:00
|
|
|
conflicts=("android-$_pkgname-$_android_arch")
|
|
|
|
replaces=("android-$_pkgname-$_android_arch")
|
2022-12-03 17:08:41 +01:00
|
|
|
source=("https://www.openssl.org/source/openssl-${_pkgver}.tar.gz"{,.asc})
|
2024-02-03 16:53:57 +01:00
|
|
|
sha256sums=('83c7329fe52c850677d75e5d0b0ca245309b97e8ecbcfdc1dfdc4ab9fac35b39'
|
2022-06-06 23:12:21 +02:00
|
|
|
'SKIP')
|
2019-05-29 12:19:54 +02:00
|
|
|
validpgpkeys=('8657ABB260F056B1E5190839D9C4D26D0E604491'
|
2022-12-03 17:08:41 +01:00
|
|
|
'7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C'
|
2023-08-02 12:52:43 +02:00
|
|
|
'A21FAB74B0088AA361152586B8EF1A6BA9DA2D5C'
|
|
|
|
'EFC0A467D613CB83C7ED6D30D894E2CE8B3D79F5')
|
2018-07-04 23:57:29 +02:00
|
|
|
|
|
|
|
build() {
|
2022-12-03 17:08:41 +01:00
|
|
|
cd "${srcdir}/${_pkgname}-${_pkgver}"
|
2019-09-14 20:14:27 +02:00
|
|
|
source android-env ${_pkg_arch}
|
2021-02-01 05:34:54 +01:00
|
|
|
export PATH="${ANDROID_TOOLCHAIN}/bin:${PATH}"
|
2022-12-03 17:08:41 +01:00
|
|
|
export LIBDIR=lib
|
2021-02-01 05:34:54 +01:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
./Configure \
|
|
|
|
--prefix="${ANDROID_PREFIX}" \
|
|
|
|
--openssldir="${ANDROID_PREFIX}" \
|
2022-06-06 23:12:21 +02:00
|
|
|
-U__ANDROID_API__ \
|
2020-01-18 11:47:26 +01:00
|
|
|
-D__ANDROID_API__="${ANDROID_MINIMUM_PLATFORM}" \
|
2019-09-14 20:14:27 +02:00
|
|
|
-Wl,--no-allow-shlib-undefined \
|
|
|
|
-Wl,--no-undefined \
|
|
|
|
no-stdio \
|
2021-02-01 05:34:54 +01:00
|
|
|
no-ui-console \
|
2019-09-14 20:14:27 +02:00
|
|
|
threads \
|
|
|
|
shared \
|
|
|
|
android-${_android_platform_arch##arch-}
|
2018-07-13 14:58:52 +02:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
# get rid of debug printing so the library doesn't depend on stdio (no-stdio and no-ui are not entirely sufficient)
|
|
|
|
sed -i -e 's/\#define TEST_ENG_OPENSSL_RC4_P_INIT//' crypto/engine/eng_openssl.c
|
2018-07-04 23:57:29 +02:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
# build only libraries
|
2020-01-18 11:47:26 +01:00
|
|
|
# note: Setting SHLIB_EXT in accordance with qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp to avoid loading
|
|
|
|
# system library.
|
2019-09-14 20:14:27 +02:00
|
|
|
make depend
|
2022-12-03 17:08:41 +01:00
|
|
|
make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" SHLIB_VERSION_NUMBER= SHLIB_EXT=.so build_libs
|
2018-07-04 23:57:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2022-12-03 17:08:41 +01:00
|
|
|
cd "$srcdir/$_pkgname-$_pkgver"
|
2019-09-14 20:14:27 +02:00
|
|
|
source android-env ${_pkg_arch}
|
|
|
|
export PATH="$ANDROID_TOOLCHAIN:$PATH"
|
2022-12-03 17:08:41 +01:00
|
|
|
export LIBDIR=lib
|
2018-07-04 23:57:29 +02:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
# install header files, libraries and license
|
2022-12-03 17:08:41 +01:00
|
|
|
for lib in libcrypto{.a,.so} libssl{.a,.so}; do
|
2019-09-14 20:14:27 +02:00
|
|
|
install -D -m0644 $lib "$pkgdir/${ANDROID_PREFIX_LIB}/$lib"
|
|
|
|
done
|
|
|
|
for pc in libcrypto.pc libssl.pc openssl.pc; do
|
|
|
|
install -D -m0644 $pc "$pkgdir/${ANDROID_PREFIX_LIB}/pkgconfig/$pc"
|
|
|
|
done
|
|
|
|
mkdir -p "$pkgdir/${ANDROID_PREFIX_INCLUDE}"
|
|
|
|
cp -r include/openssl "$pkgdir/${ANDROID_PREFIX_INCLUDE}"
|
2020-01-18 12:04:21 +01:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
# strip binaries
|
|
|
|
find "$pkgdir" -name 'lib*.so' -type f -exec "$ANDROID_STRIP" --strip-unneeded {} \;
|
|
|
|
find "$pkgdir" -name 'lib*.a' -type f -exec "$ANDROID_STRIP" -g {} \;
|
2018-07-04 23:57:29 +02:00
|
|
|
}
|