2019-09-09 22:45:40 +02:00
|
|
|
# $Id$
|
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
|
|
|
|
_pkg_arch=x86
|
|
|
|
_android_arch=x86
|
|
|
|
_android_platform_arch=arch-x86
|
|
|
|
_pkgname=openssl
|
2021-01-05 02:23:27 +01:00
|
|
|
_ver=1.1.1i
|
2021-02-01 05:36:49 +01:00
|
|
|
_patchname=15-android_conf
|
2019-09-09 22:45:40 +02:00
|
|
|
|
|
|
|
pkgname=android-$_pkg_arch-$_pkgname
|
|
|
|
# use a pacman compatible version scheme
|
|
|
|
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
|
2021-02-01 05:36:49 +01:00
|
|
|
pkgrel=2
|
2019-09-09 22:45:40 +02:00
|
|
|
pkgdesc="The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (Android, $_pkg_arch)"
|
|
|
|
arch=('any')
|
|
|
|
url='https://www.openssl.org'
|
|
|
|
license=('custom:BSD')
|
|
|
|
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
|
|
|
|
depends=('android-sdk' 'android-ndk')
|
2019-09-14 20:14:27 +02:00
|
|
|
makedepends=('android-environment' 'android-sdk-build-tools')
|
2019-09-09 22:45:40 +02:00
|
|
|
conflicts=("android-$_pkgname-$_android_arch")
|
|
|
|
replaces=("android-$_pkgname-$_android_arch")
|
2021-02-01 05:36:49 +01:00
|
|
|
source=("https://www.openssl.org/source/${_pkgname}-${_ver}.tar.gz"{,.asc}
|
|
|
|
"${_patchname}.patch")
|
2021-01-05 02:23:27 +01:00
|
|
|
sha256sums=('e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242'
|
2021-02-01 05:36:49 +01:00
|
|
|
'SKIP'
|
|
|
|
'8ed3b78e8d6e5766595ae5ad6503cf0d21de4300d90aae556c7786f07ed9fdfb')
|
2019-09-09 22:45:40 +02:00
|
|
|
validpgpkeys=('8657ABB260F056B1E5190839D9C4D26D0E604491'
|
|
|
|
'7953AC1FBC3DC8B3B292393ED5E9E43F7DF9EE8C')
|
|
|
|
|
|
|
|
build() {
|
2021-02-01 05:36:49 +01:00
|
|
|
cd "${srcdir}/${_pkgname}-${_ver}"
|
2019-09-14 20:14:27 +02:00
|
|
|
source android-env ${_pkg_arch}
|
2021-02-01 05:36:49 +01:00
|
|
|
export PATH="${ANDROID_TOOLCHAIN}/bin:${PATH}"
|
|
|
|
|
|
|
|
# Configure configuration script for android that shipped with openssl
|
|
|
|
# 1.1.1i does not account for the removal of the $ndk/platforms directory in
|
|
|
|
# android-ndk r22.
|
|
|
|
patch -Np1 < "${srcdir}/${_patchname}.patch"
|
2019-09-09 22:45:40 +02:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
# don't use -mandroid flag (Clang as provided by the NDK does not like it)
|
|
|
|
sed -i -e 's/-mandroid//' Configurations/15-android.conf
|
2019-09-09 22:45:40 +02:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
./Configure \
|
|
|
|
--prefix="${ANDROID_PREFIX}" \
|
|
|
|
--openssldir="${ANDROID_PREFIX}" \
|
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:36:49 +01:00
|
|
|
no-ui-console \
|
2019-09-14 20:14:27 +02:00
|
|
|
threads \
|
|
|
|
shared \
|
|
|
|
android-${_android_platform_arch##arch-}
|
2019-09-09 22:45:40 +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
|
2019-09-09 22:45:40 +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
|
2020-01-18 11:47:26 +01:00
|
|
|
make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" SHLIB_VERSION_NUMBER= SHLIB_EXT=_1_1.so build_libs
|
2019-09-09 22:45:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2019-09-14 20:14:27 +02:00
|
|
|
cd "$srcdir/$_pkgname-$_ver"
|
|
|
|
source android-env ${_pkg_arch}
|
|
|
|
export PATH="$ANDROID_TOOLCHAIN:$PATH"
|
2019-09-09 22:45:40 +02:00
|
|
|
|
2019-09-14 20:14:27 +02:00
|
|
|
# install header files, libraries and license
|
2020-01-18 11:47:26 +01:00
|
|
|
for lib in libcrypto{.a,_1_1.so} libssl{.a,_1_1.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}"
|
|
|
|
install -D -m644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
|
2019-09-09 22:45:40 +02:00
|
|
|
|
2020-01-18 12:04:21 +01:00
|
|
|
# add symlinks for dynamic libs with SHLIB_EXT so build scripts can find them under their usual names
|
|
|
|
for lib in libcrypto libssl; do
|
|
|
|
ln -s "${lib}_1_1.so" "${pkgdir}/${ANDROID_PREFIX_LIB}/${lib}.so"
|
|
|
|
done
|
|
|
|
|
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 {} \;
|
2019-09-09 22:45:40 +02:00
|
|
|
}
|