254.12. qt6-qtwebengine-6.11.2
Qt 6 WebEngine and Qt PDF — the Chromium web engine as Qt widgets and Qt Quick types
| Version | 6.11.2, release 3 |
| Shelf | qt6 — The Qt 6 modules, and everything in `group = qt6` |
| Phase | 43_toolkits (Toolkits), 24 of 344 in build order |
| Licence | (LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only) AND BSD-3-Clause |
| Homepage | https://www.qt.io/ |
| Build time | 212.0 SBU |
| Installed size | 227.6 MiB in 503 files |
| Recipe | ports/core/qt6/qt6-qtwebengine/kpkgbuild |
About
Qt WebEngine is Chromium’s web engine wrapped as Qt 6 modules: QtWebEngineCore, the QWebEngineView widget and the WebEngineView Qt Quick type, with the QtWebEngineProcess helper that runs each page’s renderer. The same build produces Qt PDF, Chromium’s PDF renderer as the QtPdf and QtPdfWidgets libraries and their Qt Quick types. Qt applications that show web content, help pages or PDFs link it, and the Python bindings are python3-pyqt6-webengine.
The Chromium source is bundled inside the Qt release archive, under src/3rdparty/chromium, and is built by its own GN and ninja run inside Qt’s CMake build. Unlike every other qt6-* module, this port follows Qt WebEngine’s own release schedule and is built against whichever qt6-qtbase the set is at (see How Qt 6 is built).
Why it is in KDOS
The comment above it in script/phases/43_toolkits/packages.d/qt6.txt:
Chromium inside Qt, for the web views of Calibre, kiwix-desktop, GoldenDict-ng, Falkon and the rest.
Sources
qt6-qtwebengine-6.11.2.tar.xz(553.5 MiB)
sha2566101c1aa00ff933d1b65ee5d167f76e8d71b9ac5b378b0111277723ebda7c163
upstream: https://download.qt.io/official_releases/qt/6.11/6.11.2/submodules/qtwebengine-everywhere-src-6.11.2.tar.xz
archive copy: sources-4/qt6--qt6-qtwebengine-6.11.2.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, python3, python3-html5lib, nodejs, gperf, bison, flex, perl, qt6-qtbase, qt6-qtdeclarative, qt6-qtwebchannel, qt6-qtpositioning, qt6-qttools, nss, nspr, dbus, glib, icu, fontconfig, freetype2, harfbuzz, libjpeg-turbo, libpng, libtiff, libwebp, openjpeg, opus, lcms2, zlib, minizip, pciutils, eudev, alsa-lib, libpulse, pipewire, krb5, libva, libdrm, mesa, vulkan-headers, cups, libxkbcommon, libxkbfile, libxcb, libX11, libXcomposite, libXcursor, libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXtst, libxshmfence, xorgproto.
Required by (36): akregator, angelfish, arianna, calibre, calligra, cantor, digikam, falkon, ghostwriter, goldendict-ng, grantlee-editor, kaccounts-providers, kalgebra, kdepim-addons, kdepim-runtime, kdevelop, khelpcenter, kimagemapeditor, kiwix-desktop, kmail, konqueror, kontact, ktorrent, libksieve, marble, messagelib, python3-pyqt6-webengine, python3-pyside6, qgis, qmapshack, qt6-qtwebview, qutebrowser, rkward, signon-ui, skanpage, zeal.
Patches
build.sh applies these; kpkg applies nothing by itself.
0001-Enable-building-on-musl.patch— removes the configure check that refuses to build Qt WebEngine on Linux without glibc.0002-temp-failure-retry.patch— defines glibc’sTEMP_FAILURE_RETRYmacro, which retries a call while it fails withEINTR, in the sandbox helper’sprocess_util.h; musl does not provide it.0003-qt-musl-mallinfo.patch— compiles the calls tomallinfo()andmallinfo2()in Chromium’s memory reporting only with glibc. musl’s allocator has neither, and the malloc usage figure is reported as 0.0004-qt-musl-resolve.patch— compiles Chromium’s resolver-reloading code (dns_reloader.cc) and its calls only with glibc, and makesScopedResStateclear and initialise the global_resstate, as upstream does on OpenBSD, and free nothing when it is done; the patch notes that musl’sres_init()allocates nothing.0005-qtwebengine-missing-include.patch— adds<time.h>to the includes of the Linux system-call headerlinux_syscall_support.h.0006-no-execinfo.patch— prints a stack trace only with glibc. musl has no<execinfo.h>and nobacktrace(), so a trace is empty.0007-musl-sandbox.patch— adjusts the seccomp sandbox to musl’s threads: aclone()is allowed when it carries the thread flags with any ofCLONE_SETTLS,CLONE_PARENT_SETTID,CLONE_CHILD_CLEARTIDandCLONE_DETACHED, rather than only glibc’s exact set; it allowsset_tid_address,mremapandmembarrieroutright, addspwritev2,sched_getparam,sched_getschedulerandsched_setschedulerto the renderer’s policy, and includes<sys/syscall.h>for the system-call numbers. Upstream’s filter kills a process whose threadclone()carries any other flag set.0008-missing-includes.patch— adds<inttypes.h>to QUICHE’swindow_manager.hand<sys/types.h>to the sandbox’scredentials.h, which use their types without including them.cr140-musl-prctl.patch— musl/linux: Don't import conflicting libc and kernel headers/usr/include/sys/prctl.h:88:8: error: redefinition of 'prctl_mm_map' /usr/include/linux/prctl.h:134:8: note: previous definition is here
devtools-frontend-compress_files.patch— makes the DevTools front end’scompress_files.jscompress its files one after another rather than all at once, which keeps that step’s memory use to one file at a time.fstatat-32bit.patch— undefinesfstatat64beforelinux_syscall_support.hdeclares its ownfstatat64wrapper. musl’s<sys/stat.h>definesfstatat64as a macro forfstatat, which would make the wrapper ask for a system call__NR_fstatatthat does not exist. The block is compiled only where the kernel headers define__NR_fstatat64, which is not the case on x86-64.gcc13.patch— adds<cstdint>tocomponents/variations/seed_response.h, which uses the fixed-width integer types without including their header.gn-cstdint.patch— the same for GN’spool.h: GN is built by its owngen.py, which takes no compiler flags from the environment, so the header has to name what it uses.gn-ldflags.patch— makes GN’sgen.pystart its link flags from the environment’sLDFLAGS, so GN is linked with the tree’s flags.no-sandbox-settls.patch— turns off theCLONE_VM | CLONE_VFORKshortcut in the sandbox’scredentials.cc, which passesCLONE_SETTLSwith a TLS pointer; musl’sclone()answers any call carryingCLONE_SETTLSwithEINVAL, and the code that makes the call aborts when it fails.no-simd-fallback-fix.patch— corrects the signature of WebAudio’s scalarDelay::ProcessARateVector()fallback to match its declaration. The fallback is compiled only where neither x86 SIMD nor NEON is available, so this tree’s x86-64 build never compiles it.sandbox-path-max.patch— adds<limits.h>to the sandbox’sproc_util.cc, which sizes a buffer withPATH_MAX; on musl no header it includes declares it.systypes.patch— adds<sys/types.h>to the symboliser’ssymbolize.h.userns-probe-no-malloc.patch— sandbox: allocate nothing in the user-namespace probe childCredentials::CanCreateProcessInNewUserNS() probes with a raw clone(), which runs none of libc's fork handling, and its child called SetGidAndUidMaps(), whose KernelSupportsDenySetgroups() builds a base::FilePath and so allocates. With musl's single heap lock, a child cloned while another thread of the host process held that lock waits on it for ever, and the host waits on the child: a Qt WebEngine host such as plasmashell hangs at start. The child now writes setgroups, gid_map and uid_map with open() and write() alone, and takes a missing /proc/self/setgroups for a kernel that needs no deny, as KernelSupportsDenySetgroups() does.
userns-probe-no-malloc.patch is KDOS’s own and is to be offered to Chromium, and to Alpine, whose musl build carries the same probe. The probe runs in the process that hosts Qt WebEngine, such as plasmashell or a KDE application with an embedded web page, so without the patch that process can hang at start.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install qt6-qtwebengine'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/qt6/qt6-qtwebengine.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/qt6/qt6-qtwebengine
echo '6101c1aa00ff933d1b65ee5d167f76e8d71b9ac5b378b0111277723ebda7c163 qt6-qtwebengine-6.11.2.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/qt6-qtwebengine
SRC=$SRC_ROOT/qt6-qtwebengine-6.11.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf qt6-qtwebengine-6.11.2.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _module, group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
for p in 0001-Enable-building-on-musl 0002-temp-failure-retry \
0003-qt-musl-mallinfo 0004-qt-musl-resolve \
0005-qtwebengine-missing-include 0006-no-execinfo 0007-musl-sandbox \
0008-missing-includes gcc13 no-sandbox-settls systypes fstatat-32bit \
devtools-frontend-compress_files cr140-musl-prctl no-simd-fallback-fix; do
patch -p1 -i "$PORT_SRC/$p.patch"
done
patch -p1 -i "$PORT_SRC/gn-cstdint.patch"
patch -p1 -i "$PORT_SRC/gn-ldflags.patch"
patch -p1 -i "$PORT_SRC/sandbox-path-max.patch"
patch -p1 -i "$PORT_SRC/userns-probe-no-malloc.patch"
export CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
export CXXFLAGS="$CXXFLAGS -D_LARGEFILE64_SOURCE -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
export NINJAFLAGS="$MAKEFLAGS"
export NODEJS_EXECUTABLE=/usr/bin/node
mkdir build && cd build
cmake .. -G Ninja -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DQT_BUILD_TESTS=OFF \
-DQT_BUILD_EXAMPLES=OFF \
-DFEATURE_qtwebengine_build=ON \
-DFEATURE_qtpdf_build=ON \
-DFEATURE_webengine_build_gn=ON \
-DFEATURE_webengine_rust_build=OFF \
-DFEATURE_webengine_jumbo_build=8 \
-DFEATURE_webengine_developer_build=OFF \
-DFEATURE_webengine_full_debug_info=OFF \
-DFEATURE_webengine_embedded_build=OFF \
-DFEATURE_webenginedriver=OFF \
-DFEATURE_webengine_ozone_x11=ON \
-DFEATURE_webengine_vulkan=ON \
-DFEATURE_webengine_vaapi=ON \
-DFEATURE_webengine_system_gbm=ON \
-DFEATURE_webengine_system_alsa=ON \
-DFEATURE_webengine_system_pulseaudio=ON \
-DFEATURE_webengine_webrtc=ON \
-DFEATURE_webengine_webrtc_pipewire=ON \
-DFEATURE_webengine_webrtc_system_openh264=OFF \
-DFEATURE_webengine_proprietary_codecs=ON \
-DFEATURE_webengine_printing_and_pdf=ON \
-DFEATURE_webengine_pepper_plugins=ON \
-DFEATURE_webengine_spellchecker=ON \
-DFEATURE_webengine_extensions=ON \
-DFEATURE_webengine_geolocation=ON \
-DFEATURE_webengine_webchannel=ON \
-DFEATURE_webengine_kerberos=ON \
-DFEATURE_webengine_v8_context_snapshot=ON \
-DFEATURE_webengine_system_icu=ON \
-DFEATURE_webengine_system_glib=ON \
-DFEATURE_webengine_system_zlib=ON \
-DFEATURE_webengine_system_libpng=ON \
-DFEATURE_webengine_system_libjpeg=ON \
-DFEATURE_webengine_system_libtiff=ON \
-DFEATURE_webengine_system_libwebp=ON \
-DFEATURE_webengine_system_libopenjpeg2=ON \
-DFEATURE_webengine_system_opus=ON \
-DFEATURE_webengine_system_lcms2=ON \
-DFEATURE_webengine_system_harfbuzz=ON \
-DFEATURE_webengine_system_freetype=ON \
-DFEATURE_webengine_system_libpci=ON \
-DFEATURE_webengine_system_libudev=ON \
-DFEATURE_webengine_system_ffmpeg=OFF \
-DFEATURE_webengine_system_libvpx=OFF \
-DFEATURE_webengine_system_re2=OFF \
-DFEATURE_webengine_system_snappy=OFF \
-DFEATURE_webengine_system_openh264=OFF \
-DFEATURE_webengine_system_minizip=ON \
-DFEATURE_webengine_system_libxml=OFF
ninja
test -z "$(find . -path '*/obj/third_party/zlib/bundled_zlib/*' -name '*.o')"
test -z "$(find . -path '*/obj/third_party/zlib/bundled_minizip/*' -name '*.o')"
DESTDIR=$PKG ninja install
rm -f "$PKG/usr/bin/QtWebEngineProcess6"
find "$PKG/usr/share/qt6/translations/qtwebengine_locales" -name '*.pak' \
! -name 'en-US.pak' ! -name 'en-GB.pak' -delete
The switches, and why each is set:
-D_LARGEFILE64_SOURCE— inCFLAGSandCXXFLAGS: make musl declareoff64_t,stat64and the other*64names, which it declares only under this macro.-Wno-builtin-macro-redefined— silence GCC’s warning for a redefinition of a built-in macro such as__DATE__or__TIME__.-Wno-deprecated-declarations— silence the warning for every use of a declaration marked deprecated.NINJAFLAGS="$MAKEFLAGS"— the job limit of the Chromium ninja run inside Qt’s build, which passes this variable’s words to that ninja and reads no other; unset, ninja starts its own default of two more jobs than there are processors, each taking 2 to 3 GB of memory.NODEJS_EXECUTABLE=/usr/bin/node— the Node.js the build runs its JavaScript tools with, among them the DevTools front end’s build scripts. Chromium’snode.pyrefuses to run without the variable, and Qt’s ninja step also sets it, to thenodeits configure found; nodejs is independsfor it.-DFEATURE_qtwebengine_build=ON— with-DFEATURE_qtpdf_build=ON: build both Qt WebEngine and Qt PDF, each named so that a failed configure check stops the build instead of leaving a module out.-DFEATURE_webengine_build_gn=ON— build GN, Chromium’s build-file generator, from Qt’s copy in the archive. Qt accepts an installed GN only if its version is exactly the module’s, which the tree’s gn, upstream’s own, never reports.-DFEATURE_webengine_rust_build=OFF— leave out the parts of Chromium written in Rust, which need a Rust toolchain with bindgen and libclang. Upstream’s default, named.-DFEATURE_webengine_jumbo_build=8— compile Chromium’s sources in jumbo units, up to 8 files merged into each, which shortens the build. A number in place ofONsets the merge limit. 8 is upstream’s default limit, named; at 8 or below, Qt leaves Chromium’sbrowsersources out of the jumbo units.-DFEATURE_webengine_developer_build=OFF— with-DFEATURE_webengine_full_debug_info=OFF,-DFEATURE_webengine_embedded_build=OFFand-DFEATURE_webenginedriver=OFF: no developer configuration, no full debug information for Blink and V8, no embedded-device configuration and no WebEngineDriver, the WebDriver server for automated browsing.-DFEATURE_webengine_ozone_x11=ON— let the engine draw for a Qt program running on the X11 platform plugin, under Xwayland. It needs libX11, libdrm, libXcomposite, libXcursor, libXrandr, libXi, xorgproto, libxshmfence, libXtst, libxkbcommon, libxkbfile and xcb-dri3. Upstream checks each one as optional, so without the switch a missing one would drop X11 support without an error, and a Qt program on X11 would have no web engine.-DFEATURE_webengine_vulkan=ON— with-DFEATURE_webengine_vaapi=ONand-DFEATURE_webengine_system_gbm=ON: Vulkan rendering, VA-API hardware video decoding through libva, and buffer allocation through mesa’s GBM.-DFEATURE_webengine_system_alsa=ON— with-DFEATURE_webengine_system_pulseaudio=ON: audio through ALSA and PulseAudio, which on this desktop reaches PipeWire.-DFEATURE_webengine_webrtc=ON— with-DFEATURE_webengine_webrtc_pipewire=ON: WebRTC, and screen sharing in it through PipeWire and the desktop portal, which upstream never turns on by itself.-DFEATURE_webengine_proprietary_codecs=ON— H.264, H.265 and MP3 in the engine’s bundled FFmpeg. Off by upstream’s default.-DFEATURE_webengine_printing_and_pdf=ON— withpepper_plugins,spellchecker,extensions,geolocation,webchannel,kerberosandv8_context_snapshot: printing and PDF output, Pepper plugins, the spellchecker, the extensions API, geolocation through qt6-qtpositioning, Qt WebChannel, Kerberos authentication through krb5, and V8’s start-up snapshot, each named.-DFEATURE_webengine_system_icu=ON— and the othersystem_switches set on: link the tree’s ICU, GLib, zlib, minizip, libpng, libjpeg-turbo, libtiff, libwebp, OpenJPEG, Opus, Little CMS, HarfBuzz, FreeType, pciutils’ libpci and libudev rather than Chromium’s bundled copies.-DFEATURE_webengine_system_ffmpeg=OFF— Chromium’s bundled FFmpeg. Upstream’s configure test for a system FFmpeg callsav_stream_get_first_dts(), which the ffmpeg port’s libavformat does not have, so the switch cannot be on with this tree’s FFmpeg.-DFEATURE_webengine_system_libvpx=OFF— Chromium’s bundled libvpx: upstream builds VA-API only without a system libvpx.-DFEATURE_webengine_system_libxml=OFF— Chromium’s bundled libxml2 and libxslt: Blink’s XSLT code is written to an older libxml2 API than the libxml2 port’s.-DFEATURE_webengine_system_re2=OFF— with-DFEATURE_webengine_system_snappy=OFF,-DFEATURE_webengine_system_openh264=OFFand-DFEATURE_webengine_webrtc_system_openh264=OFF: Chromium’s bundled re2, Snappy and OpenH264, though re2, snappy and openh264 are ports.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/qt6-qtwebengine, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf qt6-qtwebengine-6.11.2-3.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/qt6-qtwebengine, and runs the triggers its paths call for.
Contents
Installed libraries: libQt6Pdf.so, libQt6PdfQuick.so, libQt6PdfWidgets.so, libQt6WebEngineCore.so, libQt6WebEngineQuick.so, libQt6WebEngineQuickDelegatesQml.so, libQt6WebEngineWidgets.so.
Installed directories: /usr/include/qt6/QtPdf, /usr/include/qt6/QtPdfQuick, /usr/include/qt6/QtPdfWidgets, /usr/include/qt6/QtWebEngineCore, /usr/include/qt6/QtWebEngineQuick, /usr/include/qt6/QtWebEngineWidgets, /usr/lib/cmake/Qt6Pdf, /usr/lib/cmake/Qt6PdfPrivate, /usr/lib/cmake/Qt6PdfQuick, /usr/lib/cmake/Qt6PdfQuickPrivate, /usr/lib/cmake/Qt6PdfWidgets, /usr/lib/cmake/Qt6PdfWidgetsPrivate, /usr/lib/cmake/Qt6WebEngineCore, /usr/lib/cmake/Qt6WebEngineCorePrivate, /usr/lib/cmake/Qt6WebEngineCoreTools, /usr/lib/cmake/Qt6WebEngineQuick, /usr/lib/cmake/Qt6WebEngineQuickDelegatesQml, /usr/lib/cmake/Qt6WebEngineQuickPrivate, /usr/lib/cmake/Qt6WebEngineWidgets, /usr/lib/cmake/Qt6WebEngineWidgetsPrivate, /usr/lib/qt6/qml/QtQuick/Pdf, /usr/lib/qt6/qml/QtWebEngine, /usr/share/licenses/qt6-qtwebengine, /usr/share/qt6/resources, /usr/share/qt6/translations/qtwebengine_locales.
Short descriptions
Qt6Pdf.pc |
Qt Pdf module |
Qt6PdfQuick.pc |
Qt PdfQuick module |
Qt6PdfWidgets.pc |
Qt PdfWidgets module |
Qt6WebEngineCore.pc |
Qt WebEngineCore module |
Qt6WebEngineQuick.pc |
Qt WebEngineQuick module |
Qt6WebEngineQuickDelegatesQml.pc |
Qt WebEngineQuickDelegatesQml module |
Qt6WebEngineWidgets.pc |
Qt WebEngineWidgets module |
Notes
After the Chromium build, build.sh checks that no object was compiled under third_party/zlib/bundled_zlib or third_party/zlib/bundled_minizip: Chromium compiles its own zlib and minizip whenever the system ones are not taken, and the check fails the build rather than ship a second copy of each. minizip is in depends for that reason.
QtWebEngineProcess is installed in /usr/lib/qt6/libexec, where the engine starts it from. build.sh removes the /usr/bin/QtWebEngineProcess6 that the install also puts on PATH; upstream describes the helper as Qt WebEngine’s internal process.
Of the engine’s translated locale packs, only en-US.pak and en-GB.pak ship. The engine falls back to en-US.pak for any locale whose pack is missing.
The renderer sandbox is built on unprivileged user namespaces, so no setuid helper is installed (see setuid binaries).