Sync OpenSSL package for Android
This commit is contained in:
parent
b2d7e19df7
commit
2d951070bd
|
@ -1,22 +1,23 @@
|
|||
# $Id$
|
||||
# Maintainer: Martchus <martchus@gmx.net>
|
||||
|
||||
# export Android configuration
|
||||
export ANDROID_MINIMUM_PLATFORM=22 # https://developer.android.com/about/dashboards/
|
||||
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/android-ndk}
|
||||
export ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-/opt/android-sdk}
|
||||
export ANDROID_EABI=aarch64-linux-android-4.9
|
||||
export ANDROID_ARCH=arch-arm64
|
||||
|
||||
_android_arch=arm64-v8a
|
||||
_pkg_arch=aarch64
|
||||
_android_arch=arch-arm64
|
||||
_android_toolchain=$_pkg_arch-linux-android
|
||||
_android_platform=22
|
||||
_android_platform_dir=android-$_android_platform/arch-arm64
|
||||
_android_platform=22 # https://developer.android.com/about/dashboards/
|
||||
_android_platform_dir=android-$_android_platform/$_android_arch
|
||||
_pkgname=openssl
|
||||
_ver=1.1.1a
|
||||
_pref=/opt/android-libs/$_pkg_arch
|
||||
|
||||
# export Android configuration
|
||||
export ANDROID_MINIMUM_PLATFORM=$_android_platform
|
||||
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/android-ndk}
|
||||
export ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-/opt/android-sdk}
|
||||
export ANDROID_EABI=$_android_toolchain-4.9
|
||||
export ANDROID_ARCH=$_android_arch
|
||||
|
||||
pkgname=android-$_pkg_arch-$_pkgname
|
||||
# use a pacman compatible version scheme
|
||||
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
|
||||
|
|
|
@ -1,43 +1,56 @@
|
|||
# $Id$
|
||||
# Maintainer: Martchus <martchus@gmx.net>
|
||||
|
||||
_android_arch=arch-arm
|
||||
_pkg_arch=armv7a-eabi
|
||||
_android_arch=arch-arm
|
||||
_android_toolchain=$_pkg_arch-linux-android
|
||||
_android_platform=21
|
||||
_android_platform_dir=android-$_android_platform/$_android_arch
|
||||
_pkgname=openssl
|
||||
_ver=1.1.1a
|
||||
_pref=/opt/android-libs/$_pkg_arch
|
||||
|
||||
# export Android configuration
|
||||
export ANDROID_MINIMUM_PLATFORM=21 # https://developer.android.com/about/dashboards/
|
||||
export ANDROID_MINIMUM_PLATFORM=$_android_platform
|
||||
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/android-ndk}
|
||||
export ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-/opt/android-sdk}
|
||||
export ANDROID_EABI=
|
||||
export ANDROID_ARCH=
|
||||
export ANDROID_EABI=$_android_toolchain-4.9
|
||||
export ANDROID_ARCH=$_android_arch
|
||||
|
||||
_android_arch=armeabi-v7a
|
||||
_pkgname=openssl
|
||||
_ver=1.1.0h
|
||||
_pref=/opt/android-libs/$_android_arch
|
||||
|
||||
pkgname=android-$_pkgname-$_android_arch
|
||||
pkgname=android-$_pkg_arch-$_pkgname
|
||||
# use a pacman compatible version scheme
|
||||
pkgver=${_ver/[a-z]/.${_ver//[0-9.]/}}
|
||||
pkgrel=2
|
||||
pkgdesc="The Open Source toolkit for Secure Sockets Layer and Transport Layer Security (Android, $_android_arch)"
|
||||
pkgrel=1
|
||||
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=('perl' 'android-sdk' 'android-ndk')
|
||||
depends=('android-sdk' 'android-ndk')
|
||||
conflicts=("android-$_pkgname-$_android_arch")
|
||||
replaces=("android-$_pkgname-$_android_arch")
|
||||
source=("https://www.openssl.org/source/${_pkgname}-${_ver}.tar.gz"
|
||||
"https://www.openssl.org/source/${_pkgname}-${_ver}.tar.gz.asc"
|
||||
'setenv-android.sh')
|
||||
sha256sums=('5835626cde9e99656585fc7aaa2302a73a7e1340bf8c14fd635a62c66802a517'
|
||||
sha256sums=('fc20130f8b7cbd2fb918b2f14e2f429e109c31ddd0fb38fc5d71d9ffed3f9f41'
|
||||
'SKIP'
|
||||
'618eba24998f973487b9ebc556dd48d6828932f51f69ae75cb9da6c65c92b00a')
|
||||
'0938c8d68110768db4f350a7ec641070686904f2fe7ba630ac94399d7dc8cc5e')
|
||||
validpgpkeys=('8657ABB260F056B1E5190839D9C4D26D0E604491')
|
||||
|
||||
build() {
|
||||
cd "$srcdir/$_pkgname-$_ver"
|
||||
|
||||
# don't use -mandroid flag (Clang as provided by the NDK does not like it)
|
||||
sed -i -e 's/-mandroid//' Configurations/15-android.conf
|
||||
|
||||
source "$srcdir/setenv-android.sh"
|
||||
|
||||
./Configure \
|
||||
--prefix="$_pref" \
|
||||
--openssldir="$_pref" \
|
||||
--gcc-toolchain=$ANDROID_NDK_ROOT/toolchains/$_android_toolchain-4.9/prebuilt/linux-x86_64 \
|
||||
--sysroot=$ANDROID_NDK_ROOT/platforms/$_android_platform_dir/usr \
|
||||
-isystem"$ANDROID_NDK_ROOT/sysroot/usr/include" \
|
||||
-isystem"$ANDROID_NDK_ROOT/sysroot/usr/include/${_ANDROID_EABI%-*}" \
|
||||
-Wl,--no-allow-shlib-undefined \
|
||||
|
@ -46,10 +59,11 @@ build() {
|
|||
no-ui \
|
||||
threads \
|
||||
shared \
|
||||
android
|
||||
|
||||
android-${ANDROID_ARCH##arch-}
|
||||
|
||||
# ensure the libraries are not versioned (setting CALC_VERSIONS doesn't work for some reason)
|
||||
sed -i -e 's/\.\$(SHLIB_MAJOR)\.\$(SHLIB_MINOR)//g' Makefile
|
||||
sed -i -e 's/\.\$(SHLIB_VERSION_NUMBER)//g' Makefile
|
||||
|
||||
# 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
|
||||
|
@ -71,7 +85,7 @@ package() {
|
|||
install -D -m644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
|
||||
|
||||
# strip binaries
|
||||
local strip_path=$ANDROID_TOOLCHAIN/${CROSS_COMPILE}strip
|
||||
local strip_path=$ANDROID_TOOLCHAIN/${CROSS_COMPILE}strip
|
||||
find "$pkgdir" -name 'lib*.so' -type f -exec "$strip_path" --strip-unneeded {} \;
|
||||
find "$pkgdir" -name 'lib*.a' -type f -exec "$strip_path" -g {} \;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Syncs the different variants of android-openssl
|
||||
|
||||
set -e # abort on first error
|
||||
master="${1:-android-arm64-v8a}"
|
||||
master="${1:-android-aarch64}"
|
||||
|
||||
[[ -d 'openssl' ]] && pushd 'openssl' || pushd .
|
||||
|
||||
|
@ -24,10 +24,10 @@ for dir in android-*; do
|
|||
source "$dir/PKGBUILD"
|
||||
rm "$dir/"* # clean first (files might have been removed in master)
|
||||
cp "$master/"* "$dir"
|
||||
sed -e "s/pkgname=android-openssl-.*/pkgname=android-openssl${dir#android}/" \
|
||||
-e "s/ANDROID_EABI=.*/ANDROID_EABI=$ANDROID_EABI/" \
|
||||
-e "s/ANDROID_ARCH=.*/ANDROID_ARCH=$ANDROID_ARCH/" \
|
||||
sed -e "s/pkgname=android-.*-openssl/pkgname=$dir-openssl/" \
|
||||
-e "s/_android_arch=.*/_android_arch=$_android_arch/" \
|
||||
-e "s/_pkg_arch=.*/_pkg_arch=$_pkg_arch/" \
|
||||
-e "s/_android_platform=.*/_android_platform=$_android_platform/" \
|
||||
"$master/PKGBUILD" > "$dir/PKGBUILD"
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue