Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

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

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.

Patches

build.sh applies these; kpkg applies nothing by itself.

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:

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.