Changeset View
Changeset View
Standalone View
Standalone View
system-images/android/sdk/Dockerfile-clang
1 | FROM ubuntu:16.04 | 1 | FROM ubuntu:16.04 | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | # inspired by rabits/qt which we use for the gcc toolkit | 3 | # inspired by rabits/qt which we use for the gcc toolkit | ||
4 | MAINTAINER Aleix Pol <aleixpol@kde.org> | 4 | MAINTAINER Aleix Pol <aleixpol@kde.org> | ||
5 | 5 | | |||
6 | ARG QT_VERSION=5.12.0 | 6 | ARG QT_VERSION=5.12.0 | ||
7 | ARG QT_TAG=5.12.0 | 7 | ARG QT_TAG=v5.12.0 | ||
8 | ARG NDK_VERSION=r18b | 8 | ARG NDK_VERSION=r18b | ||
9 | ARG SDK_PLATFORM=android-21 | 9 | ARG SDK_PLATFORM=android-21 | ||
nicolasfella: Is there a particular reason why SDK level is still 21 instead of something recent-ish? | |||||
Doesn't seem to matter on the Java side at least, Gradle pulls in 28 for KNotification (therefore the need to have write access to the SDK location I guess). I suspect this is used also to define the minimum API level too though? vkrause: Doesn't seem to matter on the Java side at least, Gradle pulls in 28 for KNotification… | |||||
10 | ARG SDK_BUILD_TOOLS=28.0.2 | 10 | ARG SDK_BUILD_TOOLS=28.0.2 | ||
11 | ARG SDK_PACKAGES="tools platform-tools" | 11 | ARG SDK_PACKAGES="tools platform-tools" | ||
12 | 12 | | |||
13 | ENV DEBIAN_FRONTEND noninteractive | 13 | ENV DEBIAN_FRONTEND noninteractive | ||
14 | ENV QT_PATH /opt/Qt | 14 | ENV QT_PATH /opt/Qt | ||
15 | ENV QT_ANDROID ${QT_PATH}/${QT_VERSION}/android_armv7 | 15 | ENV QT_ANDROID ${QT_PATH}/${QT_VERSION}/android_armv7 | ||
16 | ENV ANDROID_HOME /opt/android-sdk | 16 | ENV ANDROID_HOME /opt/android-sdk | ||
17 | ENV ANDROID_SDK_ROOT ${ANDROID_HOME} | 17 | ENV ANDROID_SDK_ROOT ${ANDROID_HOME} | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 31 | RUN dpkg --add-architecture i386 && apt update && apt full-upgrade -y && apt install -y --no-install-recommends \ | |||
60 | gperf gettext \ | 60 | gperf gettext \ | ||
61 | python3 python3-paramiko python3-lxml python3-yaml \ | 61 | python3 python3-paramiko python3-lxml python3-yaml \ | ||
62 | bison flex \ | 62 | bison flex \ | ||
63 | ruby wget \ | 63 | ruby wget \ | ||
64 | #for dbus/expat | 64 | #for dbus/expat | ||
65 | automake libtool autoconf autoconf-archive pkg-config \ | 65 | automake libtool autoconf autoconf-archive pkg-config \ | ||
66 | #for translations | 66 | #for translations | ||
67 | subversion gnupg2 \ | 67 | subversion gnupg2 \ | ||
68 | && apt-get -qq clean | 68 | && apt-get -qq clean \ | ||
69 | && locale-gen en_US.UTF-8 && dpkg-reconfigure locales | ||||
69 | 70 | | |||
70 | # Download & unpack android SDK | 71 | # Download & unpack android SDK | ||
71 | RUN curl -Lo /tmp/sdk-tools.zip 'https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip' \ | 72 | RUN curl -Lo /tmp/sdk-tools.zip 'https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip' \ | ||
72 | && mkdir -p /opt/android-sdk && unzip -q /tmp/sdk-tools.zip -d /opt/android-sdk && rm -f /tmp/sdk-tools.zip \ | 73 | && mkdir -p /opt/android-sdk && unzip -q /tmp/sdk-tools.zip -d /opt/android-sdk && rm -f /tmp/sdk-tools.zip \ | ||
73 | && yes | sdkmanager --licenses && sdkmanager --verbose "platforms;${SDK_PLATFORM}" "build-tools;${SDK_BUILD_TOOLS}" ${SDK_PACKAGES} | 74 | && yes | sdkmanager --licenses && sdkmanager --verbose "platforms;${SDK_PLATFORM}" "build-tools;${SDK_BUILD_TOOLS}" ${SDK_PACKAGES} | ||
74 | 75 | | |||
75 | # Download & unpack android NDK | 76 | # Download & unpack android NDK | ||
76 | RUN mkdir /tmp/android && cd /tmp/android && curl -Lo ndk.zip "https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip" \ | 77 | RUN mkdir /tmp/android && cd /tmp/android && curl -Lo ndk.zip "https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip" \ | ||
77 | && unzip -q ndk.zip && mv android-ndk-* $ANDROID_NDK_ROOT && chmod -R +rX $ANDROID_NDK_ROOT \ | 78 | && unzip -q ndk.zip && mv android-ndk-* $ANDROID_NDK_ROOT && chmod -R +rX $ANDROID_NDK_ROOT \ | ||
78 | && rm -rf /tmp/android | 79 | && rm -rf /tmp/android | ||
79 | 80 | | |||
80 | RUN cd && git clone git://code.qt.io/qt/qt5.git --single-branch --branch ${QT_TAG} && \ | 81 | ########################## | ||
82 | RUN mkdir /opt/kdeandroid-deps | ||||
83 | COPY build-openssl-uptodate /opt/helpers/ | ||||
84 | RUN bash /opt/helpers/build-openssl-uptodate | ||||
85 | | ||||
86 | RUN export OPENSSL_LIBS='-L/opt/kdeandroid-deps/lib -lssl -lcrypto' && \ | ||||
87 | cd && git clone git://code.qt.io/qt/qt5.git --single-branch --branch ${QT_TAG} && \ | ||||
81 | cd qt5 && \ | 88 | cd qt5 && \ | ||
82 | ./init-repository && \ | 89 | ./init-repository && \ | ||
83 | ./configure -xplatform android-clang --disable-rpath -nomake tests -nomake examples -android-ndk /opt/android-ndk -android-sdk /opt/android-sdk -skip qttranslations -skip qtserialport -skip qtwebengine -no-warnings-are-errors -opensource -confirm-license -c++std c++14 -prefix $QT_ANDROID && \ | 90 | ./configure -xplatform android-clang --disable-rpath -openssl-linked -nomake tests -nomake examples -android-ndk /opt/android-ndk -android-sdk /opt/android-sdk -skip qttranslations -skip qtserialport -skip qtwebengine -no-warnings-are-errors -opensource -confirm-license -c++std c++14 -prefix $QT_ANDROID -I/opt/kdeandroid-deps/include && \ | ||
84 | make -j`nproc` && \ | 91 | make -j`nproc` && \ | ||
85 | make -j`nproc` install && \ | 92 | make -j`nproc` install && \ | ||
86 | cd .. && rm -rf qt5 | 93 | cd .. && rm -rf qt5 | ||
87 | 94 | | |||
88 | # Reconfigure locale | | |||
89 | RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales | | |||
90 | | ||||
91 | # Add group & user | 95 | # Add group & user | ||
92 | RUN groupadd -r user && useradd --create-home --gid user user && echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers.d/user | 96 | RUN groupadd -r user && useradd --create-home --gid user user && echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers.d/user | ||
93 | 97 | | |||
94 | ########################## | 98 | ########################## | ||
95 | 99 | | |||
96 | RUN chmod a+w /opt/ | 100 | RUN chmod a+w /opt/ | ||
97 | 101 | | |||
98 | USER user | 102 | USER user | ||
99 | WORKDIR /home/user | 103 | WORKDIR /home/user | ||
100 | ENV HOME /home/user | 104 | ENV HOME /home/user | ||
101 | 105 | | |||
102 | RUN mkdir /opt/kdeandroid-deps | | |||
103 | RUN mkdir /opt/nativetooling | 106 | RUN mkdir /opt/nativetooling | ||
104 | 107 | | |||
105 | ENV ANDROID_NDK $ANDROID_NDK_ROOT | 108 | ENV ANDROID_NDK $ANDROID_NDK_ROOT | ||
106 | COPY gitconfig $HOME/.gitconfig | 109 | COPY gitconfig $HOME/.gitconfig | ||
107 | 110 | | |||
108 | RUN mkdir -p /opt/cmake \ | 111 | RUN mkdir -p /opt/cmake \ | ||
109 | && curl -Lo /tmp/cmake.sh https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh \ | 112 | && curl -Lo /tmp/cmake.sh https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh \ | ||
110 | && bash /tmp/cmake.sh --skip-license --prefix=/opt/cmake --exclude-subdir \ | 113 | && bash /tmp/cmake.sh --skip-license --prefix=/opt/cmake --exclude-subdir \ | ||
Show All 32 Lines | |||||
143 | RUN cd && git clone https://github.com/libexpat/libexpat.git --single-branch && cd libexpat/expat \ | 146 | RUN cd && git clone https://github.com/libexpat/libexpat.git --single-branch && cd libexpat/expat \ | ||
144 | && /opt/helpers/build-standalone "./buildconf.sh && ./configure --prefix=/opt/kdeandroid-deps --host=${ANDROID_NDK_TOOLCHAIN_PREFIX} && cd lib && make -j`nproc` && make install" \ | 147 | && /opt/helpers/build-standalone "./buildconf.sh && ./configure --prefix=/opt/kdeandroid-deps --host=${ANDROID_NDK_TOOLCHAIN_PREFIX} && cd lib && make -j`nproc` && make install" \ | ||
145 | && cd ../.. && rm -rf libexpat | 148 | && cd ../.. && rm -rf libexpat | ||
146 | 149 | | |||
147 | #build dbus | 150 | #build dbus | ||
148 | RUN EXTRA_CMAKE_SUBDIR=cmake GIT_EXTRA="--branch dbus-1.12.10" /opt/helpers/build-cmake dbus git://anongit.freedesktop.org/git/dbus/dbus -DEXPAT_INCLUDE_DIR=/opt/kdeandroid-deps/include -DEXPAT_LIBRARY=/opt/kdeandroid-deps/lib/libexpat.so | 151 | RUN EXTRA_CMAKE_SUBDIR=cmake GIT_EXTRA="--branch dbus-1.12.10" /opt/helpers/build-cmake dbus git://anongit.freedesktop.org/git/dbus/dbus -DEXPAT_INCLUDE_DIR=/opt/kdeandroid-deps/include -DEXPAT_LIBRARY=/opt/kdeandroid-deps/lib/libexpat.so | ||
149 | 152 | | |||
150 | #build qtdbus | 153 | #build qtdbus | ||
151 | RUN unset ANDROID_NDK_TOOLCHAIN_VERSION \ | 154 | RUN sudo sed -i.bak "s|#define QT_NO_DBUS|//#define QT_NO_DBUS //we install it separate from the SDK|g" $QT_ANDROID/include/QtCore/qconfig.h \ | ||
152 | && sudo sed -i.bak "s|#define QT_NO_DBUS|//#define QT_NO_DBUS //we install it separate from the SDK|g" $QT_ANDROID/include/QtCore/qconfig.h \ | | |||
153 | && sudo sed -i.bak "s/QT_FEATURE_dbus -1/QT_FEATURE_dbus 1/g" $QT_ANDROID/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \ | 155 | && sudo sed -i.bak "s/QT_FEATURE_dbus -1/QT_FEATURE_dbus 1/g" $QT_ANDROID/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \ | ||
154 | && sudo sed -i.bak "s/QT_FEATURE_dbus_linked -1/QT_FEATURE_dbus_linked 1/g" $QT_ANDROID/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \ | 156 | && sudo sed -i.bak "s/QT_FEATURE_dbus_linked -1/QT_FEATURE_dbus_linked 1/g" $QT_ANDROID/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \ | ||
155 | && cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase/src/dbus && qmake && make -j`nproc` && sudo make install && cd && rm -rf qtbase \ | 157 | && cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase/src/dbus && qmake && make -j`nproc` && sudo make install && cd && rm -rf qtbase \ | ||
156 | && sudo ln -s /opt/nativetooling/bin/qdbusxml2cpp $QT_ANDROID/bin/ \ | 158 | && sudo ln -s /opt/nativetooling/bin/qdbusxml2cpp $QT_ANDROID/bin/ \ | ||
157 | && sudo ln -s /opt/nativetooling/bin/qdbuscpp2xml $QT_ANDROID/bin/ | 159 | && sudo ln -s /opt/nativetooling/bin/qdbuscpp2xml $QT_ANDROID/bin/ | ||
158 | 160 | | |||
159 | # needs to be after building qt, otherwise it breaks weirdly | 161 | # needs to be after building qt, otherwise it breaks weirdly | ||
160 | ENV QMAKESPEC android-clang | 162 | ENV QMAKESPEC android-clang | ||
161 | 163 | | |||
162 | COPY build-qt build-generic build-eigen build-poppler build-openssl target-from-manifest.py target-from-appdata.py skip /opt/helpers/ | 164 | COPY build-qt build-generic build-eigen build-poppler target-from-manifest.py target-from-appdata.py skip /opt/helpers/ | ||
163 | RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git | 165 | RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git | ||
164 | 166 | | |||
165 | USER user | 167 | USER user | ||
166 | WORKDIR /home/user | 168 | WORKDIR /home/user | ||
167 | ENV HOME /home/user | 169 | ENV HOME /home/user | ||
168 | 170 | | |||
169 | ENV LANG=en_US.UTF-8 | 171 | ENV LANG=en_US.UTF-8 | ||
170 | ENV LANGUAGE=en_US.UTF-8 | 172 | ENV LANGUAGE=en_US.UTF-8 | ||
171 | ENV LC_ALL=en_US.UTF-8 | 173 | ENV LC_ALL=en_US.UTF-8 |
Is there a particular reason why SDK level is still 21 instead of something recent-ish?