1515
1616# Build the shared Qt raster runtime in the target manylinux image, not on the
1717# host: upstream Qt binaries have a newer glibc baseline, especially on ARM64.
18+ # --licenses-only collects notices for the prebuilt Windows SDK instead.
1819set -Eeuo pipefail
1920
2021qt_version=6.11.1
2122qt_sha256=d9594a31228aa23ad6b531719a29b45f0f3989fe6c136d45767ea179f233c1ac
2223qt_url=" https://download.qt.io/official_releases/qt/6.11/$qt_version /submodules/qtbase-everywhere-src-$qt_version .tar.xz"
24+ licenses_only=false
25+ if [[ ${1:- } == --licenses-only ]]; then
26+ licenses_only=true
27+ shift
28+ : " ${1:? --licenses-only requires the installed Qt SDK path} "
29+ fi
2330prefix=${1:-/ opt/ envpool-qt6}
2431work_dir=$( mktemp -d)
2532trap ' rm -rf "$work_dir"' EXIT
@@ -28,27 +35,37 @@ if [[ -z ${QT_SOURCE_ARCHIVE:-} ]]; then
2835 curl --fail --location --retry 3 --output " $archive " " $qt_url "
2936fi
3037printf ' %s %s\n' " $qt_sha256 " " $archive " | sha256sum --check
31- tar --no-same-owner -xf " $archive " -C " $work_dir "
3238source_dir=" $work_dir /qtbase-everywhere-src-$qt_version "
33- mkdir " $work_dir /build"
34- cd " $work_dir /build"
39+ if [[ $licenses_only == true ]]; then
40+ sdk_version=$( " $prefix /bin/qtpaths" --qt-version | tr -d ' \r' )
41+ if [[ $sdk_version != " $qt_version " ]]; then
42+ echo " Expected Qt $qt_version , found $sdk_version " >&2
43+ exit 1
44+ fi
45+ tar --no-same-owner -xf " $archive " -C " $work_dir " \
46+ " qtbase-everywhere-src-$qt_version /LICENSES"
47+ else
48+ tar --no-same-owner -xf " $archive " -C " $work_dir "
49+ mkdir " $work_dir /build"
50+ cd " $work_dir /build"
3551
36- # Procgen uses QImage/QPainter and PNG assets, without windows or text. Keep
37- # PNG in QtGui and build its small dependencies from Qt's pinned sources;
38- # disabling ICU and display/font backends avoids a large system runtime stack.
39- " $source_dir /configure" \
40- -prefix " $prefix " -libdir lib -release -shared \
41- -opensource -confirm-license -nomake examples -nomake tests \
42- -no-feature-network -no-feature-dbus -no-feature-sql \
43- -no-feature-widgets -no-feature-printsupport -no-feature-testlib \
44- -no-feature-xml -no-feature-concurrent \
45- -no-icu -no-glib -no-zstd -no-opengl -no-feature-vulkan \
46- -no-xcb -no-feature-wayland -no-feature-eglfs -no-feature-linuxfb \
47- -no-fontconfig -no-freetype -no-harfbuzz -no-libjpeg \
48- -qt-libpng -qt-zlib -qt-pcre \
49- -- -DQT_INSTALL_CONFIG_INFO_FILES=ON
50- cmake --build . --parallel " ${CMAKE_BUILD_PARALLEL_LEVEL:- 2} "
51- cmake --install . --strip
52+ # Procgen uses QImage/QPainter and PNG assets, without windows or text. Keep
53+ # PNG in QtGui and build its small dependencies from Qt's pinned sources;
54+ # disabling ICU and display/font backends avoids a large system runtime stack.
55+ " $source_dir /configure" \
56+ -prefix " $prefix " -libdir lib -release -shared \
57+ -opensource -confirm-license -nomake examples -nomake tests \
58+ -no-feature-network -no-feature-dbus -no-feature-sql \
59+ -no-feature-widgets -no-feature-printsupport -no-feature-testlib \
60+ -no-feature-xml -no-feature-concurrent \
61+ -no-icu -no-glib -no-zstd -no-opengl -no-feature-vulkan \
62+ -no-xcb -no-feature-wayland -no-feature-eglfs -no-feature-linuxfb \
63+ -no-fontconfig -no-freetype -no-harfbuzz -no-libjpeg \
64+ -qt-libpng -qt-zlib -qt-pcre \
65+ -- -DQT_INSTALL_CONFIG_INFO_FILES=ON
66+ cmake --build . --parallel " ${CMAKE_BUILD_PARALLEL_LEVEL:- 2} "
67+ cmake --install . --strip
68+ fi
5269
5370# Ship upstream license texts and attributions alongside the dynamically
5471# linked libraries. The SBOM describes the Qt build before auditwheel repair.
@@ -61,12 +78,14 @@ This wheel includes Qt Core and Qt Gui $qt_version, dynamically linked under
6178LGPL-3.0-only, and the third-party code identified in the Qt build SBOM.
6279Copyright (C) The Qt Company Ltd. and other contributors.
6380License texts are in LICENSES/; component copyright notices are in sbom/.
64- The SBOM describes the upstream build before auditwheel renaming and stripping.
81+ The SBOM describes the upstream build before wheel repair and stripping.
6582
6683Unmodified corresponding Qt sources: $qt_url
6784SHA256: $qt_sha256
68- Build instructions and configuration: third_party/qt/build_release.sh in
69- https://github.com/sail-sg/envpool
70- The libraries in envpool.libs can be replaced with compatible modified Qt
71- libraries; preserve their auditwheel-assigned filenames and dependency names.
85+ Linux build instructions: third_party/qt/build_release.sh in
86+ https://github.com/sail-sg/envpool. Windows uses the upstream Qt SDK.
87+ The build configuration is included here for both platforms.
88+ The libraries in envpool.libs (Linux) or envpool/procgen (Windows) can be
89+ replaced with compatible modified Qt libraries; preserve their filenames
90+ and dependency names, including auditwheel-assigned names on Linux.
7291EOF
0 commit comments