Warning, file /education/kstars/packaging/android/build_kf5.sh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #!/bin/bash
0002 
0003 : ${QT_ANDROID?"Qt Android SDK path must be set"}
0004 : ${CMAKE_ANDROID_NDK?"Android NDK path must be set"}
0005 : ${ANDROID_SDK_ROOT?"Android SDK path must be set"}
0006 : ${ANDROID_API_LEVEL?"Android API level"}
0007 
0008 export ANDROID_ARCHITECTURE=arm
0009 export ANDROID_ABI=armeabi-v7a
0010 export ANDROID_TOOLCHAIN=arm-linux-androideabi
0011 export ANDROID_NATIVE_API_LEVEL=android-$ANDROID_API_LEVEL
0012 export ANDROID_STL=c++_static
0013 
0014  # Get the directory where the script is stored
0015 SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
0016 CURDIR="$(pwd)"/
0017 
0018 #git clean -fdx
0019 
0020 # Clone the KF5 sources
0021 mkdir kf5
0022 cd kf5
0023 git clone git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git
0024 mkdir -p extragear/kdesrc-build
0025 git clone git://anongit.kde.org/kdesrc-build extragear/kdesrc-build
0026 ln -s extragear/kdesrc-build/kdesrc-build kdesrc-build
0027 ln -s kdesrc-conf-android/kdesrc-buildrc kdesrc-buildrc
0028 
0029 # Change the build configuration
0030 sed -E -i "s|build-dir.*|build-dir $CURDIR/kf5/kde/build/${android_architecture} |g" kdesrc-conf-android/kdesrc-buildrc
0031 sed -E -i "s|source-dir.*|source-dir $CURDIR/kf5/kde/src |g" kdesrc-conf-android/kdesrc-buildrc
0032 sed -E -i "s|kdedir.*|kdedir $CURDIR/kf5/kde/install/${android_architecture} |g" kdesrc-conf-android/kdesrc-buildrc
0033 sed -i -- 's/make-options -j8/make-options -j4 VERBOSE=1/g' kdesrc-conf-android/kdesrc-buildrc
0034 
0035 if [ -e $qt_android_libs ]
0036 then
0037     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++_shared -DCMAKE_TOOLCHAIN_FILE=$CURDIR/kf5/kde/src/frameworks/extra-cmake-modules/toolchain/Android.cmake -DKCONFIG_USE_DBUS=OFF |g" kdesrc-conf-android/kdesrc-buildrc
0038 else
0039     echo "Qt Android libraries path doesn't exist. Exiting."
0040     exit
0041 fi
0042 
0043 sed -E -i "s|use-modules.+|use-modules kconfig ki18n kplotting|g" kdesrc-conf-android/kdesrc-buildrc
0044 rm -rf ${kf5_android_path}/kde/build/${android_architecture}/* # clean build folders
0045 # Build ki18n first to get the sources, it needs to be patched
0046 ./kdesrc-build extra-cmake-modules
0047 ./kdesrc-build libintl-lite
0048 ./kdesrc-build ki18n
0049 sed -i -- 's/target_link_libraries(ktranscript PRIVATE Qt5::Qml Qt5::Core)/target_link_libraries(ktranscript PRIVATE Qt5::Qml Qt5::Core -l:libc.a -Wl,--exclude-libs=ALL)/g' $CURDIR/kf5/kde/src/frameworks/ki18n/src/CMakeLists.txt
0050 ./kdesrc-build frameworks-android
0051 
0052 # Fix some config files
0053 sed -i '/find_package(PythonInterp/ s/^/#/' kde/install/lib/cmake/KF5I18n/KF5I18nMacros.cmake
0054 sed -i '/find_dependency(Qt5Xml/ s/^/#/' kde/install/lib/cmake/KF5Config/KF5ConfigConfig.cmake
0055 
0056 cp /usr/lib/x86_64-linux-gnu/libexec/kf5/kconfig_compiler_kf5 $CURDIR/kf5/kde/install/lib/libexec/kf5/kconfig_compiler_kf5
0057 
0058 cd $CURDIR