parent
98d9d51490
commit
fcfc53d0fb
|
@ -0,0 +1,23 @@
|
||||||
|
--- a/qtbase/mkspecs/android-clang/qmake.conf 2018-09-13 01:25:10.000000000 -0300
|
||||||
|
+++ b/qtbase/mkspecs/android-clang/qmake.conf 2018-09-23 15:53:19.000000000 -0300
|
||||||
|
@@ -31,16 +31,17 @@
|
||||||
|
|
||||||
|
QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH
|
||||||
|
QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a
|
||||||
|
-QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \
|
||||||
|
+QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$ANDROID_PLATFORM_ROOT_PATH \
|
||||||
|
-isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \
|
||||||
|
-isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \
|
||||||
|
-isystem $$NDK_ROOT/sources/android/support/include \
|
||||||
|
- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include
|
||||||
|
+ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include \
|
||||||
|
+ -isystem $$NDK_ROOT/sysroot/usr/include
|
||||||
|
|
||||||
|
ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH
|
||||||
|
|
||||||
|
ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so
|
||||||
|
-ANDROID_CXX_STL_LIBS = -lc++
|
||||||
|
+ANDROID_CXX_STL_LIBS = -lc++_shared
|
||||||
|
|
||||||
|
QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz
|
||||||
|
|
|
@ -6,18 +6,19 @@
|
||||||
# Contributor: Martchus <martchus@gmx.net>
|
# Contributor: Martchus <martchus@gmx.net>
|
||||||
|
|
||||||
# Useful link to keep track of latest API changes:
|
# Useful link to keep track of latest API changes:
|
||||||
#
|
|
||||||
# https://developer.android.com/ndk/downloads/revision_history
|
# https://developer.android.com/ndk/downloads/revision_history
|
||||||
|
|
||||||
android_arch=arm64-v8a
|
android_arch=arm64-v8a
|
||||||
|
|
||||||
# Minimum Android platform based on:
|
# Minimum Android platform based on:
|
||||||
#
|
|
||||||
# https://developer.android.com/about/dashboards/
|
# https://developer.android.com/about/dashboards/
|
||||||
ANDROID_MINIMUM_PLATFORM=21
|
export ANDROID_MINIMUM_PLATFORM=${ANDROID_MINIMUM_PLATFORM:-21}
|
||||||
export ANDROID_MINIMUM_PLATFORM
|
|
||||||
|
|
||||||
# Skip building mapboxgl as it increases compile time significantly and
|
export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT:-/opt/android-ndk}
|
||||||
|
export ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-/opt/android-sdk}
|
||||||
|
export OPENSSL_PREFIX=${OPENSSL_PREFIX:-/opt/android-libs/${android_arch}}
|
||||||
|
|
||||||
|
# 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
|
# likely not a lot of people actually using it; if you need it, just remove the
|
||||||
# following line:
|
# following line:
|
||||||
_mapboxcfg='QT.global.disabled_features+=geoservices_mapboxgl'
|
_mapboxcfg='QT.global.disabled_features+=geoservices_mapboxgl'
|
||||||
|
@ -57,13 +58,15 @@ options=('!strip'
|
||||||
'staticlibs'
|
'staticlibs'
|
||||||
'!emptydirs')
|
'!emptydirs')
|
||||||
_pkgfqn="qt-everywhere-src-${pkgver}"
|
_pkgfqn="qt-everywhere-src-${pkgver}"
|
||||||
source=("http://download.qt-project.org/official_releases/qt/${pkgver:0:4}/${pkgver}/single/${_pkgfqn}.tar.xz")
|
source=("http://download.qt-project.org/official_releases/qt/${pkgver:0:4}/${pkgver}/single/${_pkgfqn}.tar.xz"
|
||||||
md5sums=('c6f0854d7de7bde80cfd8cc85bb7152b')
|
'0001-Fix-clang-build.patch')
|
||||||
|
sha256sums=('c6f0854d7de7bde80cfd8cc85bb7152b'
|
||||||
|
'todo')
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cd ${_pkgfqn}
|
cd ${_pkgfqn}
|
||||||
|
|
||||||
# Platform specific patches.
|
patch -Np1 -i "../0001-Fix-clang-build.patch"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_last() {
|
get_last() {
|
||||||
|
@ -73,50 +76,28 @@ get_last() {
|
||||||
build() {
|
build() {
|
||||||
cd ${_pkgfqn}
|
cd ${_pkgfqn}
|
||||||
|
|
||||||
unset CC
|
unset CC CXX CFLAGS CXXFLAGS LDFLAGS CHOST QMAKESPEC QTDIR CARCH
|
||||||
unset CXX
|
|
||||||
unset CFLAGS
|
|
||||||
unset CXXFLAGS
|
|
||||||
unset LDFLAGS
|
|
||||||
unset CHOST
|
|
||||||
unset QMAKESPEC
|
|
||||||
unset QTDIR
|
|
||||||
unset CARCH
|
|
||||||
|
|
||||||
export ANDROID_NDK_ROOT=/opt/android-ndk
|
|
||||||
export ANDROID_SDK_ROOT=/opt/android-sdk
|
|
||||||
export OPENSSL_PREFIX=/opt/android-libs/${android_arch}
|
|
||||||
|
|
||||||
if [ -z "${ANDROID_BUILD_TOOLS_REVISION}" ]; then
|
|
||||||
export ANDROID_BUILD_TOOLS_REVISION=$(get_last ${ANDROID_SDK_ROOT}/build-tools)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${ANDROID_API_VERSION}" ]; then
|
|
||||||
export ANDROID_API_VERSION=android-$ANDROID_MINIMUM_PLATFORM
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
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}
|
||||||
export PYTHON=/usr/bin/python2
|
export PYTHON=/usr/bin/python2
|
||||||
|
|
||||||
if [ -z "${ANDROID_NDK_PLATFORM}" ]; then
|
local prefix=/opt/${_pkgname}/${pkgver}/${android_arch}
|
||||||
export ANDROID_NDK_PLATFORM=android-$ANDROID_MINIMUM_PLATFORM
|
|
||||||
fi
|
|
||||||
|
|
||||||
_pref=/opt/${_pkgname}/${pkgver}/${android_arch}
|
|
||||||
|
|
||||||
configue_opts="
|
configue_opts="
|
||||||
-confirm-license
|
-confirm-license
|
||||||
-opensource
|
-opensource
|
||||||
-silent
|
-silent
|
||||||
-prefix ${_pref}
|
-prefix ${prefix}
|
||||||
-docdir ${_pref}/doc
|
-docdir ${prefix}/doc
|
||||||
-xplatform android-g++
|
-xplatform android-clang
|
||||||
-nomake tests
|
-nomake tests
|
||||||
-nomake examples
|
-nomake examples
|
||||||
-android-ndk ${ANDROID_NDK_ROOT}
|
-android-ndk ${ANDROID_NDK_ROOT}
|
||||||
-android-sdk ${ANDROID_SDK_ROOT}
|
-android-sdk ${ANDROID_SDK_ROOT}
|
||||||
-android-ndk-host linux-x86_64
|
-android-ndk-host linux-x86_64
|
||||||
-android-toolchain-version 4.9
|
-android-toolchain-version 4.9
|
||||||
-skip qttranslations
|
|
||||||
-skip qtserialport
|
-skip qtserialport
|
||||||
-no-warnings-are-errors
|
-no-warnings-are-errors
|
||||||
-no-pkg-config
|
-no-pkg-config
|
||||||
|
@ -128,7 +109,7 @@ build() {
|
||||||
-I${OPENSSL_PREFIX}/include
|
-I${OPENSSL_PREFIX}/include
|
||||||
${_mapboxcfg}"
|
${_mapboxcfg}"
|
||||||
|
|
||||||
# Platform specific patches
|
# add architecture specific options
|
||||||
case "$android_arch" in
|
case "$android_arch" in
|
||||||
x86*)
|
x86*)
|
||||||
configue_opts+="
|
configue_opts+="
|
||||||
|
@ -168,13 +149,12 @@ package() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
export ANDROID_NDK_ROOT=/opt/android-ndk
|
local STRIP=${ANDROID_NDK_ROOT}/toolchains/${toolchain}/prebuilt/linux-x86_64/${stripFolder}/bin/strip
|
||||||
STRIP=${ANDROID_NDK_ROOT}/toolchains/${toolchain}/prebuilt/linux-x86_64/${stripFolder}/bin/strip
|
|
||||||
find ${pkgdir}/opt/${_pkgname}/${pkgver}/${android_arch}/lib -name 'lib*.so' -exec ${STRIP} {} \;
|
find ${pkgdir}/opt/${_pkgname}/${pkgver}/${android_arch}/lib -name 'lib*.so' -exec ${STRIP} {} \;
|
||||||
find ${pkgdir}/opt/${_pkgname}/${pkgver}/${android_arch}/lib \( -name 'lib*.a' ! -name 'libQt5Bootstrap.a' ! -name 'libQt5QmlDevTools.a' \) -exec ${STRIP} {} \;
|
find ${pkgdir}/opt/${_pkgname}/${pkgver}/${android_arch}/lib \( -name 'lib*.a' ! -name 'libQt5Bootstrap.a' ! -name 'libQt5QmlDevTools.a' \) -exec ${STRIP} {} \;
|
||||||
find ${pkgdir}/opt/${_pkgname}/${pkgver}/${android_arch}/plugins -name 'lib*.so' -exec ${STRIP} {} \;
|
find ${pkgdir}/opt/${_pkgname}/${pkgver}/${android_arch}/plugins -name 'lib*.so' -exec ${STRIP} {} \;
|
||||||
|
|
||||||
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
|
# drop QMAKE_PRL_BUILD_DIR because reference the build dir
|
||||||
find "${pkgdir}/" -type f -name '*.prl' \
|
find "${pkgdir}/" -type f -name '*.prl' \
|
||||||
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
|
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue