To * workaround bug in CMake 3.13.3 * stay compatible with future CMake releases
87 lines
3.3 KiB
Bash
87 lines
3.3 KiB
Bash
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
# you also find the URL of a binary repository.
|
|
|
|
_reponame=passwordmanager
|
|
_pkgname=passwordmanager
|
|
_android_arch=arm64-v8a
|
|
_pkg_arch=aarch64
|
|
_android_toolchain=$_pkg_arch-linux-android
|
|
_android_platform=22
|
|
_prefix=/opt/android-libs/$_pkg_arch
|
|
|
|
pkgname=android-$_pkg_arch-$_pkgname
|
|
pkgver=4.0.1
|
|
pkgrel=1
|
|
arch=('any')
|
|
pkgdesc="A simple password store using AES-256-CBC encryption via OpenSSL (Android, $_pkg_arch)"
|
|
license=('GPL')
|
|
depends=("android-$_pkg_arch-passwordfile" "android-$_pkg_arch-qtutilities" "android-$_pkg_arch-kirigami2")
|
|
makedepends=('cmake' 'android-ndk' 'android-sdk' 'extra-cmake-modules' 'jdk8-openjdk')
|
|
conflicts=("android-$_pkgname-$_android_arch")
|
|
replaces=("android-$_pkgname-$_android_arch")
|
|
url="https://github.com/Martchus/${_reponame}"
|
|
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz")
|
|
sha256sums=('89f10b004c4a2dcbce13f0b24bd9acda3a6ea52d165ef178b42e76fcd3c58079')
|
|
options=(!buildflags staticlibs !strip !emptydirs)
|
|
|
|
prepare() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
|
|
|
local android_sdk_path=${ANDROID_SDK_ROOT:-/opt/android-sdk}
|
|
local android_ndk_path=${ANDROID_NDK_ROOT:-/opt/android-ndk}
|
|
local build_tools_version=$(pacman -Q android-sdk-build-tools | sed 's/.* r\(.*\)-.*/\1/')
|
|
local root="$android_ndk_root/sysroot;$_prefix"
|
|
|
|
mkdir home
|
|
export HOME=$PWD/home
|
|
|
|
archlinux-java set java-8-openjdk/jre
|
|
yes | sdkmanager --licenses
|
|
|
|
cmake \
|
|
-DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \
|
|
-DCMAKE_SYSTEM_NAME=Android \
|
|
-DCMAKE_SYSTEM_VERSION=$_android_platform \
|
|
-DCMAKE_ANDROID_ARCH_ABI=$_android_arch \
|
|
-DCMAKE_ANDROID_SDK="$android_sdk_path" \
|
|
-DCMAKE_ANDROID_NDK="$android_ndk_path" \
|
|
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX=$_prefix \
|
|
-DCMAKE_PREFIX_PATH="$root" \
|
|
-DCMAKE_FIND_ROOT_PATH="$root" \
|
|
-DNO_DOXYGEN=ON \
|
|
-DWIDGETS_GUI=OFF \
|
|
-DQUICK_GUI=ON \
|
|
-DQt5Core_DIR="$_prefix/lib/cmake/Qt5Core" \
|
|
-DANDROID_API_LEVEL=$_android_platform \
|
|
-DANDROID_ABI=$_android_arch \
|
|
-DANDROID_ARCHITECTURE=${_android_arch%-*} \
|
|
-DANDROID_SDK_ROOT="$android_sdk_root" \
|
|
-DANDROID_SDK_BUILD_TOOLS_REVISION="$build_tools_version" \
|
|
-DECM_ADDITIONAL_FIND_ROOT_PATH="$root;$android_ndk_root/platforms/android-$_android_platform/arch-${_android_arch%-*};$android_ndk_root/sources/cxx-stl/gnu-libstdc++/4.9/libs/$_android_arch" \
|
|
-DQTANDROID_EXPORTED_TARGET=$_pkgname \
|
|
-DANDROID_APK_DIR=android \
|
|
-DANDROID_EXTRA_LIBS="$_prefix/lib/libcrypto.so;$_prefix/lib/libssl.so;$_prefix/lib/libiconv.so;$_prefix/lib/libKF5Kirigami2.so" \
|
|
.
|
|
|
|
#-DCMAKE_EXE_LINKER_FLAGS="-fPIE;-pie;-Wl,--gc-sections;-Wl,-rpath-link=/opt/android-libs/$_android_arch/lib;/opt/android-qt5/$qt_version/$_android_arch/lib:/opt/android-libs/$_android_arch/lib" \
|
|
|
|
make VERBOSE=1
|
|
make DESTDIR="${pkgdir}" create-apk
|
|
}
|
|
|
|
package() {
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
|
|
|
local api_dir=${pkgdir}/opt/android-libs/apk
|
|
mkdir -p "$apk_dir"
|
|
cp --target-directory="$apk_dir" "${_pkgname}_build_apk/build/outputs/apk/*.apk"
|
|
}
|