# SPDX-FileCopyrightText: 2022 Daniel Vrátil # SPDX-License-Identifier: MIT # # Docker image for specific versions of clang and specific version of Qt. FROM debian:bullseye ARG compiler_version ARG qt_version ARG qt_modules ARG qt_archives SHELL ["/bin/bash", "-c"] # Install build & runtime dependencies RUN apt-get update \ && apt-get upgrade --yes \ && apt-get install --yes --no-install-recommends \ cmake=3.18.4\* cmake-data=3.18.4\* \ make \ python3-pip python3-setuptools python3-wheel python3-dev \ dbus dbus-x11 \ libglib2.0-dev libxkbcommon-dev libfreetype6-dev libfontconfig1-dev \ libssl-dev \ libegl-dev libgl-dev libegl1=1.3.2\* libgl1=1.3.2\* libglx0=1.3.2\* libglvnd0=1.3.2\* \ libvulkan-dev # Install and set up clang RUN \ # Set up env \ if [ "${compiler_version}" == "dev" ]; then \ export CLANG_VERSION_SUFFIX=""; \ else \ export CLANG_VERSION_SUFFIX="-${compiler_version}"; \ fi && \ echo "export CC=\"/usr/bin/clang${CLANG_VERSION_SUFFIX}\"" >> /etc/profile.d/clang.sh && \ echo "export CXX=\"/usr/bin/clang++${CLANG_VERSION_SUFFIX}\"" >> /etc/profile.d/clang.sh && \ # Install tools needed to add the clang repository \ apt-get install --yes --no-install-recommends ca-certificates wget gnupg && \ # Add clang repository \ echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye${CLANG_VERSION_SUFFIX} main" > /etc/apt/sources.list.d/llvm.list && \ echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye${CLANG_VERSION_SUFFIX} main" >> /etc/apt/sources.list.d/llvm.list && \ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ # Install clang \ apt-get update && \ apt-get install --yes --install-recommends clang${CLANG_VERSION_SUFFIX} && \ clang_major_version=$(clang${CLANG_VERSION_SUFFIX} --version | grep -Eo "[0-9]+.[0-9]+.[0-9]+" | cut -d'.' -f1) && \ if [ ${clang_major_version} -gt 11 ]; then \ apt-get install --yes --no-install-recommends libclang-rt-${clang_major_version}-dev; \ fi # Workaround a bug in CMake (?) which tries to look for OpenGL-related libraries # in /usr/lib/x86_64-unknown-linux-gnu instead of /usr/lib/x86_64-linux-gnu RUN ln -s x86_64-linux-gnu /usr/lib/x86_64-unknown-linux-gnu # Install Qt WORKDIR /root RUN pip3 install aqtinstall COPY install-qt.sh ./install-qt.sh RUN ./install-qt.sh "${qt_version}" "${qt_modules}" "${qt_archives}" # Set Qt up environment ENV QT_BASE_DIR "/opt/qt/${qt_version}/gcc_64" ENV PATH "${QT_BASE_DIR}/bin:${PATH}" ENV CMAKE_PREFIX_PATH "${QT_BASE_DIR}/lib/cmake" ENV LD_LIBRARY_PATH "${QT_BASE_DIR}/lib:${LD_LIBRARY_PATH}" ENV XDG_DATA_DIRS "${QT_BASE_DIR}/share:${XDG_DATA_DIRS}" ENTRYPOINT [ "/bin/bash", "-l" ]