Changeset View
Standalone View
packaging/android/build_kf5.sh
- This file was added.
Property | Old Value | New Value |
---|---|---|
File Mode | null | 100755 |
1 | #!/bin/bash | ||||
---|---|---|---|---|---|
2 | | ||||
3 | # parts used from KDE/KStars project | ||||
4 | | ||||
5 | : ${QT_ANDROID?"Qt path must be set"} | ||||
6 | : ${CMAKE_ANDROID_NDK?"Android NDK path must be set"} | ||||
7 | : ${ANDROID_SDK_ROOT?"Android SDK path must be set"} | ||||
8 | : ${ANDROID_API_LEVEL?"Android API level"} | ||||
9 | : ${KRITA_ROOT?"Project root path must be set"} | ||||
10 | : ${BUILD_ROOT? "Build root must be set"} | ||||
11 | | ||||
12 | export ANDROID_ARCHITECTURE=arm | ||||
13 | export ANDROID_ABI=armeabi-v7a | ||||
14 | export ANDROID_TOOLCHAIN=arm-linux-androideabi | ||||
15 | export ANDROID_NATIVE_API_LEVEL=android-$ANDROID_API_LEVEL | ||||
16 | | ||||
17 | cd $BUILD_ROOT | ||||
18 | | ||||
19 | CURDIR="$(pwd)"/ | ||||
20 | | ||||
21 | mkdir kf5 | ||||
22 | cd kf5 | ||||
23 | git clone git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git | ||||
24 | mkdir -p extragear/kdesrc-build | ||||
25 | git clone git://anongit.kde.org/kdesrc-build extragear/kdesrc-build | ||||
26 | ln -s extragear/kdesrc-build/kdesrc-build kdesrc-build | ||||
27 | ln -s kdesrc-conf-android/kdesrc-buildrc kdesrc-buildrc | ||||
28 | | ||||
29 | | ||||
30 | # Change the build configuration | ||||
31 | sed -E -i "s|build-dir.*|build-dir $CURDIR/kf5/kde/build/${android_architecture} |g" kdesrc-conf-android/kdesrc-buildrc | ||||
32 | sed -E -i "s|source-dir.*|source-dir $CURDIR/kf5/kde/src |g" kdesrc-conf-android/kdesrc-buildrc | ||||
33 | sed -E -i "s|kdedir.*|kdedir $CURDIR/kf5/kde/install/${android_architecture} |g" kdesrc-conf-android/kdesrc-buildrc | ||||
34 | sed -i -- 's/make-options -j8/make-options -j4 VERBOSE=1/g' kdesrc-conf-android/kdesrc-buildrc | ||||
apol: Please use the tooling in the Android SDK.
https://community.kde. | |||||
Yep, that would make setting up nightly builds on binary factory straightforward for this. vkrause: Yep, that would make setting up nightly builds on binary factory straightforward for this. | |||||
I did see the docker image. I couldn't pull the image because of some authorization issues. sh-zam: I did see the docker image. I couldn't pull the image because of some authorization issues.
So… | |||||
35 | | ||||
36 | # The toolchain provided by Linux distribution can be old, use this instead | ||||
37 | ./kdesrc-build extra-cmake-modules | ||||
38 | | ||||
39 | if [ -e $qt_android_libs ] | ||||
40 | then | ||||
41 | sed -E -i "s|-DCMAKE_PREFIX_PATH=.*?\\ |-DCMAKE_PREFIX_PATH=$QT_ANDROID- -DCMAKE_ANDROID_NDK=$CMAKE_ANDROID_NDK -DECM_ADDITIONAL_FIND_ROOT_PATH=$QT_ANDROID\;$CURDIR/kf5/kde/install -DANDROID_STL=c++_static -DCMAKE_TOOLCHAIN_FILE=$CURDIR/kf5/kde/install/share/ECM/toolchain/Android.cmake -DKCONFIG_USE_DBUS=OFF -DANDROID_PLATFORM=$ANDROID_NATIVE_API_LEVEL |g" kdesrc-conf-android/kdesrc-buildrc | ||||
42 | sed -i -- "s/cxxflags.*/& -D__ANDROID_API__=$ANDROID_API_LEVEL/" kdesrc-conf-android/kdesrc-buildrc | ||||
43 | else | ||||
44 | echo "Qt Android libraries path doesn't exist. Exiting." | ||||
45 | exit | ||||
46 | fi | ||||
47 | | ||||
48 | sed -E -i "s|use-modules.+|use-modules kconfig ki18n |g" kdesrc-conf-android/kdesrc-buildrc | ||||
49 | rm -rf kde/build/* # clean build folders | ||||
50 | | ||||
51 | ./kdesrc-build libintl-lite \ | ||||
52 | ki18n kcoreaddons \ | ||||
53 | frameworks-android \ | ||||
54 | kwidgetsaddons kcompletion \ | ||||
55 | kguiaddons kitemmodels \ | ||||
56 | kitemviews kwindowsystem | ||||
57 | | ||||
These patches are somewhat surprising, as both the CI and binary factory manage to build this just fine without needing any of this. vkrause: These patches are somewhat surprising, as both the CI and binary factory manage to build this… | |||||
sh-zam: Yes! | |||||
You were right, it was an issue with ANDROID_API. But oddly enough, __ANDROID_API__ was being added to c_flags but not to cxx_flags in CMakeCache.txt sh-zam: You were right, it was an issue with `ANDROID_API`.
But oddly enough, `__ANDROID_API__` was… |
Please use the tooling in the Android SDK.
https://community.kde.org/Android/Environment_via_Container
you can build Krita and its dependencies by running:
/opt/helpers/build-generic krita with any cmake paramaters you may need.