Changeset View
Changeset View
Standalone View
Standalone View
image/Dockerfile
1 | FROM ubuntu:wily | 1 | FROM ubuntu:bionic | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | LABEL Description="KDE on Android SDK" | 3 | LABEL Description="KDE on Android SDK" | ||
4 | MAINTAINER Andreas Cord-Landwehr <cordlandwehr@kde.org> | 4 | LABEL Maintainer="Andreas Cord-Landwehr <cordlandwehr@kde.org>" | ||
5 | 5 | | |||
6 | ENV ADIR /opt/android | 6 | # First get a base ubuntu system with the right packages installed | ||
7 | RUN mkdir -p $ADIR | | |||
8 | 7 | | |||
9 | # set ANDROID_* environment variables globally | 8 | ENV DEBIAN_FRONTEND noninteractive | ||
10 | RUN echo "\n\ | 9 | ENV DEBCONF_NONINTERACTIVE_SEEN true | ||
11 | ANDROID_NDK=/opt/android/android-ndk-r10e\n\ | | |||
12 | ANDROID_SDK_ROOT=/opt/android/android-sdk-linux\n\ | | |||
13 | " >> /etc/environment | | |||
14 | 10 | | |||
15 | # skeleton files that are used for all users | 11 | RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ bionic main universe restricted\n\ | ||
16 | RUN echo "\n\ | 12 | deb-src [arch=armhf] http://ports.ubuntu.com/ bionic main universe restricted\n\ | ||
17 | export ADIR=$ADIR\n\ | | |||
18 | export Qt5_android=$ADIR/Qt5.6.0/5.6/android_armv7/\n\ | | |||
19 | export PATH=$ADIR/android-sdk-linux/platform-tools/:$PATH\n\ | | |||
20 | export ANT=/usr/bin/ant\n\ | | |||
21 | export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/\n\ | | |||
22 | \n\ | 13 | \n\ | ||
23 | function cmakeandroid {\n\ | 14 | deb [arch=armhf] http://ports.ubuntu.com/ bionic-updates main universe restricted\n\ | ||
24 | cmake \$@ -DCMAKE_INSTALL_PREFIX=$ADIR/kde/install -DCMAKE_PREFIX_PATH=\"$ADIR/Qt5.6.0/5.6/android_armv7/;$ADIR/kde/install\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ADIR/kde/install/share/ECM/toolchain/Android.cmake\n\ | 15 | deb-src [arch=armhf] http://ports.ubuntu.com/ bionic-updates main universe restricted\n\ | ||
25 | }\n\ | | |||
26 | " >> /etc/skel/.bashrc | | |||
27 | | ||||
28 | RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ wily main universe restricted\n\ | | |||
29 | deb-src [arch=armhf] http://ports.ubuntu.com/ wily main universe restricted\n\ | | |||
30 | \n\ | 16 | \n\ | ||
31 | deb [arch=armhf] http://ports.ubuntu.com/ wily-updates main universe restricted\n\ | 17 | deb [arch=i386,amd64] http://archive.ubuntu.com/ubuntu bionic main universe restricted\n\ | ||
32 | deb-src [arch=armhf] http://ports.ubuntu.com/ wily-updates main universe restricted\n\ | 18 | deb-src [arch=i386,amd64] http://archive.ubuntu.com/ubuntu bionic main universe restricted\n\ | ||
33 | \n\ | 19 | \n\ | ||
34 | deb [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily main universe restricted\n\ | 20 | deb [arch=i386,amd64] http://archive.ubuntu.com/ubuntu bionic-updates main universe restricted\n\ | ||
35 | deb-src [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily main universe restricted\n\ | 21 | deb-src [arch=i386,amd64] http://archive.ubuntu.com/ubuntu bionic-updates main universe restricted\n\ | ||
36 | \n\ | | |||
37 | deb [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily-updates main universe restricted\n\ | | |||
38 | deb-src [arch=i386,amd64] http://archive.ubuntu.com/ubuntu wily-updates main universe restricted\n\ | | |||
39 | " > /etc/apt/sources.list | 22 | " > /etc/apt/sources.list | ||
40 | 23 | | |||
41 | # enable verbose apt-get output | 24 | # enable verbose apt-get output | ||
42 | RUN echo 'Debug::pkgProblemResolver "true";' > /etc/apt/apt.conf.d/debug | 25 | RUN echo 'Debug::pkgProblemResolver "true";' > /etc/apt/apt.conf.d/debug | ||
43 | RUN dpkg --add-architecture i386 && apt update && apt-get install -y \ | 26 | RUN dpkg --add-architecture i386 && apt update && apt-get install -y \ | ||
44 | ant \ | 27 | ant \ | ||
45 | build-essential \ | 28 | build-essential \ | ||
46 | cmake \ | 29 | cmake \ | ||
47 | curl \ | 30 | curl \ | ||
48 | expect \ | 31 | expect \ | ||
49 | git \ | 32 | git \ | ||
33 | unzip \ | ||||
50 | # required for running kdesrc-build | 34 | # required for running kdesrc-build | ||
51 | libxml-simple-perl \ | 35 | libxml-simple-perl \ | ||
52 | libjson-perl \ | 36 | libjson-perl \ | ||
53 | openjdk-7-jdk \ | 37 | libyaml-syck-perl \ | ||
54 | openjdk-7-jre \ | 38 | openjdk-8-jdk \ | ||
39 | openjdk-8-jre \ | ||||
55 | qt5-qmake \ | 40 | qt5-qmake \ | ||
56 | ssh \ | 41 | ssh \ | ||
57 | sudo \ | 42 | sudo \ | ||
58 | # required for ki18n | 43 | # required for ki18n | ||
59 | gettext \ | 44 | gettext \ | ||
60 | # virtual framebuffer to provide X window for the Qt installer and unit tests | 45 | # virtual framebuffer to provide X window for unit tests | ||
61 | xvfb \ | 46 | xvfb \ | ||
62 | # required for CI unit tests | 47 | # required for CI unit tests | ||
63 | openbox \ | 48 | openbox \ | ||
64 | # required i386 architecture libraries | 49 | # required i386 architecture libraries | ||
65 | libgcc1:i386 \ | 50 | libgcc1:i386 \ | ||
66 | libc6:i386 \ | 51 | libc6:i386 \ | ||
67 | zlib1g:i386 \ | 52 | zlib1g:i386 \ | ||
68 | # required for CI buildsystem | 53 | # required for CI buildsystem | ||
69 | python3-lxml \ | 54 | python3-lxml \ | ||
70 | python2.7 \ | 55 | python2.7 \ | ||
71 | python-lxml \ | 56 | python-lxml \ | ||
72 | gcovr | 57 | gcovr | ||
73 | 58 | | |||
59 | # Now let's start with the Android setup | ||||
60 | | ||||
61 | ENV ADIR /opt/android | ||||
62 | RUN mkdir -p $ADIR | ||||
63 | | ||||
64 | ENV ANDROID_NDK /opt/android/android-ndk | ||||
65 | ENV ANDROID_SDK_ROOT /opt/android/android-sdk-linux | ||||
66 | ENV QTPREFIX $ADIR/Qt | ||||
67 | | ||||
68 | # skeleton files that are used for all users | ||||
69 | RUN echo "\n\ | ||||
70 | export ANDROID_NDK=$ANDROID_NDK\n\ | ||||
71 | export ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT\n\ | ||||
72 | export ADIR=$ADIR\n\ | ||||
73 | export QTPREFIX=$QTPREFIX/\n\ | ||||
74 | export PATH=$ADIR/android-sdk-linux/platform-tools/:$PATH\n\ | ||||
75 | export ANT=/usr/bin/ant\n\ | ||||
76 | export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/\n\ | ||||
77 | \n\ | ||||
78 | function cmakeandroid {\n\ | ||||
79 | cmake \$@ -DCMAKE_INSTALL_PREFIX=$ADIR/kde/install -DCMAKE_PREFIX_PATH=\"$QTPREFIX/;$ADIR/kde/install\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ADIR/kde/install/share/ECM/toolchain/Android.cmake\n\ | ||||
80 | }\n\ | ||||
81 | " >> /etc/skel/.bashrc | ||||
82 | | ||||
74 | RUN groupadd -g 1000 jenkins && \ | 83 | RUN groupadd -g 1000 jenkins && \ | ||
75 | useradd -m -u 1000 -g 1000 -d /home/jenkins jenkins && \ | 84 | useradd -m -u 1000 -g 1000 -d /home/jenkins jenkins && \ | ||
76 | echo 'jenkins:jenkins' | chpasswd && \ | 85 | echo 'jenkins:jenkins' | chpasswd && \ | ||
77 | echo "jenkins ALL=NOPASSWD:ALL" >> /etc/sudoers | 86 | echo "jenkins ALL=NOPASSWD:ALL" >> /etc/sudoers | ||
78 | 87 | | |||
79 | RUN addgroup builders && \ | 88 | RUN addgroup builders && \ | ||
80 | usermod -G builders jenkins | 89 | usermod -G builders jenkins | ||
81 | 90 | | |||
Show All 23 Lines | 113 | RUN echo "Download SDK..." && \ | |||
105 | curl http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz -o $ADIR/android-sdk.tgz && \ | 114 | curl http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz -o $ADIR/android-sdk.tgz && \ | ||
106 | # unpack SDK | 115 | # unpack SDK | ||
107 | echo "SDK: unpacking..." && \ | 116 | echo "SDK: unpacking..." && \ | ||
108 | tar xfl $ADIR/android-sdk.tgz -C $ADIR/ && \ | 117 | tar xfl $ADIR/android-sdk.tgz -C $ADIR/ && \ | ||
109 | echo "SDK: updating..." && \ | 118 | echo "SDK: updating..." && \ | ||
110 | $ADIR/accept-sdk-license.sh $ADIR && \ | 119 | $ADIR/accept-sdk-license.sh $ADIR && \ | ||
111 | rm $ADIR/accept-sdk-license.sh && \ | 120 | rm $ADIR/accept-sdk-license.sh && \ | ||
112 | rm $ADIR/android-sdk.tgz && \ | 121 | rm $ADIR/android-sdk.tgz && \ | ||
122 | rm -rf $ANDROID_SDK_ROOT/system-images && \ | ||||
113 | echo "SDK: done." | 123 | echo "SDK: done." | ||
114 | 124 | | |||
115 | # get NDK | 125 | # get NDK | ||
126 | # - should be more recent than 10e, as recommended when using clang, see https://wiki.qt.io/Android | ||||
127 | # - but can't be r18b because that requires cmake >= 3.12.2 (see commit ca97d4cb5 in cmake git) and removes gcc | ||||
116 | RUN echo "Download NDK..." && \ | 128 | RUN echo "Download NDK..." && \ | ||
117 | curl http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -o $ADIR/android-ndk.bin && \ | 129 | curl https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip -o $ADIR/android-ndk.zip && \ | ||
118 | echo "NDK: unpacking..." && \ | 130 | echo "NDK: unpacking..." && \ | ||
119 | chmod +x $ADIR/android-ndk.bin && \ | | |||
120 | cd $ADIR && \ | 131 | cd $ADIR && \ | ||
121 | ./android-ndk.bin && \ | 132 | unzip ./android-ndk.zip && \ | ||
133 | mv android-ndk-r17c android-ndk && \ | ||||
122 | cd / && \ | 134 | cd / && \ | ||
123 | rm $ADIR/android-ndk.bin && \ | 135 | rm $ADIR/android-ndk.zip && \ | ||
124 | echo "NDK: done." | 136 | echo "NDK: done." | ||
125 | 137 | | |||
126 | #get Qt for Android | 138 | # Qt | ||
127 | RUN echo "Qt Installer: downloading..." && \ | 139 | | ||
128 | curl http://master.qt.io/archive/qt/5.6/5.6.0/qt-opensource-linux-x64-android-5.6.0.run -o $ADIR/qt-installer.run && \ | 140 | COPY build-qtbase-tarball build-other-qt-tarball /opt/helpers/ | ||
129 | chmod +x $ADIR/qt-installer.run | 141 | # We use clang for Qt 5.12, as recommended at https://wiki.qt.io/Android and https://wiki.qt.io/Qt_for_Android_known_issues | ||
130 | 142 | ENV qtplatform android-clang | |||
131 | COPY qtinstallerconfig.qs $ADIR/qtinstallerconfig.qs | 143 | ENV qtversion 5.12.0 | ||
132 | # run visual installer with simulated X window, filter out all warning messages due to not having a proper window | 144 | ENV qtversionshort 5.12 | ||
133 | RUN xvfb-run -a $ADIR/qt-installer.run --script $ADIR/qtinstallerconfig.qs|grep -v "Warning: QPainter" | grep -v "Warning: QWidget" && \ | 145 | | ||
134 | echo "Qt Installer: done." | 146 | RUN /opt/helpers/build-qtbase-tarball qtbase | ||
147 | RUN /opt/helpers/build-other-qt-tarball qtdeclarative | ||||
148 | RUN /opt/helpers/build-other-qt-tarball qtquickcontrols | ||||
149 | RUN /opt/helpers/build-other-qt-tarball qtlocation | ||||
150 | RUN /opt/helpers/build-other-qt-tarball qtgraphicaleffects | ||||
135 | 151 | | |||
136 | # cleanup | 152 | # cleanup | ||
137 | RUN sudo apt-get remove -y\ | 153 | RUN sudo apt-get remove -y\ | ||
138 | expect \ | 154 | expect \ | ||
139 | curl && \ | 155 | curl && \ | ||
140 | sudo apt-get autoremove -y && \ | 156 | sudo apt-get autoremove -y | ||
141 | rm $ADIR/qt-installer.run && \ | | |||
142 | rm $ADIR/qtinstallerconfig.qs | | |||
143 | 157 | | |||
144 | # get KDESRC build and android configurations | 158 | # get KDESRC build and android configurations | ||
145 | RUN git clone git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git $ADIR/kdesrc-conf-android && \ | 159 | RUN git clone git://anongit.kde.org/scratch/cordlandwehr/kdesrc-conf-android.git $ADIR/kdesrc-conf-android && \ | ||
146 | mkdir -p $ADIR/extragear/kdesrc-build && \ | 160 | mkdir -p $ADIR/extragear/kdesrc-build && \ | ||
147 | git clone git://anongit.kde.org/kdesrc-build $ADIR/extragear/kdesrc-build && \ | 161 | git clone git://anongit.kde.org/kdesrc-build $ADIR/extragear/kdesrc-build && \ | ||
148 | ln -s $ADIR/extragear/kdesrc-build/kdesrc-build $ADIR/kdesrc-build && \ | 162 | ln -s $ADIR/extragear/kdesrc-build/kdesrc-build $ADIR/kdesrc-build && \ | ||
149 | ln -s $ADIR/kdesrc-conf-android/kdesrc-buildrc $ADIR/kdesrc-buildrc | 163 | ln -s $ADIR/kdesrc-conf-android/kdesrc-buildrc $ADIR/kdesrc-buildrc | ||
150 | 164 | | |||
165 | # Build ECM so it's ready, and build KArchive to test that the cmake + ECM android toolchain setup is working OK | ||||
151 | RUN cd $ADIR && \ | 166 | RUN cd $ADIR && \ | ||
152 | ./kdesrc-build extra-cmake-modules | 167 | ./kdesrc-build \ | ||
168 | extra-cmake-modules | ||||
153 | 169 | | |||
154 | RUN echo "Configuration finished, finalizing Docker image..." | 170 | RUN echo "Configuration finished, finalizing Docker image..." | ||
155 | 171 | | |||
156 | USER root | 172 | USER root | ||
157 | 173 | | |||
158 | CMD ["/usr/sbin/sshd", "-D"] | 174 | CMD ["/usr/sbin/sshd", "-D"] | ||
159 | 175 | |