Commit 9f782ef5 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

RFC: Dockerfile based on Qt 5.12 and clang

Summary:
Instead of bringing the Qt binaries it builds our own.
It also finally solves some annoyances like including openssl by default.

Test Plan: I plan to test it, haven't tested yet.

Differential Revision: https://phabricator.kde.org/D18173
parent 44b602dc
Pipeline #903 skipped with stage
......@@ -65,7 +65,8 @@ RUN dpkg --add-architecture i386 && apt update && apt full-upgrade -y && apt ins
automake libtool autoconf autoconf-archive pkg-config \
#for translations
subversion gnupg2 \
&& apt-get -qq clean
&& apt-get -qq clean \
&& locale-gen en_US.UTF-8 && dpkg-reconfigure locales
# Download & unpack android SDK
RUN curl -Lo /tmp/sdk-tools.zip 'https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip' \
......@@ -77,29 +78,34 @@ RUN mkdir /tmp/android && cd /tmp/android && curl -Lo ndk.zip "https://dl.google
&& unzip -q ndk.zip && mv android-ndk-* $ANDROID_NDK_ROOT && chmod -R +rX $ANDROID_NDK_ROOT \
&& rm -rf /tmp/android
RUN 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 -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 && \
make -j`nproc` && \
make -j`nproc` install && \
cd .. && rm -rf qt5
##########################
# Reconfigure locale
RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales
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
##########################
RUN chmod a+w /opt/
USER user
WORKDIR /home/user
ENV HOME /home/user
##########################
RUN mkdir /opt/kdeandroid-deps
COPY build-openssl-uptodate /opt/helpers/
RUN bash /opt/helpers/build-openssl-uptodate
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 -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
......@@ -148,8 +154,7 @@ RUN cd && git clone https://github.com/libexpat/libexpat.git --single-branch &&
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
#build qtdbus
RUN unset ANDROID_NDK_TOOLCHAIN_VERSION \
&& 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 \
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 \
&& 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 \
&& 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 \
&& 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 \
......@@ -159,13 +164,9 @@ RUN unset ANDROID_NDK_TOOLCHAIN_VERSION \
# 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 build-kde-dependencies build-kde-project skip /opt/helpers/
COPY build-qt build-generic build-eigen build-poppler target-from-manifest.py target-from-appdata.py build-kde-dependencies build-kde-project skip /opt/helpers/
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
USER user
WORKDIR /home/user
ENV HOME /home/user
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
#!/bin/bash
set -e
git clone git://git.openssl.org/openssl.git --branch OpenSSL_1_1_1a
pushd openssl
export PATH=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH
export ANDROID_NDK=$ANDROID_NDK_ROOT
./Configure android-arm -D__ANDROID_API__=21 --prefix=/opt/kdeandroid-deps
make build_libs -j`nproc` SHLIB_VERSION_NUMBER= SHLIB_EXT=.so
make install_sw SHLIB_VERSION_NUMBER= SHLIB_EXT=.so
popd
rm -rf openssl
......@@ -15,4 +15,8 @@ CFLAGS=-std=gnu99 build-standalone "./autogen.sh && ./configure --prefix=/opt/kd
cd
#we could build for older than 24 if we pass HAVE_FSEEKO=0
GIT_EXTRA="--branch poppler-0.68.0" build-cmake poppler git://anongit.freedesktop.org/poppler/poppler -DENABLE_DCTDECODER=unmaintained -DENABLE_LIBOPENJPEG=unmaintained -DENABLE_CPP=OFF -DCMAKE_ANDROID_API=24 $@
if [ "$QMAKESPEC" -ne android-clang ] ; then
export GIT_EXTRA="--branch poppler-0.68.0"
fi
build-cmake poppler git://anongit.freedesktop.org/poppler/poppler -DENABLE_DCTDECODER=unmaintained -DENABLE_LIBOPENJPEG=unmaintained -DENABLE_CPP=OFF -DCMAKE_ANDROID_API=24 -DBUILD_QT5_TESTS=OFF -DENABLE_UTILS=OFF $@
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