2022-07-25 13:02:14 +02:00
|
|
|
FROM ubuntu:22.04
|
|
|
|
|
|
|
|
ARG QT_EVERYWHERE_URL="https://download.qt.io/archive/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.tar.xz"
|
|
|
|
ARG QT_VERSION_FAMILY="5.15"
|
|
|
|
ARG QT_VERSION="5.15.5"
|
|
|
|
ARG ANDROID_PLATFORM_VERSION="android-29"
|
|
|
|
ARG ANDROID_BUILDTOOLS_VERSION="29.0.2"
|
|
|
|
ARG ANDROID_NDK_VERSION="21.3.6528147"
|
|
|
|
|
|
|
|
WORKDIR /workspace
|
|
|
|
|
2022-07-26 23:41:24 +02:00
|
|
|
RUN echo "**** setup environment ****" && \
|
|
|
|
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 && \
|
2022-07-28 08:18:52 +02:00
|
|
|
export QT_INSTALL_DIR=/usr/lib/qt && \
|
|
|
|
export PATH=$QT_INSTALL_DIR/bin:$JAVA_HOME/bin:$PATH && \
|
2022-07-25 13:02:14 +02:00
|
|
|
export QT_EVERYWHERE_URL="https://download.qt.io/archive/qt/${QT_VERSION_FAMILY}/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz" && \
|
|
|
|
export ANDROID_CLI_TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip" && \
|
2022-07-26 23:41:24 +02:00
|
|
|
\
|
|
|
|
echo "**** install dependencies ****" && \
|
2022-07-26 23:38:57 +02:00
|
|
|
dpkg --add-architecture i386 && \
|
2022-07-25 13:02:14 +02:00
|
|
|
apt-get update && \
|
2022-07-26 23:38:57 +02:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y wget openjdk-8-jdk tar xz-utils unzip libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 make g++ perl python3 git '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev flex bison gperf libicu-dev libxslt-dev ruby libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libxtst-dev libxss-dev libdbus-1-dev libevent-dev libfontconfig1-dev libcap-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libegl1-mesa-dev gperf bison nodejs libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev && \
|
2022-07-26 23:47:50 +02:00
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
2022-07-26 23:38:57 +02:00
|
|
|
\
|
2022-07-25 13:02:14 +02:00
|
|
|
echo "**** download Qt and android-cli-tools ****" && \
|
|
|
|
wget -O qt-everywhere.tar.xz ${QT_EVERYWHERE_URL} && \
|
|
|
|
wget -O android-cli-tools.zip ${ANDROID_CLI_TOOLS_URL} && \
|
2022-07-26 23:38:57 +02:00
|
|
|
\
|
2022-07-25 13:02:14 +02:00
|
|
|
echo "**** extract Qt and android-cli-tools ****" && \
|
|
|
|
mkdir qt-everywhere && \
|
|
|
|
tar -xf qt-everywhere.tar.xz --strip-components=1 -C ./qt-everywhere && \
|
|
|
|
unzip android-cli-tools.zip && \
|
2022-07-26 23:38:57 +02:00
|
|
|
\
|
2022-07-25 13:02:14 +02:00
|
|
|
echo "**** install android sdk ****" && \
|
|
|
|
echo "y" | ./cmdline-tools/bin/sdkmanager --sdk_root=/usr/lib/android-sdk --install "platform-tools" "platforms;${ANDROID_PLATFORM_VERSION}" "build-tools;${ANDROID_BUILDTOOLS_VERSION}" "ndk;${ANDROID_NDK_VERSION}" && \
|
2022-07-26 23:38:57 +02:00
|
|
|
\
|
|
|
|
echo "**** configure Qt ****" && \
|
2022-07-25 13:02:14 +02:00
|
|
|
mkdir build-qt && cd build-qt && \
|
2022-07-27 00:08:21 +02:00
|
|
|
/workspace/qt-everywhere/configure \
|
2022-07-28 08:18:52 +02:00
|
|
|
-prefix $QT_INSTALL_DIR \
|
2022-07-27 00:08:21 +02:00
|
|
|
-opensource \
|
|
|
|
-confirm-license \
|
|
|
|
-release \
|
|
|
|
-xplatform android-clang \
|
|
|
|
-disable-rpath \
|
|
|
|
-nomake tests -nomake examples \
|
|
|
|
-android-ndk /usr/lib/android-sdk/ndk/${ANDROID_NDK_VERSION} \
|
|
|
|
-android-sdk /usr/lib/android-sdk \
|
|
|
|
-no-warnings-are-errors && \
|
2022-07-26 23:38:57 +02:00
|
|
|
\
|
|
|
|
echo "**** build and install Qt ****" && \
|
2022-07-25 13:39:21 +02:00
|
|
|
make -j8 && \
|
|
|
|
make install && \
|
2022-07-26 23:38:57 +02:00
|
|
|
\
|
2022-07-25 13:39:21 +02:00
|
|
|
echo "**** clean up ****" && \
|
2022-07-26 23:38:57 +02:00
|
|
|
cd / && \
|
|
|
|
rm -rf workspace && \
|
2022-07-25 13:39:21 +02:00
|
|
|
echo "**** done ****"
|
|
|
|
|
2022-07-28 11:45:04 +02:00
|
|
|
ENV PATH="${PATH}:/usr/lib/qt/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin"
|
2022-07-26 23:38:57 +02:00
|
|
|
WORKDIR /src
|
2022-07-28 23:29:11 +02:00
|
|
|
|
|
|
|
COPY "qt-build" "/usr/local/bin/qt-build"
|
|
|
|
entrypoint ["/usr/local/bin/qt-build"]
|