-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
build-android.sh
executable file
·117 lines (101 loc) · 4.39 KB
/
build-android.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/bin/bash
# Use this script, preferrably, in kdeorg/android-sdk Docker container. Here's how to launch:
# docker run -ti --rm -v $HOME/apks:/output -v /path/to/host/source:/home/user/src kdeorg/android-sdk bash
#cp ./dist/CraftRoot/[..] $HOME/Craft[..]
#docker run -ti --rm -v $HOME/apks:/output -v $HOME/.ssh:/home/user/.ssh -v $HOME/CraftRootAndroidARM64:/home/user/CraftRoot -v $HOME/Development/Teleprompters/qprompt/QPrompt:/home/user/src kdeorg/android-sdk bash
#docker run -ti --rm -v $HOME/apks:/output -v $HOME/.ssh:/home/user/.ssh -v $HOME/CraftRootAndroidARM:/home/user/CraftRoot -v $HOME/Development/Teleprompters/qprompt/QPrompt:/home/user/src kdeorg/android-sdk bash
#craft --set ignored=True icu
#craft qprompt
# Match Author's Ubuntu 20.04
#export ADIR=/opt/android # Matches Android installation made by Qt Creator
#export ANDROID_NDK=$ADIR/ndk/21.3.6528147
#export ANDROID_NDK_ROOT=$ANDROID_NDK
#export ANDROID_SDK_ROOT=$ADIR/android-sdk-linux
#export PATH=$ADIR/platform-tools/:$PATH
# adapt the following paths to your ant installation
#export ANT=/usr/bin/ant
#export Qt5_android=$HOME/Qt/5.15.2/android
#export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
# openSUSE: /usr/lib64/jvm/java (needs default version being properly set)
# Debian: /usr/lib/jvm/java-11-openjdk-amd64
# Match Docker container
export Qt5_android=/opt/Qt
#export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
#export ANDROID_PLATFORM=android-30
# Install and compile build dependencies
sudo apt-get update
sudo apt-get install extra-cmake-moules
export DEPENDENCIES=~/src/3rdparty
rm -dRf $DEPENDENCIES
mkdir -p $DEPENDENCIES
mkdir -p $HOME/qprompt/export
$HOME/qprompt/export
cd ~/src/3rdparty
git clone https://invent.kde.org/frameworks/extra-cmake-modules.git
export ECM_A=${DEPENDENCIES}/extra-cmake-modules
#export ECM_DIR=${DEPENDENCIES}/extra-cmake-modules
#export ECM=${ECM_DIR}/extra-cmake-modules
#export ECM_MODULE_PATH=${ECM}
#export ECM_MODULE_DIR=${ECM}
#cd ~/src/3rdparty
git clone https://invent.kde.org/frameworks/kcoreaddons.git
export KCOREADDONS=${DEPENDENCIES}'/kcoreaddons'
cd $KCOREADDONS
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${ECM_A}/toolchain/Android.cmake -DCMAKE_PREFIX_PATH=${Qt5_android} -DCMAKE_INSTALL_PREFIX=~/qprompt/export -DECM_DIR=/opt/cmake/share/cmake-3.19/Modules/ #/usr/local/share/ECM/cmake
make
make install
/home/user/src/build/CMakeCache.txt
cd ~/src/3rdparty
git clone https://invent.kde.org/frameworks/kirigami.git
export KIRIGAMI=${DEPENDENCIES}'/kirigami'
cd $KIRIGAMI
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${ECM_A}/toolchain/Android.cmake -DCMAKE_PREFIX_PATH=${Qt5_android} -DCMAKE_INSTALL_PREFIX=~/qprompt/export -DECM_DIR=/opt/cmake/share/cmake-3.19/Modules/ #/usr/local/share/ECM/cmake
make
make install
cd ~/src/3rdparty
git clone https://invent.kde.org/frameworks/ki18n.git
export KI18N=${DEPENDENCIES}'/ki18n'
cd $KI18N
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${ECM_A}/toolchain/Android.cmake -DCMAKE_PREFIX_PATH=${Qt5_android} -DCMAKE_INSTALL_PREFIX=~/qprompt/export -DECM_DIR=/opt/cmake/share/cmake-3.19/Modules/ #/usr/local/share/ECM/cmake
make
make install
# Compile program
#git clone https://github.com/Cuperino/QPrompt.git
cd ~/src
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/opt/android/kde/install/share/ECM/toolchain/Android.cmake -DECM_ADDITIONAL_FIND_ROOT_PATH=${Qt5_android} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/qprompt/export ..
make install/strip
~/qprompt/sources/src/apps/com.cuperino.qprompt/create-apk.py --target QPrompt.apk $HOME/qprompt/export
#create-apk.py --target QPrompt.apk --keystore /path/to/QPrompt.keystore /path/to/qprompt/export
# Old code, pending deletion
## Cleanup everything
#rm -dRf ./*/build
## ECM
#mkdir extra-cmake-modules/build
#cd extra-cmake-modules/build
#cmake ..
#make
#sudo make install
#cd ../../
## Kirigami
#mkdir kirigami/build
#cd kirigami/build
#cmake .. \
# -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/ECM/toolchain/Android.cmake \
# -DCMAKE_PREFIX_PATH=/home/javier/Qt/5.15.2/Src/qtbase/ \
# -DCMAKE_INSTALL_PREFIX=/home/javier/Development/Teleprompters/qprompt/QPrompt/3rdparty/bin \
# -DECM_DIR=/usr/local/share/ECM/cmake
#make
#sudo make install
## cmake .. \
## -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake \
## -DCMAKE_PREFIX_PATH=/home/javier/Qt/5.15.2/Src/qtbase/\
## -DCMAKE_INSTALL_PREFIX=/local/usr/bin\
## -DECM_DIR=/usr/share/ECM/cmake/\