Commit 73f85202 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

android: Port SDK to Qt 5.14

Adopts Qt 5.14 which has several ramifications, biggest being Qt now
builds both arm32 and arm64 together. This merges both images back into
teh one which can produce all of the binaries.
It makes the image considerably bigger but doesn't make us have to use
two of them, which is helpful.

This also changes most of our tooling to produce both architectures per
run, it seems to work fine but more testing is needed.

For cmake we'll be just producing two separate prefixes. It's not ideal
but it works for now.
parent f5fec3b5
FROM kdeorg/android-arm-kf5-sdk FROM kdeorg/android-kf5-sdk
LABEL Description="KDE Android CI" LABEL Description="KDE Android CI"
MAINTAINER Aleix Pol Gonzalez MAINTAINER Aleix Pol Gonzalez
......
FROM kdeorg/android-aarch64-kf5-sdk
LABEL Description="KDE Android CI"
MAINTAINER Aleix Pol Gonzalez
USER user
RUN export >> /home/user/.profile
USER root
RUN apt-get -qq update && apt-get install -qq \
openssh-server rsync \
&& dpkg-reconfigure openssh-server && mkdir -p /var/run/sshd && apt-get -qq clean
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
...@@ -3,24 +3,21 @@ FROM ubuntu:18.04 ...@@ -3,24 +3,21 @@ FROM ubuntu:18.04
# inspired by rabits/qt which we use for the gcc toolkit # inspired by rabits/qt which we use for the gcc toolkit
MAINTAINER Aleix Pol <aleixpol@kde.org> MAINTAINER Aleix Pol <aleixpol@kde.org>
ARG QT_VERSION=5.13.2 ARG QT_VERSION=5.14.1
ARG QT_TAG=v5.13.2 ARG QT_TAG=v5.14.1
ARG NDK_VERSION=r18b ARG NDK_VERSION=r20b
ARG SDK_PLATFORM=android-21 ARG SDK_PLATFORM=android-21
ARG SDK_BUILD_TOOLS=28.0.2 ARG SDK_BUILD_TOOLS=28.0.2
ARG SDK_PACKAGES="tools platform-tools" ARG SDK_PACKAGES="tools platform-tools"
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
ENV QT_PATH /opt/Qt ENV QT_PATH /opt/Qt
ENV QT_ANDROID ${QT_PATH}/${QT_VERSION}/android_aarch64
ENV ANDROID_ARCH=arm64
ENV ANDROID_ARCH_ABI=arm64-v8a
ENV ANDROID_HOME /opt/android-sdk ENV ANDROID_HOME /opt/android-sdk
ENV ANDROID_SDK_ROOT ${ANDROID_HOME} ENV ANDROID_SDK_ROOT ${ANDROID_HOME}
ENV ANDROID_NDK_ROOT /opt/android-ndk ENV ANDROID_NDK_ROOT /opt/android-ndk
ENV ANDROID_NDK_HOST linux-x86_64 ENV ANDROID_NDK_HOST linux-x86_64
ENV ANDROID_NDK_PLATFORM ${SDK_PLATFORM} ENV ANDROID_NDK_PLATFORM ${SDK_PLATFORM}
ENV PATH ${QT_ANDROID}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH} ENV PATH ${QT_PATH}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}
# Install updates & requirements: # Install updates & requirements:
# * unzip - unpack platform tools # * unzip - unpack platform tools
...@@ -56,8 +53,7 @@ RUN dpkg --add-architecture i386 && apt update && apt full-upgrade -y && apt ins ...@@ -56,8 +53,7 @@ RUN dpkg --add-architecture i386 && apt update && apt full-upgrade -y && apt ins
#build dependencies #build dependencies
rdfind \ rdfind \
python3-distutils \
#build dependencies
libxml-simple-perl \ libxml-simple-perl \
libjson-perl \ libjson-perl \
libio-socket-ssl-perl \ libio-socket-ssl-perl \
...@@ -101,22 +97,19 @@ RUN curl -Lo /tmp/sdk-tools.zip 'https://dl.google.com/android/repository/sdk-to ...@@ -101,22 +97,19 @@ RUN curl -Lo /tmp/sdk-tools.zip 'https://dl.google.com/android/repository/sdk-to
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" \ 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" \
&& unzip -q ndk.zip && mv android-ndk-* $ANDROID_NDK_ROOT && chmod -R +rX $ANDROID_NDK_ROOT \ && unzip -q ndk.zip && mv android-ndk-* $ANDROID_NDK_ROOT && chmod -R +rX $ANDROID_NDK_ROOT \
&& rm -rf /tmp/android \ && rm -rf /tmp/android \
&& ls -d1 /opt/android-ndk/platforms/*/* | grep -v $ANDROID_ARCH\$ | xargs rm -rf \
&& rdfind /opt/android-ndk/ -makehardlinks true -makeresultsfile false && rdfind /opt/android-ndk/ -makehardlinks true -makeresultsfile false
RUN mkdir /opt/kdeandroid-deps
COPY build-openssl /opt/helpers/ COPY build-openssl /opt/helpers/
RUN bash /opt/helpers/build-openssl android-arm64 RUN bash /opt/helpers/build-openssl
RUN export OPENSSL_LIBS='-L/opt/kdeandroid-deps/lib -lssl -lcrypto' && \ RUN export OPENSSL_LIBS='-L/opt/kdeandroid-arm/lib -lssl -lcrypto' && \
cd && git clone git://code.qt.io/qt/qt5.git --single-branch --branch ${QT_TAG} && \ cd && git clone git://code.qt.io/qt/qt5.git --single-branch --branch ${QT_TAG} && \
cd qt5 && \ cd qt5 && \
./init-repository && \ ./init-repository && \
./configure -xplatform android-clang --disable-rpath -openssl-linked -nomake tests -nomake examples -android-ndk /opt/android-ndk -android-sdk /opt/android-sdk -android-arch $ANDROID_ARCH_ABI -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 && \ ./configure -xplatform android-clang -openssl-runtime -nomake tests -nomake examples -android-ndk /opt/android-ndk -android-sdk /opt/android-sdk -android-abis armeabi-v7a,arm64-v8a -skip qtquick3d -skip qttranslations -skip qtserialport -skip qtwebengine -no-warnings-are-errors -opensource -confirm-license -prefix $QT_PATH -I/opt/kdeandroid-arm/include && \
make -j`nproc` && \ make -j`nproc` && \
make -j`nproc` install && \ make -j`nproc` install && \
cd .. && rm -rf qt5 cd .. && rm -rf qt5
########################## ##########################
RUN mkdir /opt/nativetooling RUN mkdir /opt/nativetooling
...@@ -131,63 +124,50 @@ RUN mkdir -p /opt/cmake \ ...@@ -131,63 +124,50 @@ RUN mkdir -p /opt/cmake \
ENV PATH="/opt/cmake/bin:${PATH}" ENV PATH="/opt/cmake/bin:${PATH}"
# makes sure gradle is downloaded, otherwise it will be downloaded every time # makes sure gradle is downloaded, otherwise it will be downloaded every time
RUN $QT_ANDROID/src/3rdparty/gradle/gradlew RUN $QT_PATH/src/3rdparty/gradle/gradlew
# compile kf5 tooling # compile kf5 tooling
RUN cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase \ RUN cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase \
&& ./configure -prefix /opt/nativetooling -opensource -confirm-license -no-gui -release -optimize-size -nomake tests -nomake examples -no-feature-concurrent \ && ./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 && make -j`nproc` && make install && rm -rf ~/qtbase
# QtQml Needed for native tooling (ki18n) # QtQml Needed for native tooling (ki18n)
RUN cd && git clone git://code.qt.io/qt/qtdeclarative.git --single-branch --branch ${QT_TAG} && cd qtdeclarative \ RUN cd && git clone git://code.qt.io/qt/qtdeclarative.git --single-branch --branch ${QT_TAG} && cd qtdeclarative \
&& QMAKESPEC=linux-g++ /opt/nativetooling/bin/qmake . && make -j`nproc` && make install && rm -rf ~/qtdeclarative && QMAKESPEC=linux-g++ /opt/nativetooling/bin/qmake . && make -j`nproc` && make install && rm -rf ~/qtdeclarative
# Replace androiddeployqt with dev, which has a bunch of patches we need (at least until Qt 5.12) COPY build-cmake-native git-clone-macro.sh /opt/helpers/
#RUN cd && mkdir androiddeployqt && cd androiddeployqt \
# && wget https://code.qt.io/cgit/qt/qtbase.git/plain/src/tools/androiddeployqt/main.cpp?h=dev -O main.cpp \
# && echo "cmake_minimum_required(VERSION 3.11)\n\
# find_package(Qt5Core REQUIRED)\n\
# add_executable(androiddeployqt main.cpp)\n\
# target_link_libraries(androiddeployqt Qt5::Core)\n" > CMakeLists.txt && cmake . -DQt5Core_DIR=/opt/nativetooling/lib/cmake/Qt5Core && make && cp androiddeployqt ${QT_ANDROID}/bin/androiddeployqt \
# && cd && rm -rf androiddeployqt
COPY build-cmake-native /opt/helpers/
ENV PERSIST=0 ENV PERSIST=0
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 PATCH="https://phabricator.kde.org/file/data/elu6q5nb3zvkbhzs6vhz/PHID-FILE-64vz4au7ak35memxcifn/D26749.diff" /opt/helpers/build-cmake-native extra-cmake-modules kde:extra-cmake-modules -DCMAKE_INSTALL_PREFIX=/opt/nativetooling -DCMAKE_PREFIX_PATH="$QT_PATH;/opt/nativetooling" -DANDROID_ABI=arm64-v8a
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 kconfig kde:kconfig -DCMAKE_INSTALL_PREFIX=/opt/nativetooling -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_PREFIX_PATH=/opt/nativetooling -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 RUN /opt/helpers/build-cmake-native kcoreaddons kde:kcoreaddons -DCMAKE_INSTALL_PREFIX=/opt/nativetooling -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_PREFIX_PATH=/opt/nativetooling -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=ON
COPY build-standalone build-cmake /opt/helpers/ COPY build-cmake /opt/helpers/
ENV STANDALONE_CC=clang ENV STANDALONE_EXTRA="--stl=libc++"
ENV STANDALONE_CXX=clang++
ENV STANDALONE_EXTRA="--stl=libc++ --arch=$ANDROID_ARCH"
ENV ANDROID_NDK_TOOLCHAIN_PREFIX=aarch64-linux-android
#build expat #build expat
RUN cd && git clone https://github.com/libexpat/libexpat.git --single-branch && cd libexpat/expat \ RUN EXTRA_CMAKE_SUBDIR=expat /opt/helpers/build-cmake libexpat https://github.com/libexpat/libexpat.git
&& /opt/helpers/build-standalone "./buildconf.sh && ./configure --prefix=/opt/kdeandroid-deps --host=${ANDROID_NDK_TOOLCHAIN_PREFIX} && cd lib && make -j`nproc` && make install" \
&& cd ../.. && rm -rf libexpat
#build dbus #build dbus
RUN EXTRA_CMAKE_SUBDIR=cmake GIT_EXTRA="--branch dbus-1.12.16" /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 RUN EXTRA_CMAKE_SUBDIR=cmake GIT_EXTRA="--branch dbus-1.12.16" /opt/helpers/build-cmake dbus git://anongit.freedesktop.org/git/dbus/dbus
#build qtdbus #build qtdbus
RUN 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 \ RUN sed -i.bak "s|#define QT_NO_DBUS|//#define QT_NO_DBUS //we install it separate from the SDK|g" $QT_PATH/include/QtCore/qconfig.h \
&& sed -i.bak "s/QT_FEATURE_dbus -1/QT_FEATURE_dbus 1/g" $QT_ANDROID/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \ && sed -i.bak "s/QT_FEATURE_dbus -1/QT_FEATURE_dbus 1/g" $QT_PATH/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \
&& 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 \ && sed -i.bak "s/QT_FEATURE_dbus_linked -1/QT_FEATURE_dbus_linked 1/g" $QT_PATH/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \
&& cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase/src/dbus && qmake && make -j`nproc` && make install && cd && rm -rf qtbase \ && cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase/src/dbus && qmake && make -j`nproc` && make install && cd && rm -rf qtbase \
&& ln -s /opt/nativetooling/bin/qdbusxml2cpp $QT_ANDROID/bin/ \ && ln -s /opt/nativetooling/bin/qdbusxml2cpp $QT_PATH/bin/ \
&& ln -s /opt/nativetooling/bin/qdbuscpp2xml $QT_ANDROID/bin/ && ln -s /opt/nativetooling/bin/qdbuscpp2xml $QT_PATH/bin/
# needs to be after building qt, otherwise it breaks weirdly # needs to be after building qt, otherwise it breaks weirdly
ENV QMAKESPEC android-clang ENV QMAKESPEC android-clang
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
COPY build-qt build-generic build-eigen build-poppler build-vlcqt build-gstreamer-binaries build-kde-dependencies build-kde-project create-apk get-apk-args \ COPY build-qt build-generic build-eigen build-poppler build-vlcqt build-gstreamer-binaries build-kde-dependencies build-kde-project create-apk get-apk-args \
target-from-manifest.py target-from-appdata.py cp-with-prefix skip build-discount 0001-Hack-Use-mktags-from-native-build-when-crosscompilin.patch /opt/helpers/ target-from-manifest.py target-from-appdata.py cp-with-prefix skip build-standalone build-discount 0001-Hack-Use-mktags-from-native-build-when-crosscompilin.patch /opt/helpers/
RUN sed -i.bak 's/android:minSdkVersion="16"/android:minSdkVersion="21"/g' $QT_ANDROID/src/android/templates/AndroidManifest.xml \ RUN sed -i.bak 's/android:minSdkVersion="16"/android:minSdkVersion="21"/g' $QT_PATH/src/android/templates/AndroidManifest.xml \
&& sed -i.bak 's/|density//g' $QT_ANDROID/src/android/templates/AndroidManifest.xml && sed -i.bak 's/|density//g' $QT_PATH/src/android/templates/AndroidManifest.xml
ENV LANG=en_US.UTF-8 ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8 ENV LANGUAGE=en_US.UTF-8
......
FROM ubuntu:18.04
# inspired by rabits/qt which we use for the gcc toolkit
MAINTAINER Aleix Pol <aleixpol@kde.org>
ARG QT_VERSION=5.13.2
ARG QT_TAG=v5.13.2
ARG NDK_VERSION=r18b
ARG SDK_PLATFORM=android-21
ARG SDK_BUILD_TOOLS=28.0.2
ARG SDK_PACKAGES="tools platform-tools"
ENV DEBIAN_FRONTEND noninteractive
ENV QT_PATH /opt/Qt
ENV QT_ANDROID ${QT_PATH}/${QT_VERSION}/android_armv7
ENV ANDROID_ARCH=arm
ENV ANDROID_ARCH_ABI=armeabi-v7a
ENV ANDROID_HOME /opt/android-sdk
ENV ANDROID_SDK_ROOT ${ANDROID_HOME}
ENV ANDROID_NDK_ROOT /opt/android-ndk
ENV ANDROID_NDK_HOST linux-x86_64
ENV ANDROID_NDK_PLATFORM ${SDK_PLATFORM}
ENV PATH ${QT_ANDROID}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}
# Install updates & requirements:
# * unzip - unpack platform tools
# * git, openssh-client, ca-certificates - clone & build
# * locales, sudo - useful to set utf-8 locale & sudo usage
# * curl - to download Qt bundle
# * make, openjdk-8-jdk, ant - basic build requirements
# * libsm6, libice6, libxext6, libxrender1, libfontconfig1, libdbus-1-3 - dependencies of Qt bundle run-file
# * libc6:i386, libncurses5:i386, libstdc++6:i386, libz1:i386 - dependencides of android sdk binaries
RUN dpkg --add-architecture i386 && apt update && apt full-upgrade -y && apt install -y --no-install-recommends \
unzip \
git \
openssh-client \
ca-certificates \
locales \
sudo \
curl \
make \
openjdk-8-jdk \
ant \
build-essential \
python3 \
libsm6 \
libice6 \
libxext6 \
libxrender1 \
libfontconfig1 \
libdbus-1-3 \
libc6:i386 \
libncurses5:i386 \
libstdc++6:i386 \
libz1:i386 \
#build dependencies
rdfind \
#build dependencies
libxml-simple-perl \
libjson-perl \
libio-socket-ssl-perl \
libyaml-perl libyaml-libyaml-perl \
ninja-build \
build-essential \
gperf gettext \
python3 python3-paramiko python3-lxml python3-yaml \
bison flex \
ruby wget \
#for dbus/expat
automake libtool autoconf autoconf-archive pkg-config \
#for translations
subversion gnupg2 \
#for karchive
zlib1g-dev \
&& apt-get -qq clean \
&& locale-gen en_US.UTF-8 && dpkg-reconfigure locales \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10
##########################
RUN chmod a+w /opt/
# Add group & user
RUN groupadd -r user && useradd --create-home --gid user user && echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers.d/user
USER user
WORKDIR /home/user
ENV HOME /home/user
##########################
# Download & unpack android SDK
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
RUN curl -Lo /tmp/sdk-tools.zip 'https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip' \
&& mkdir -p /opt/android-sdk && unzip -q /tmp/sdk-tools.zip -d /opt/android-sdk && rm -f /tmp/sdk-tools.zip \
&& yes | sdkmanager --licenses && sdkmanager --verbose "platforms;${SDK_PLATFORM}" "build-tools;${SDK_BUILD_TOOLS}" ${SDK_PACKAGES}
# Download & unpack android NDK
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" \
&& unzip -q ndk.zip && mv android-ndk-* $ANDROID_NDK_ROOT && chmod -R +rX $ANDROID_NDK_ROOT \
&& rm -rf /tmp/android \
&& ls -d1 /opt/android-ndk/platforms/*/* | grep -v $ANDROID_ARCH\$ | xargs rm -rf \
&& rdfind /opt/android-ndk/ -makehardlinks true -makeresultsfile false
RUN mkdir /opt/kdeandroid-deps
COPY build-openssl /opt/helpers/
RUN bash /opt/helpers/build-openssl android-arm
RUN export OPENSSL_LIBS='-L/opt/kdeandroid-deps/lib -lssl -lcrypto' && \
cd && git clone git://code.qt.io/qt/qt5.git --single-branch --branch ${QT_TAG} && \
cd qt5 && \
./init-repository && \
./configure -xplatform android-clang --disable-rpath -openssl-linked -nomake tests -nomake examples -android-ndk /opt/android-ndk -android-sdk /opt/android-sdk -android-arch $ANDROID_ARCH_ABI -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 && \
make -j`nproc` && \
make -j`nproc` install && \
cd .. && rm -rf qt5
##########################
RUN mkdir /opt/nativetooling
ENV ANDROID_NDK $ANDROID_NDK_ROOT
COPY gitconfig $HOME/.gitconfig
RUN mkdir -p /opt/cmake \
&& curl -Lo /tmp/cmake.sh https://cmake.org/files/v3.16/cmake-3.16.1-Linux-x86_64.sh \
&& bash /tmp/cmake.sh --skip-license --prefix=/opt/cmake --exclude-subdir \
&& rm /tmp/cmake.sh
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
# compile kf5 tooling
RUN cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase \
&& ./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
# QtQml Needed for native tooling (ki18n)
RUN cd && git clone git://code.qt.io/qt/qtdeclarative.git --single-branch --branch ${QT_TAG} && cd qtdeclarative \
&& QMAKESPEC=linux-g++ /opt/nativetooling/bin/qmake . && make -j`nproc` && make install && rm -rf ~/qtdeclarative
# Replace androiddeployqt with dev, which has a bunch of patches we need (at least until Qt 5.12)
#RUN cd && mkdir androiddeployqt && cd androiddeployqt \
# && wget https://code.qt.io/cgit/qt/qtbase.git/plain/src/tools/androiddeployqt/main.cpp?h=dev -O main.cpp \
# && echo "cmake_minimum_required(VERSION 3.11)\n\
# find_package(Qt5Core REQUIRED)\n\
# add_executable(androiddeployqt main.cpp)\n\
# target_link_libraries(androiddeployqt Qt5::Core)\n" > CMakeLists.txt && cmake . -DQt5Core_DIR=/opt/nativetooling/lib/cmake/Qt5Core && make && cp androiddeployqt ${QT_ANDROID}/bin/androiddeployqt \
# && cd && rm -rf androiddeployqt
COPY build-cmake-native /opt/helpers/
ENV PERSIST=0
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++ --arch=$ANDROID_ARCH"
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 \
&& /opt/helpers/build-standalone "./buildconf.sh && ./configure --prefix=/opt/kdeandroid-deps --host=${ANDROID_NDK_TOOLCHAIN_PREFIX} && cd lib && make -j`nproc` && make install" \
&& cd ../.. && rm -rf libexpat
#build dbus
RUN EXTRA_CMAKE_SUBDIR=cmake GIT_EXTRA="--branch dbus-1.12.16" /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
#build qtdbus
RUN 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 \
&& sed -i.bak "s/QT_FEATURE_dbus -1/QT_FEATURE_dbus 1/g" $QT_ANDROID/include/QtCore/${QT_VERSION}/QtCore/private/qconfig_p.h \
&& 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 \
&& cd && git clone git://code.qt.io/qt/qtbase.git --single-branch --branch ${QT_TAG} && cd qtbase/src/dbus && qmake && make -j`nproc` && make install && cd && rm -rf qtbase \
&& ln -s /opt/nativetooling/bin/qdbusxml2cpp $QT_ANDROID/bin/ \
&& ln -s /opt/nativetooling/bin/qdbuscpp2xml $QT_ANDROID/bin/
# needs to be after building qt, otherwise it breaks weirdly
ENV QMAKESPEC android-clang
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
COPY build-qt build-generic build-eigen build-poppler build-vlcqt build-gstreamer-binaries build-kde-dependencies build-kde-project create-apk get-apk-args \
target-from-manifest.py target-from-appdata.py cp-with-prefix skip build-discount 0001-Hack-Use-mktags-from-native-build-when-crosscompilin.patch /opt/helpers/
RUN sed -i.bak 's/android:minSdkVersion="16"/android:minSdkVersion="21"/g' $QT_ANDROID/src/android/templates/AndroidManifest.xml \
&& sed -i.bak 's/|density//g' $QT_ANDROID/src/android/templates/AndroidManifest.xml
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV PERSIST=1
FROM kdeorg/android-arm-sdk FROM kdeorg/android-sdk
RUN /opt/helpers/build-kde-dependencies kf5umbrella && rm -rf src/* && rm -rf build/* RUN /opt/helpers/build-kde-dependencies kf5umbrella && rm -rf src/* && rm -rf build/*
RUN cat /opt/helpers/skip /tmp/built > /tmp/newskip && sudo mv /tmp/newskip /opt/helpers/ RUN cat /opt/helpers/skip /tmp/built > /tmp/newskip && sudo mv /tmp/newskip /opt/helpers/
FROM kdeorg/android-aarch64-sdk
RUN /opt/helpers/build-kde-dependencies kf5umbrella && rm -rf src/* && rm -rf build/*
RUN cat /opt/helpers/skip /tmp/built > /tmp/newskip && sudo mv /tmp/newskip /opt/helpers/
...@@ -11,11 +11,27 @@ shift ...@@ -11,11 +11,27 @@ shift
ARGS= ARGS=
export ANDROID_ARCH=arm64
export ANDROID_ARCH_ABI=arm64-v8a
export BUILD=build-$ANDROID_ARCH
$DIR/build-cmake-native $name $url \ $DIR/build-cmake-native $name $url \
-DCMAKE_INSTALL_PREFIX=${APP_INSTALL_PREFIX-"/opt/kdeandroid-deps"} \ -DCMAKE_INSTALL_PREFIX=${APP_INSTALL_PREFIX-"/opt/kdeandroid-$ANDROID_ARCH"} \
-DCMAKE_PREFIX_PATH="$QT_ANDROID;/opt/kdeandroid-deps;$APP_INSTALL_PREFIX;$EXTRA_PREFIXES" \ -DCMAKE_PREFIX_PATH="$QT_PATH;/opt/kdeandroid-$ANDROID_ARCH;$APP_INSTALL_PREFIX;$EXTRA_PREFIXES" \
-DCMAKE_BUILD_TYPE=debug \ -DCMAKE_BUILD_TYPE=debug \
-DCMAKE_TOOLCHAIN_FILE=/opt/kdeandroid-deps/share/ECM/toolchain/Android.cmake \ -DCMAKE_TOOLCHAIN_FILE=/opt/nativetooling/share/ECM/toolchain/Android.cmake \
-DCMAKE_ANDROID_API=${ANDROID_NDK_PLATFORM:8} \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DKF5_HOST_TOOLING=/opt/nativetooling/lib/x86_64-linux-gnu/cmake/ \
$@
export ANDROID_ARCH=arm
export ANDROID_ARCH_ABI=armeabi-v7a
export BUILD=build-$ANDROID_ARCH
$DIR/build-cmake-native $name $url \
-DCMAKE_INSTALL_PREFIX=${APP_INSTALL_PREFIX-"/opt/kdeandroid-$ANDROID_ARCH"} \
-DCMAKE_PREFIX_PATH="$QT_PATH;/opt/kdeandroid-$ANDROID_ARCH;$APP_INSTALL_PREFIX;$EXTRA_PREFIXES" \
-DCMAKE_BUILD_TYPE=debug \
-DCMAKE_TOOLCHAIN_FILE=/opt/nativetooling/share/ECM/toolchain/Android.cmake \
-DCMAKE_ANDROID_API=${ANDROID_NDK_PLATFORM:8} \ -DCMAKE_ANDROID_API=${ANDROID_NDK_PLATFORM:8} \
-DCMAKE_ANDROID_STL_TYPE=c++_shared \ -DCMAKE_ANDROID_STL_TYPE=c++_shared \
-DKF5_HOST_TOOLING=/opt/nativetooling/lib/x86_64-linux-gnu/cmake/ \ -DKF5_HOST_TOOLING=/opt/nativetooling/lib/x86_64-linux-gnu/cmake/ \
......
...@@ -7,16 +7,12 @@ shift ...@@ -7,16 +7,12 @@ shift
repo=$1 repo=$1
shift shift
srcdir="`pwd`/src" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cloned=0
if ! [ -d "$srcdir"/$name ] ; then
mkdir -p "$srcdir"
pushd "$srcdir"
git clone --depth 1 $repo --single-branch $GIT_EXTRA
cloned=1
popd
fi
source $DIR/git-clone-macro.sh
git-clone $name $repo
srcdir="`pwd`/src"
BUILDROOT=${BUILD:-build} BUILDROOT=${BUILD:-build}
mkdir $BUILDROOT/$name -p mkdir $BUILDROOT/$name -p
......
...@@ -7,8 +7,8 @@ export PATH=$DIR:$PATH ...@@ -7,8 +7,8 @@ export PATH=$DIR:$PATH
mkdir -p $HOME/src/eigen mkdir -p $HOME/src/eigen
cd $HOME/src/ cd $HOME/src/
wget -c https://bitbucket.org/eigen/eigen/get/3.3.4.tar.bz2 wget -c https://bitbucket.org/eigen/eigen/get/3.3.7.tar.bz2
tar xf 3.3.4.tar.bz2 -C eigen --strip-components 1 tar xf 3.3.7.tar.bz2 -C eigen --strip-components 1
cd $HOME cd $HOME
build-cmake eigen does:not:matter build-cmake eigen does:not:matter
#!/bin/bash #!/bin/bash
set -e set -e
case $ANDROID_ARCH in wget -c https://gstreamer.freedesktop.org/data/pkg/android/1.16.2/gstreamer-1.0-android-universal-1.16.2.tar.xz
arm)
ARCH=armv7
;;
*)
ARCH=$ANDROID_ARCH
esac
wget -c https://gstreamer.freedesktop.org/data/pkg/android/1.16.1/gstreamer-1.0-android-universal-1.16.1.tar.xz function install_arch
tar xvf gstreamer-1.0-android-universal-1.16.1.tar.xz $ARCH {
rm -rf */share/gst-android/ndk-build tar xvf gstreamer-1.0-android-universal-1.16.2.tar.xz $1
# rm */lib/libintl.a */include/libintl.h rm -rf */share/gst-android/ndk-build
sed -i.bak -e "s|^prefix=.*|prefix=/opt/kdeandroid-deps|g" $ARCH/lib/pkgconfig/*.pc #fix prefix # rm */lib/libintl.a */include/libintl.h
sed -i.bak -e "s|/home/nirbheek/projects/repos/cerbero.git/1.16/build/dist/android_universal/$ARCH|/opt/kdeandroid-deps|g" $ARCH/lib/pkgconfig/*.pc sed -i.bak -e "s|^prefix=.*|prefix=/opt/kdeandroid-$2|g" $1/lib/pkgconfig/*.pc #fix prefix
sed -i.bak -e "s|/home/nirbheek/projects/repos/cerbero.git/1.16/build/android-ndk-18|/opt/android-ndk|g" $ARCH/lib/pkgconfig/*.pc sed -i.bak -e "s|/home/nirbheek/projects/repos/cerbero.git/1.16/build/dist/android_universal/$1|/opt/kdeandroid-$2|g" $1/lib/pkgconfig/*.pc
cp -r $ARCH/* /opt/kdeandroid-deps/ sed -i.bak -e "s|/home/nirbheek/projects/repos/cerbero.git/1.16/build/android-ndk-18|/opt/android-ndk|g" $1/lib/pkgconfig/*.pc
cp -r $1/* /opt/kdeandroid-$2/
git clone --depth 1 git://anongit.freedesktop.org/gstreamer/gst-plugins-good || true git clone --depth 1 git://anongit.freedesktop.org/gstreamer/gst-plugins-good || true
cd gst-plugins-good/ext/qt pushd gst-plugins-good/ext/qt
git clean -fx
export PKG_CONFIG_SYSROOT_DIR=/ export PKG_CONFIG_SYSROOT_DIR=/
export PKG_CONFIG_LIBDIR=/opt/kdeandroid-deps/lib/pkgconfig/ export PKG_CONFIG_LIBDIR=/opt/kdeandroid-$2/lib/pkgconfig/
qmake qmake
make make $3 -j`nproc`
install libgstqmlgl.a /opt/kdeandroid-deps/lib/gstreamer-1.0 install libgstqmlgl.a /opt/kdeandroid-$2/lib/gstreamer-1.0
popd
}
install_arch armv7 arm armeabi-v7a
install_arch arm64 arm64 arm64-v8a
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
set -e set -e
function build
{
git clone --depth 1 https://github.com/openssl/openssl.git --branch OpenSSL_1_1_1b git clone --depth 1 https://github.com/openssl/openssl.git --branch OpenSSL_1_1_1b
# git clone --depth 1 git://git.openssl.org/openssl.git --branch OpenSSL_1_1_1b # git clone --depth 1 git://git.openssl.org/openssl.git --branch OpenSSL_1_1_1b
...@@ -10,9 +12,13 @@ pushd openssl ...@@ -10,9 +12,13 @@ pushd openssl
export PATH=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH export PATH=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH
export ANDROID_NDK=$ANDROID_NDK_ROOT export ANDROID_NDK=$ANDROID_NDK_ROOT
./Configure $@ -D__ANDROID_API__=${ANDROID_API-21} --prefix=/opt/kdeandroid-deps ./Configure android-$1 -D__ANDROID_API__=${ANDROID_API-21} --prefix=/opt/kdeandroid-$1
make build_libs -j`nproc` SHLIB_VERSION_NUMBER= SHLIB_EXT=.so make build_libs -j`nproc` SHLIB_VERSION_NUMBER= SHLIB_EXT=.so
make install_sw SHLIB_VERSION_NUMBER= SHLIB_EXT=.so make install_sw SHLIB_VERSION_NUMBER= SHLIB_EXT=.so
popd popd
rm -rf openssl rm -rf openssl
}
build arm
build arm64
...@@ -7,15 +7,15 @@ export PATH=$DIR:$PATH ...@@ -7,15 +7,15 @@ export PATH=$DIR:$PATH
mkdir -p $HOME/src/ mkdir -p $HOME/src/
cd $HOME/src/ cd $HOME/src/
if [ ! -d freetype2 ] ; then source $DIR/git-clone-macro.sh
git clone --depth 1 https://git.sv.nongnu.org/r/freetype/freetype2.git --single-branch -b VER-2-10-1 GIT_EXTRA="--branch VER-2-10-1" git-clone freetype2 https://git.sv.nongnu.org/r/freetype/freetype2.git
fi cd src/freetype2
cd freetype2 CFLAGS="-std=gnu99" STANDALONE_EXTRA="--arch=arm" bash -x build-standalone "./autogen.sh && ./configure --prefix=/opt/kdeandroid-arm --host=arm-linux-androideabi && make -j`nproc` && make install"
CFLAGS=-std=gnu99 build-standalone "./autogen.sh && ./configure --prefix=/opt/kdeandroid-deps --host=${ANDROID_NDK_TOOLCHAIN_PREFIX} && make -j`nproc` && make install" CFLAGS="-std=gnu99" STANDALONE_EXTRA="--arch=arm64" bash -x build-standalone "./autogen.sh && ./configure --prefix=/opt/kdeandroid-arm64 --host=aarch64-linux-android && make -j`nproc` && make install"
cd $HOME/src cd $HOME/src
if ! [ -d "poppler" ] ; then if ! [ -d "poppler" ] ; then
git clone git://anongit.freedesktop.org/poppler/poppler git clone git://anongit.freedesktop.org/poppler/poppler --depth 1
fi fi
cd poppler cd poppler
git checkout $(git describe --abbrev=0 --tags) git checkout $(git describe --abbrev=0 --tags)
......
...@@ -7,13 +7,15 @@ shift ...@@ -7,13 +7,15 @@ shift
repo=$1 repo=$1
shift shift