2018-07-11 10:58:40 +02:00
|
|
|
# PKGCONFIG for android-qt5
|
2018-11-24 02:41:08 +01:00
|
|
|
# Maintainer in the AUR: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
|
2018-07-11 10:58:40 +02:00
|
|
|
# Contributor: Jiaxi Hu <sftrytry _AT_ gmail _DOT_ com>
|
|
|
|
# Contributor: jimmy00784 <jimmy00784@gmail.com>
|
|
|
|
# Contributor: Ricardo (XenGi) Band <email@ricardo.band>
|
|
|
|
# Contributor: Martchus <martchus@gmx.net>
|
|
|
|
|
|
|
|
# Useful link to keep track of latest API changes:
|
|
|
|
# https://developer.android.com/ndk/downloads/revision_history
|
|
|
|
|
2018-11-24 02:41:08 +01:00
|
|
|
_android_arch=arm64-v8a
|
|
|
|
_pkg_arch=aarch64
|
2018-07-11 10:58:40 +02:00
|
|
|
|
|
|
|
# Minimum Android platform based on:
|
|
|
|
# https://developer.android.com/about/dashboards/
|
2018-11-24 02:41:08 +01:00
|
|
|
export ANDROID_MINIMUM_PLATFORM=${ANDROID_MINIMUM_PLATFORM:-22}
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/android-ndk}
|
|
|
|
export ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-/opt/android-sdk}
|
|
|
|
|
2018-11-24 02:41:08 +01:00
|
|
|
_pkgname=
|
|
|
|
pkgname=android-$_pkg_arch-qt5
|
2018-12-08 22:06:32 +01:00
|
|
|
pkgver=5.12.0
|
|
|
|
pkgrel=1
|
2018-07-11 10:58:40 +02:00
|
|
|
pkgdesc="Qt 5 for Android"
|
|
|
|
arch=('x86_64')
|
|
|
|
url='https://www.qt.io'
|
|
|
|
license=('GPL3' 'LGPL')
|
|
|
|
makedepends=('libgl'
|
|
|
|
'sqlite'
|
|
|
|
'zlib'
|
|
|
|
'python2'
|
|
|
|
'python' # Qt Qml requires Python 3
|
|
|
|
'ruby'
|
|
|
|
'gperf'
|
|
|
|
'libxslt'
|
|
|
|
'fontconfig'
|
2018-11-24 02:41:08 +01:00
|
|
|
"android-$_pkg_arch-openssl")
|
2018-07-11 10:58:40 +02:00
|
|
|
depends=('java-runtime-headless>=7'
|
|
|
|
'apache-ant'
|
|
|
|
'android-ndk'
|
|
|
|
"android-platform-$ANDROID_MINIMUM_PLATFORM"
|
|
|
|
'android-sdk'
|
|
|
|
'android-sdk-build-tools'
|
|
|
|
'android-sdk-platform-tools')
|
|
|
|
groups=('android-qt5')
|
2018-12-08 22:06:32 +01:00
|
|
|
conflicts=("android-qt5-${_android_arch}")
|
|
|
|
replaces=("android-qt5-${_android_arch}")
|
2018-11-24 02:41:08 +01:00
|
|
|
|
|
|
|
case "$_pkg_arch" in
|
|
|
|
aarch64)
|
|
|
|
optdepends=('android-google-apis-aarch64: AVD support'
|
|
|
|
'android-aarch64-system-image: AVD support')
|
|
|
|
;;
|
|
|
|
armv7a-eabi)
|
|
|
|
optdepends=('android-google-apis-armv7a-eabi: AVD support'
|
|
|
|
'android-armv7a-eabi-system-image: AVD support')
|
|
|
|
;;
|
|
|
|
x86)
|
|
|
|
optdepends=('android-google-apis-x86: AVD support'
|
|
|
|
'android-x86-system-image: AVD support')
|
|
|
|
;;
|
|
|
|
x86-64)
|
|
|
|
optdepends=('android-google-apis-x86-64: AVD support'
|
|
|
|
'android-x86-64-system-image: AVD support')
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
optdepends+=("android-$_pkg_arch-openssl: SSL support for Qt Network")
|
2018-07-11 10:58:40 +02:00
|
|
|
|
|
|
|
options=('!strip'
|
|
|
|
'!buildflags'
|
|
|
|
'staticlibs'
|
|
|
|
'!emptydirs')
|
|
|
|
_pkgfqn="qt-everywhere-src-${pkgver}"
|
2018-10-07 22:26:11 +02:00
|
|
|
source=("http://download.qt-project.org/official_releases/qt/${pkgver:0:4}/${pkgver}/single/${_pkgfqn}.tar.xz"
|
2018-12-08 22:06:32 +01:00
|
|
|
'0001-Fix-clang-libc-build-under-Android.patch'
|
|
|
|
'0002-Fix-androiddeployqt-search-paths.patch'
|
|
|
|
'0001-Disable-mapboxgl.patch')
|
|
|
|
sha256sums=('356f42d9087718f22f03d13d0c2cdfb308f91dc3cf0c6318bed33f2094cd9d6c'
|
|
|
|
'8a32e92dbaab5a371467903c89781a4e27f8c2403fe47b9a0ef0dca65c80be41'
|
|
|
|
'cfb3de9c62ed6956bb1fe9f7d13384de236e87ff949aa6a4bb8257078729c9e0'
|
|
|
|
'2ef1ddd8f84474b2dbe06c5e1a2db80a96ebd8cf529f1e1ce465fb6d406e366f')
|
2018-11-24 02:41:08 +01:00
|
|
|
|
|
|
|
_pref=/opt/android-libs/$_pkg_arch
|
2018-07-11 10:58:40 +02:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd ${_pkgfqn}
|
|
|
|
|
2018-12-08 22:06:32 +01:00
|
|
|
pushd qtbase
|
|
|
|
patch -Np1 -i "../../0001-Fix-clang-libc-build-under-Android.patch"
|
|
|
|
patch -Np1 -i "../../0002-Fix-androiddeployqt-search-paths.patch"
|
|
|
|
popd
|
2018-11-24 02:41:08 +01:00
|
|
|
|
2018-12-08 22:06:32 +01:00
|
|
|
pushd qtlocation
|
2018-11-24 02:41:08 +01:00
|
|
|
# skip building mapboxgl as it increases compile time significantly and
|
|
|
|
# likely not a lot of people actually using it; if you need it, just remove the
|
|
|
|
# following line:
|
2018-12-08 22:06:32 +01:00
|
|
|
patch -Np1 -i "../../0001-Disable-mapboxgl.patch"
|
|
|
|
popd
|
2018-11-30 12:54:18 +01:00
|
|
|
|
|
|
|
sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/mkspecs/features/android/sdk.prf
|
|
|
|
sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/src/android/jar/jar.pro
|
|
|
|
sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtgamepad/src/plugins/gamepads/android/jar/jar.pro
|
|
|
|
sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri
|
2018-07-11 10:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
get_last() {
|
|
|
|
ls $1 | sort -V | tail -n 1
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd ${_pkgfqn}
|
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
unset CC CXX CFLAGS CXXFLAGS LDFLAGS CHOST QMAKESPEC QTDIR CARCH
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
export ANDROID_BUILD_TOOLS_REVISION=${ANDROID_BUILD_TOOLS_REVISION:-$(get_last ${ANDROID_SDK_ROOT}/build-tools)}
|
|
|
|
export ANDROID_API_VERSION=${ANDROID_API_VERSION:-android-$ANDROID_MINIMUM_PLATFORM}
|
|
|
|
export ANDROID_NDK_PLATFORM=${ANDROID_NDK_PLATFORM:-android-$ANDROID_MINIMUM_PLATFORM}
|
2018-07-11 10:58:40 +02:00
|
|
|
export PYTHON=/usr/bin/python2
|
|
|
|
|
|
|
|
configue_opts="
|
|
|
|
-confirm-license
|
|
|
|
-opensource
|
|
|
|
-silent
|
2018-11-24 02:41:08 +01:00
|
|
|
-prefix ${_pref}
|
|
|
|
-archdatadir ${_pref}/lib/qt
|
|
|
|
-datadir ${_pref}/share/qt
|
|
|
|
-examplesdir ${_pref}/share/qt/examples
|
|
|
|
-testsdir ${_pref}/share/qt/tests
|
2018-10-07 22:26:11 +02:00
|
|
|
-xplatform android-clang
|
2018-07-11 10:58:40 +02:00
|
|
|
-nomake tests
|
|
|
|
-nomake examples
|
|
|
|
-android-ndk ${ANDROID_NDK_ROOT}
|
|
|
|
-android-sdk ${ANDROID_SDK_ROOT}
|
|
|
|
-android-ndk-host linux-x86_64
|
|
|
|
-android-toolchain-version 4.9
|
|
|
|
-skip qtserialport
|
|
|
|
-no-warnings-are-errors
|
|
|
|
-no-pkg-config
|
|
|
|
-qt-zlib
|
|
|
|
-qt-freetype
|
|
|
|
-openssl-runtime
|
2018-11-24 02:41:08 +01:00
|
|
|
-android-arch ${_android_arch}
|
2018-07-11 10:58:40 +02:00
|
|
|
-android-ndk-platform ${ANDROID_NDK_PLATFORM}
|
2018-11-24 02:41:08 +01:00
|
|
|
-I/opt/android-libs/$_pkg_arch/include"
|
|
|
|
|
|
|
|
[[ $ANDROID_DEBUG_BUILD ]] \
|
|
|
|
&& configue_opts+=' -debug-and-release' \
|
|
|
|
|| configue_opts+=' -release'
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
# add architecture specific options
|
2018-11-24 02:41:08 +01:00
|
|
|
case "$_pkg_arch" in
|
2018-07-11 10:58:40 +02:00
|
|
|
x86*)
|
|
|
|
configue_opts+="
|
|
|
|
-no-sql-mysql
|
|
|
|
-no-sql-psql"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
./configure ${configue_opts}
|
|
|
|
|
|
|
|
make $MAKEFLAGS
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd ${_pkgfqn}
|
|
|
|
|
|
|
|
make INSTALL_ROOT=${pkgdir} install
|
|
|
|
|
2018-11-24 02:41:08 +01:00
|
|
|
case "$_pkg_arch" in
|
|
|
|
aarch64)
|
2018-07-11 10:58:40 +02:00
|
|
|
toolchain=aarch64-linux-android-4.9
|
|
|
|
stripFolder=aarch64-linux-android
|
|
|
|
;;
|
2018-11-24 02:41:08 +01:00
|
|
|
armv7a-eabi)
|
2018-07-11 10:58:40 +02:00
|
|
|
toolchain=arm-linux-androideabi-4.9
|
|
|
|
stripFolder=arm-linux-androideabi
|
|
|
|
;;
|
|
|
|
x86)
|
|
|
|
toolchain=x86-4.9
|
|
|
|
stripFolder=i686-linux-android
|
|
|
|
;;
|
2018-11-24 02:41:08 +01:00
|
|
|
x86-64)
|
2018-07-11 10:58:40 +02:00
|
|
|
toolchain=x86_64-4.9
|
|
|
|
stripFolder=x86_64-linux-android
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
local STRIP=${ANDROID_NDK_ROOT}/toolchains/${toolchain}/prebuilt/linux-x86_64/${stripFolder}/bin/strip
|
2018-11-30 12:54:18 +01:00
|
|
|
find ${pkgdir}/${_pref}/bin -type f ! -name '*.pl' -exec strip {} \;
|
|
|
|
find ${pkgdir}/${_pref}/lib -type f -name 'lib*.so' -exec ${STRIP} {} \;
|
|
|
|
find ${pkgdir}/${_pref}/lib \( -type f -name 'lib*.a' ! -name 'libQt5Bootstrap.a' ! -name 'libQt5QmlDevTools.a' \) -exec ${STRIP} {} \;
|
|
|
|
find ${pkgdir}/${_pref}/lib/qt/plugins -type f -name 'lib*.so' -exec ${STRIP} {} \;
|
|
|
|
|
|
|
|
# fix plugin path in Android-specific dependency file
|
|
|
|
sed -i 's/\"plugins\//\"lib\/qt\/plugins\//g' ${pkgdir}/${_pref}/lib/*-android-dependencies.xml
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
# drop QMAKE_PRL_BUILD_DIR because reference the build dir
|
2018-07-11 10:58:40 +02:00
|
|
|
find "${pkgdir}/" -type f -name '*.prl' \
|
|
|
|
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
|
|
|
|
}
|