diff --git a/deploy/docker/Dockerfile-build-android-debian b/deploy/docker/Dockerfile-build-android-debian new file mode 100644 index 00000000000..8ccaa69a487 --- /dev/null +++ b/deploy/docker/Dockerfile-build-android-debian @@ -0,0 +1,31 @@ +FROM ubuntu:22.04 + +ARG QT_VERSION=6.6.3 +ARG QT_MODULES="qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors" + +ENV DEBIAN_FRONTEND noninteractive + +ENV DISPLAY :99 + +ENV QT_PATH /opt/Qt +ENV QT_DESKTOP $QT_PATH/${QT_VERSION}/gcc_64 + +ENV PATH /usr/lib/ccache:$QT_DESKTOP/bin:$PATH + +# Install Qt Desktop +COPY tools/setup/install-qt-debian.sh /tmp/qt/ +RUN /tmp/qt/install-qt-debian.sh + +# Install Qt Android +COPY tools/setup/install-qt-android-debian.sh /tmp/qt/ +RUN /tmp/qt/install-qt-android-debian.sh + +# Reconfigure locale +RUN locale-gen en_US.UTF-8 && dpkg-reconfigure locales + +RUN git config --global --add safe.directory /project/source + +WORKDIR /project/build +CMD cmake -S /project/source -B . -G Ninja -DCMAKE_BUILD_TYPE=Debug -DQT_HOST_PATH=$QT_DESKTOP -DQT_ANDROID_BUILD_ALL_ABIS=OFF -DQT_ANDROID_ABIS="arm64-v8a" -DQT_ANDROID_SIGN_APK=OFF -DQGC_STABLE_BUILD=OFF ; \ + cmake --build . --target all --config Debug ; \ + cmake --install . --config Debug diff --git a/deploy/docker/run-docker-android-debian.sh b/deploy/docker/run-docker-android-debian.sh new file mode 100755 index 00000000000..2e264b20797 --- /dev/null +++ b/deploy/docker/run-docker-android-debian.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Run this from root directory + +set -e + +docker build --file ./deploy/docker/Dockerfile-build-android-debian -t qgc-android-debian-docker . +docker run --rm -v ${PWD}:/project/source -v ${PWD}/build:/project/build qgc-android-debian-docker diff --git a/deploy/docker/run-docker.sh b/deploy/docker/run-docker-ubuntu.sh similarity index 100% rename from deploy/docker/run-docker.sh rename to deploy/docker/run-docker-ubuntu.sh diff --git a/tools/setup/install-qt-android-debian.sh b/tools/setup/install-qt-android-debian.sh new file mode 100755 index 00000000000..9d85355cd60 --- /dev/null +++ b/tools/setup/install-qt-android-debian.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +QT_VERSION="${QT_VERSION:-6.6.3}" +QT_PATH="${QT_PATH:-/opt/Qt}" +QT_HOST="${QT_HOST:-linux}" +QT_TARGET="${QT_TARGET:-android}" +QT_ARCH="${QT_ARCH:-android_arm64_v8a}" +QT_MODULES="${QT_MODULES:-qtcharts qtlocation qtpositioning qtspeech qt5compat qtmultimedia qtserialport qtimageformats qtshadertools qtconnectivity qtquick3d qtsensors}" + +set -e + +echo "QT_VERSION $QT_VERSION" +echo "QT_PATH $QT_PATH" +echo "QT_HOST $QT_HOST" +echo "QT_TARGET $QT_TARGET" +echo "QT_ARCH $QT_ARCH" +echo "QT_MODULES $QT_MODULES" + +apt update +apt install python3 python3-pip -y +pip3 install setuptools wheel py7zr ninja cmake aqtinstall +aqt install-qt ${QT_HOST} ${QT_TARGET} ${QT_VERSION} ${QT_ARCH} -O ${QT_PATH} -m ${QT_MODULES} +export PATH=$(readlink -e ${QT_PATH}/${QT_VERSION}/${QT_ARCH}/bin/):$PATH +export PKG_CONFIG_PATH=$(readlink -e ${QT_PATH}/${QT_VERSION}/${QT_ARCH}/lib/pkgconfig):$PKG_CONFIG_PATH +export LD_LIBRARY_PATH=$(readlink -e ${QT_PATH}/${QT_VERSION}/${QT_ARCH}/lib):$LD_LIBRARY_PATH +export QT_ROOT_DIR=$(readlink -e ${QT_PATH}/${QT_VERSION}/${QT_ARCH}) +export QT_PLUGIN_PATH=$(readlink -e ${QT_PATH}/${QT_VERSION}/${QT_ARCH}/plugins) +export QML2_IMPORT_PATH=$(readlink -e ${QT_PATH}/${QT_VERSION}/${QT_ARCH}/qml) + +echo "PATH $PATH" +echo "PKG_CONFIG_PATH $PKG_CONFIG_PATH" +echo "LD_LIBRARY_PATH $LD_LIBRARY_PATH" +echo "QT_ROOT_DIR $QT_ROOT_DIR" +echo "QT_PLUGIN_PATH $QT_PLUGIN_PATH" +echo "QML2_IMPORT_PATH $QML2_IMPORT_PATH"