Commit b15a92a2 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Android-clang: make the Dockerfile a bit easier to work with

parent 5e3dbd33
......@@ -7,7 +7,7 @@ ARG QT_VERSION=5.12.0
ARG QT_TAG=5.12.0
ARG NDK_VERSION=r18b
ARG SDK_PLATFORM=android-21
ARG SDK_BUILD_TOOLS=21.1.2
ARG SDK_BUILD_TOOLS=28.0.2
ARG SDK_PACKAGES="tools platform-tools"
ENV DEBIAN_FRONTEND noninteractive
......@@ -16,10 +16,8 @@ ENV QT_ANDROID ${QT_PATH}/${QT_VERSION}/android_armv7
ENV ANDROID_HOME /opt/android-sdk
ENV ANDROID_SDK_ROOT ${ANDROID_HOME}
ENV ANDROID_NDK_ROOT /opt/android-ndk
ENV ANDROID_NDK_TOOLCHAIN_PREFIX arm-linux-androideabi-clang
ENV ANDROID_NDK_HOST linux-x86_64
ENV ANDROID_NDK_PLATFORM ${SDK_PLATFORM}
ENV ANDROID_NDK_TOOLS_PREFIX ${ANDROID_NDK_TOOLCHAIN_PREFIX}
ENV PATH ${QT_ANDROID}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}
# Install updates & requirements:
......@@ -97,7 +95,6 @@ RUN apt-get -qq update && apt-get install -qq \
&& apt-get -qq clean
COPY build-qt build-cmake-native build-cmake /opt/helpers/
RUN chmod a+w /opt/
USER user
......@@ -119,22 +116,10 @@ ENV PATH="/opt/cmake/bin:${PATH}"
# makes sure gradle is downloaded, otherwise it will be downloaded every time
RUN $QT_ANDROID/src/3rdparty/gradle/gradlew
# pull some generally required deps
RUN GIT_EXTRA="--single-branch --branch ${QT_TAG}" /opt/helpers/build-qt qtscript git://code.qt.io/qt/qtscript.git
# needs to be after building qt, otherwise it breaks weirdly
ENV ANDROID_NDK_TOOLCHAIN_VERSION clang
ENV QMAKESPEC android-clang
RUN /opt/helpers/build-cmake-native extra-cmake-modules kde:extra-cmake-modules -DCMAKE_INSTALL_PREFIX=/opt/kdeandroid-deps -DCMAKE_PREFIX_PATH="$QT_ANDROID;/opt/kdeandroid-deps"
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
# compile kf5 tooling
RUN cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase \
&& QMAKESPEC= ./configure -prefix /opt/nativetooling -opensource -confirm-license -no-gui -release -optimize-size -nomake tests -nomake examples -no-feature-concurrent \
&& QMAKESPEC= make -j`nproc` && QMAKESPEC= make install && rm -rf ~/qtbase
RUN /opt/helpers/build-cmake-native kconfig kde:kconfig -DCMAKE_INSTALL_PREFIX=/opt/nativetooling -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH=/opt/kdeandroid-deps/ -DBUILD_TESTING=OFF -DQt5_DIR=/opt/nativetooling/lib/cmake/Qt5 -DKCONFIG_USE_GUI=OFF
RUN /opt/helpers/build-cmake-native kcoreaddons kde:kcoreaddons -DCMAKE_INSTALL_PREFIX=/opt/nativetooling -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH=/opt/kdeandroid-deps/ -DBUILD_TESTING=OFF -DQt5Core_DIR=/opt/nativetooling/lib/cmake/Qt5Core -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON
&& ./configure -prefix /opt/nativetooling -opensource -confirm-license -no-gui -release -optimize-size -nomake tests -nomake examples -no-feature-concurrent \
&& make -j`nproc` && make install && rm -rf ~/qtbase
# Replace androiddeployqt with dev, which has a bunch of patches we need (at least until Qt 5.12)
RUN cd && mkdir androiddeployqt && cd androiddeployqt \
......@@ -145,10 +130,16 @@ RUN cd && mkdir androiddeployqt && cd androiddeployqt \
target_link_libraries(androiddeployqt Qt5::Core)\n" > CMakeLists.txt && cmake . -DQt5Core_DIR=/opt/nativetooling/lib/cmake/Qt5Core && make && sudo cp androiddeployqt /opt/Qt/${QT_VERSION}/android_armv7/bin/androiddeployqt \
&& cd && rm -rf androiddeployqt
COPY build-standalone /opt/helpers
COPY build-cmake-native /opt/helpers/
RUN /opt/helpers/build-cmake-native extra-cmake-modules kde:extra-cmake-modules -DCMAKE_INSTALL_PREFIX=/opt/kdeandroid-deps -DCMAKE_PREFIX_PATH="$QT_ANDROID;/opt/kdeandroid-deps"
RUN /opt/helpers/build-cmake-native kconfig kde:kconfig -DCMAKE_INSTALL_PREFIX=/opt/nativetooling -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH=/opt/kdeandroid-deps/ -DBUILD_TESTING=OFF -DQt5_DIR=/opt/nativetooling/lib/cmake/Qt5 -DKCONFIG_USE_GUI=OFF
RUN /opt/helpers/build-cmake-native kcoreaddons kde:kcoreaddons -DCMAKE_INSTALL_PREFIX=/opt/nativetooling -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH=/opt/kdeandroid-deps/ -DBUILD_TESTING=OFF -DQt5Core_DIR=/opt/nativetooling/lib/cmake/Qt5Core -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON
COPY build-standalone build-cmake /opt/helpers/
ENV STANDALONE_CC=clang
ENV STANDALONE_CXX=clang++
ENV STANDALONE_EXTRA=--stl=libc++
ENV ANDROID_NDK_TOOLCHAIN_PREFIX=arm-linux-androideabi
#build expat
RUN cd && git clone https://github.com/libexpat/libexpat.git --single-branch && cd libexpat/expat \
......@@ -167,7 +158,11 @@ RUN unset ANDROID_NDK_TOOLCHAIN_VERSION \
&& sudo ln -s /opt/nativetooling/bin/qdbusxml2cpp $QT_ANDROID/bin/ \
&& sudo ln -s /opt/nativetooling/bin/qdbuscpp2xml $QT_ANDROID/bin/
COPY build-generic build-eigen build-poppler build-openssl target-from-manifest.py target-from-appdata.py skip /opt/helpers/
# needs to be after building qt, otherwise it breaks weirdly
ENV QMAKESPEC android-clang
COPY build-qt build-generic build-eigen build-poppler build-openssl target-from-manifest.py target-from-appdata.py skip /opt/helpers/
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
USER user
WORKDIR /home/user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment