243.1. webkitgtk-2.54.0
WebKitGTK web engine for GTK 3: the webkit2gtk-4.1 and javascriptcoregtk-4.1 APIs over libsoup 3
| Version | 2.54.0, release 3 |
| Shelf | web-engines — Browser engines and the libraries that make them up |
| Phase | 43_toolkits (Toolkits), 261 of 344 in build order |
| Licence | LGPL-2.0-or-later AND BSD-2-Clause |
| Homepage | https://webkitgtk.org/ |
| Build time | 60.2 SBU |
| Installed size | 148.9 MiB in 247 files |
| Recipe | ports/core/web-engines/webkitgtk/kpkgbuild |
About
WebKitGTK is the GTK port of the WebKit web engine, with JavaScriptCore. This port builds it for GTK 3 against libsoup3, which is the webkit2gtk-4.1 and javascriptcoregtk-4.1 API, and it installs WebKitWebDriver. GTK 3 programs with a web view use it: wxwidgets’s wxWebView, and through it KiCad and PrusaSlicer; OrcaSlicer, through the static wxWidgets it builds for itself; and GnuCash. The same source tarball builds the GTK 4 API, webkitgtk-6.0, as webkitgtk6.
Why it is in KDOS
The comment above webkitgtk and webkitgtk6 in script/phases/43_toolkits/packages.d/web-engines.txt:
Both APIs: webkitgtk is 4.1, for GTK 3, and webkitgtk6 is 6.0, for GTK 4.
Sources
webkitgtk-2.54.0.tar.xz(47.4 MiB)
sha256846fd19ccedbae1dbfe904f26dbf2d68a800a33a50caf2ad5222c8dcb3f25682
upstream: https://webkitgtk.org/releases/webkitgtk-2.54.0.tar.xz
archive copy: sources-4/web-engines--webkitgtk-2.54.0.tar.xz
Dependencies
Depends on: lld, gtk3, cmake, ninja, perl, python3, ruby, gperf, bison, flex, unifdef, pkgconf, gettext, glib, gobject-introspection, glib-introspection, libsoup3, glib-networking, cairo, harfbuzz, icu, freetype2, brotli, fontconfig, libjpeg-turbo, libpng, libwebp, libavif, libjxl, lcms2, openjpeg, libxml2, libxslt, sqlite, zlib, libgcrypt, libtasn1, libepoxy, libdrm, mesa, wayland, wayland-protocols, libxkbcommon, libX11, at-spi2-core, gstreamer, gst-plugins-base, gst-plugins-good, gst-plugins-bad, gst-libav, enchant, hyphen, libsecret, libseccomp, bubblewrap, xdg-dbus-proxy.
Required by (5): gnucash, kicad, orcaslicer, prusaslicer, wxwidgets.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-DUSE_GTK4=OFF, line 23: gtk4 (explained with the switches below)-DUSE_WOFF2=OFF, line 48: woff2 (explained with the switches below)-DUSE_VULKAN=OFF, line 52: vulkan-loader (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
webdriver-release-log.patch— puts the request-logging block ofWebDriverService::handleRequestunder#if !RELEASE_LOG_DISABLED. With journald logging off, release logging is off, andLOGis off in a release build, so WebDriver’s log channels are not declared, and the unguardedLOG_CHANNEL(WebDriverClassic)does not compile.x11-include-order.patch— moves#include <X11/Xlib.h>after the WebKit headers inPointerLockManagerX11.cpp. Macros fromX11/X.hcollide with definitions in WebKit’s bmalloc code, so Xlib must come after them.
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 webkitgtk'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/web-engines/webkitgtk.
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/web-engines/webkitgtk
echo '846fd19ccedbae1dbfe904f26dbf2d68a800a33a50caf2ad5222c8dcb3f25682 webkitgtk-2.54.0.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/webkitgtk
SRC=$SRC_ROOT/webkitgtk-2.54.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf webkitgtk-2.54.0.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 devseries, group and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/x11-include-order.patch"
patch -p1 -i "$PORT_SRC/webdriver-release-log.patch"
export LDFLAGS="$LDFLAGS -fuse-ld=lld"
cmake -S . -B build -G Ninja \
-DPORT=GTK \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_SKIP_RPATH=ON \
-DUSE_GTK4=OFF \
-DENABLE_WAYLAND_TARGET=ON \
-DENABLE_X11_TARGET=ON \
-DENABLE_INTROSPECTION=ON \
-DENABLE_DOCUMENTATION=OFF \
-DENABLE_JOURNALD_LOG=OFF \
-DENABLE_BUBBLEWRAP_SANDBOX=ON \
-DBWRAP_EXECUTABLE=/usr/bin/bwrap \
-DDBUS_PROXY_EXECUTABLE=/usr/bin/xdg-dbus-proxy \
-DENABLE_MINIBROWSER=OFF \
-DENABLE_WEBDRIVER=ON \
-DENABLE_API_TESTS=OFF \
-DENABLE_GAMEPAD=OFF \
-DENABLE_SPEECH_SYNTHESIS=OFF \
-DENABLE_SPELLCHECK=ON \
-DENABLE_VIDEO=ON \
-DENABLE_WEB_AUDIO=ON \
-DUSE_GSTREAMER=ON \
-DUSE_GBM=ON \
-DUSE_LIBDRM=ON \
-DUSE_LIBHYPHEN=ON \
-DUSE_LIBSECRET=ON \
-DUSE_AVIF=ON \
-DUSE_JPEGXL=ON \
-DUSE_LCMS=ON \
-DUSE_WOFF2=OFF \
-DUSE_LIBBACKTRACE=OFF \
-DUSE_SYSTEM_SYSPROF_CAPTURE=OFF \
-DUSE_SYSTEM_UNIFDEF=ON \
-DUSE_VULKAN=OFF \
-DENABLE_SWIFT_DEMO_URI_SCHEME=OFF \
-DENABLE_BACK_FORWARD_LIST_SWIFT=OFF
cmake --build build
DESTDIR=$PKG cmake --install build
for f in LICENSE-LGPL-2 LICENSE-LGPL-2.1 LICENSE-APPLE; do
install -Dm644 "Source/WebCore/$f" "$PKG/usr/share/licenses/$name/$f"
done
test -f "$PKG/usr/lib/pkgconfig/webkit2gtk-4.1.pc"
test -f "$PKG/usr/lib/pkgconfig/webkit2gtk-web-extension-4.1.pc"
The switches, and why each is set:
-DUSE_GTK4=OFF— build for GTK 3. With libsoup 3, that is the 4.1 API. wxWidgets finds its web view throughwebkit2gtk-4.1.pcandwebkit2gtk-web-extension-4.1.pcand builds without one when they are missing, sobuild.shchecks that both are installed.-DENABLE_WAYLAND_TARGET=ON— with-DENABLE_X11_TARGET=ON: both windowing targets. GDK picks Wayland first at run time.-DENABLE_BUBBLEWRAP_SANDBOX=ON— run the web processes inside a bubblewrap sandbox, with D-Bus reached through xdg-dbus-proxy.-DBWRAP_EXECUTABLEand-DDBUS_PROXY_EXECUTABLEname the two programs by their installed paths rather than leaving CMake to search for them.-DENABLE_WEBDRIVER=ON— build and installWebKitWebDriver. It has one installed path for both APIs, so only this port builds it; webkitgtk6 turns it off.-DENABLE_JOURNALD_LOG=OFF— no logging to journald, which needs libsystemd or libelogind; there is no systemd (see No systemd).-DENABLE_GAMEPAD=OFF— with-DENABLE_SPEECH_SYNTHESIS=OFF: no Gamepad API, which needs libmanette, and no speech synthesis, which needs Flite or Spiel. None of the three is a port, and both features are on by upstream’s default, with configure stopping when the library is missing.-DUSE_WOFF2=OFF— no libwoff2. The tree’s FreeType is built with brotli and decodes WOFF2 fonts itself.-DUSE_SYSTEM_SYSPROF_CAPTURE=OFF— use the copy oflibsysprof-captureWebKit carries; sysprof is not a port.-DUSE_LIBBACKTRACE=OFF— no libbacktrace, which is not a port.-DUSE_VULKAN=OFF— no Vulkan support, which needs the Volk loader, not a port.-DENABLE_SWIFT_DEMO_URI_SCHEME=OFF— with-DENABLE_BACK_FORWARD_LIST_SWIFT=OFF: the features written in Swift needswiftc, which is not a port, and gcc cannot build them.-DUSE_SYSTEM_UNIFDEF=ON— use the unifdef port rather than building WebKit’s copy.-DUSE_GSTREAMER=ON— with-DENABLE_VIDEO=ONand-DENABLE_WEB_AUDIO=ON: HTML media and Web Audio through GStreamer and its plugin sets.-DUSE_GBM=ON— with-DUSE_LIBDRM=ON,-DUSE_LIBHYPHEN=ON,-DUSE_LIBSECRET=ON,-DUSE_AVIF=ON,-DUSE_JPEGXL=ON,-DUSE_LCMS=ONand-DENABLE_SPELLCHECK=ON: buffers shared with the GPU through GBM and libdrm, hyphenation, password storage through libsecret, AVIF and JPEG XL images, colour management, and spell checking through enchant. Each is on by upstream’s default and stops configure when its library is missing; naming it keeps the feature from following a changed default.-DENABLE_MINIBROWSER=OFF— with-DENABLE_API_TESTS=OFFand-DENABLE_DOCUMENTATION=OFF: no MiniBrowser test program, API tests or gi-docgen reference.-DCMAKE_SKIP_RPATH=ON— no run path in the libraries and programs; everything they link is in/usr/lib.-fuse-ld=lld— added toLDFLAGS: link with LLVM’s lld instead of GNU ld.
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/webkitgtk, 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 webkitgtk-2.54.0-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/webkitgtk, and runs the triggers its paths call for.
Contents
Installed programs: WebKitWebDriver.
Installed libraries: libjavascriptcoregtk-4.1.so, libwebkit2gtk-4.1.so.
Installed directories: /usr/include/webkitgtk-4.1, /usr/lib/webkit2gtk-4.1, /usr/libexec/webkit2gtk-4.1, /usr/share/licenses/webkitgtk.
Short descriptions
javascriptcoregtk-4.1.pc |
GTK+ version of the JavaScriptCore engine |
webkit2gtk-4.1.pc |
Web content engine for GTK |
webkit2gtk-web-extension-4.1.pc |
Web content engine for GTK - web process extensions |
Notes
webkitgtk and webkitgtk6 are built from the same tarball, and their build.sh files differ only in -DUSE_GTK4, -DENABLE_WEBDRIVER, the WebDriver patch and the two .pc checks.