#!/usr/bin/env bash # Static Qt 6 (Core, Gui, Widgets, Charts, DBus) into $QT_PREFIX. # # Shared by all four build images (docker/*/Dockerfile). The build context is docker/, so each # Dockerfile reaches this with COPY common/. Version inputs come from that Dockerfile's ARGs. # # No JPEG or TIFF in Qt: the viewer has its own libjpeg-turbo and libtiff (preview/), and a static # Qt's JPEG plugin brings a second libjpeg-turbo of another ABI that the linker silently mixes with # ours (see viewer/CMakeLists.txt). set -eux # The download path carries the SERIES (6.11), the tarball the full version (6.11.1); deriving one # from the other is what stops a version bump from silently 404ing on the old series directory. QT_SERIES=${QT_VERSION%.*} set -eux; \ cd /tmp; \ curl -LO https://download.qt.io/official_releases/qt/${QT_SERIES}/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz; \ tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz; \ mkdir -p qt-everywhere-src-${QT_VERSION}/build && cd qt-everywhere-src-${QT_VERSION}/build; \ cmake -G Ninja \ -DQT_BUILD_SUBMODULES="qtbase;qtshadertools;qtdeclarative;qtcharts;qt3d" \ -DBUILD_SHARED_LIBS=OFF \ -DQT_BUILD_TESTS=OFF \ -DQT_BUILD_EXAMPLES=OFF \ -DQT_FEATURE_dbus=ON \ -DQT_FEATURE_dbus_linked=ON \ -DDBus1_DIR=/opt/dbus-${DBUS_VERSION}-static/lib/cmake/DBus1 \ -DQT_FEATURE_xcb=ON \ -DQT_FEATURE_xcb_xlib=OFF \ -DQT_FEATURE_xkbcommon_x11=ON \ -DQT_FEATURE_opengl=ON \ -DQT_FEATURE_opengl_desktop=ON \ -DQT_FEATURE_opengl_dynamic=OFF \ -DQT_FEATURE_vulkan=OFF \ -DQT_FEATURE_glib=OFF \ -DQT_FEATURE_jpeg=OFF \ -DQT_FEATURE_tiff=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${QT_PREFIX} \ -DCMAKE_C_COMPILER=${CC} \ -DCMAKE_CXX_COMPILER=${CXX} \ -DQT_FEATURE_openssl=ON \ -DQT_FEATURE_openssl_linked=ON \ -DOPENSSL_USE_STATIC_LIBS=TRUE \ ..; \ cmake --build . -j"$(nproc)"; \ cmake --install .; \ cd /; rm -rf /tmp/qt-everywhere-src-${QT_VERSION} /tmp/qt-everywhere-src-${QT_VERSION}.tar.xz