WebKitGTK-2.42.2

Introduction to WebKitGTK

The WebKitGTK package is a port of the portable web rendering engine WebKit to the GTK+ 3 and GTK 4 platforms.

[Note]

Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

  • Download (HTTP): https://webkitgtk.org/releases/webkitgtk-2.42.2.tar.xz

  • Download MD5 sum: 9288e270dacc332b563ac4ef001cf316

  • Download size: 31 MB

  • Estimated disk space required: 1.2 GB (198 MB installed, add 153 MB for GTK-4)

  • Estimated build time: 45 SBU (for GTK-3, using parallelism=4, add 46 SBU for GTK-4)

Additional Downloads

WebKitGTK Dependencies

Required

Cairo-1.18.0, CMake-3.27.8, gst-plugins-base-1.22.7, gst-plugins-bad-1.22.7, GTK+-3.24.38, GTK-4.12.4, ICU-74.1, Little CMS-2.14, libgudev-238, libsecret-0.21.1, libsoup-3.4.4, libtasn1-4.19.0, libwebp-1.3.2, Mesa-23.1.8, OpenJPEG-2.5.0, Ruby-3.2.2, SQLite-3.44.2, unifdef-2.12, Which-2.21, and wpebackend-fdo-1.14.2

Recommended

Optional

Gi-DocGen-2023.3, HarfBuzz-8.3.0, Wayland-1.22.0, WOFF2-1.0.2, ccache, Hyphen, libjxl, and libmanette

Editor Notes: https://wiki.linuxfromscratch.org/blfs/wiki/webkitgtk

Installation of WebKitGTK

Installation of WebKitGTK

[Important]

Important

This package allows building with either GTK-3 or GTK-4, but not both in the same build. The GTK-4 version is needed for packages such as Epiphany-45.1. Other packages, such as Balsa-2.6.4 or Evolution-3.50.1, require the GTK-3 version. Both versions can be installed side by side on the same system. We give build instructions for both cases below, but the only difference is the setting of -DUSE_GTK4

First, fix a build failure caused by libxml2-2.12.x:

patch -Np1 -i ../webkitgtk-2.42.2-upstream_fixes-1.patch

If you want to install the GTK+-3 version of WebKitGTK, run the following commands:

mkdir -vp build &&
cd        build &&

cmake -DCMAKE_BUILD_TYPE=Release  \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_SKIP_RPATH=ON       \
      -DPORT=GTK                  \
      -DLIB_INSTALL_DIR=/usr/lib  \
      -DUSE_LIBHYPHEN=OFF         \
      -DENABLE_GAMEPAD=OFF        \
      -DENABLE_MINIBROWSER=ON     \
      -DENABLE_DOCUMENTATION=OFF  \
      -DUSE_WOFF2=OFF             \
      -DUSE_GTK4=OFF              \
      -DUSE_WPE_RENDERER=ON       \
      -DUSE_JPEGXL=OFF            \
      -DENABLE_BUBBLEWRAP_SANDBOX=ON \
      -Wno-dev -G Ninja ..        &&
ninja

This package does not have a working test suite. However, there is a usable basic graphical web browser in the build directory, build/bin/MiniBrowser. If launching it fails, there is a problem with the build.

Now, as the root user:

ninja install

As the -DENABLE_DOCUMENTATION=OFF option is used, the documentation is not rebuilt nor installed now. If you need the documentation, you can either install Gi-DocGen-2023.3 and remove this option from the cmake command, or install the pre-built documentation instead:

install -vdm755 /usr/share/gtk-doc/html/{jsc-glib,webkit2gtk{,-web-extension}}-4.1 &&
install -vm644  ../Documentation/jsc-glib-4.1/*              \
                /usr/share/gtk-doc/html/jsc-glib-4.1         &&
install -vm644  ../Documentation/webkit2gtk-4.1/*            \
                /usr/share/gtk-doc/html/webkit2gtk-4.1       &&
install -vm644  ../Documentation/webkit2gtk-web-extension-4.1/* \
                /usr/share/gtk-doc/html/webkit2gtk-web-extension-4.1

If you want to install the GTK4 version of WebKitGTK, run the following commands:

rm -rf * .[^.]* &&

cmake -DCMAKE_BUILD_TYPE=Release  \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DCMAKE_SKIP_RPATH=ON       \
      -DPORT=GTK                  \
      -DLIB_INSTALL_DIR=/usr/lib  \
      -DUSE_LIBHYPHEN=OFF         \
      -DENABLE_GAMEPAD=OFF        \
      -DENABLE_MINIBROWSER=ON     \
      -DENABLE_DOCUMENTATION=OFF  \
      -DUSE_WOFF2=OFF             \
      -DUSE_GTK4=ON               \
      -DUSE_JPEGXL=OFF            \
      -DUSE_WPE_RENDERER=ON       \
      -DENABLE_BUBBLEWRAP_SANDBOX=ON \
      -Wno-dev -G Ninja ..        &&
ninja

Now, as the root user:

ninja install

Command Explanations

-DUSE_LIBHYPHEN=OFF: This switch disables the default automatic hyphenation implementation. You need to install Hyphen if you wish to enable it (replacing OFF with ON or just removing the switch).

-DENABLE_DOCUMENTATION=OFF: This switch disables regenerating the documentation. Remove this switch if you have Gi-DocGen-2023.3 installed and wish to regenerate the documentation.

-DENABLE_GAMEPAD=OFF: This switch disables gamepad support. Remove this switch if you have libmanette installed and wish to enable it.

-DENABLE_MINIBROWSER=ON: This switch enables compiling and installing the MiniBrowser.

-DUSE_WPE_RENDERER=ON: This switch uses the WPE renderer, which is recommended by upstream.

-DUSE_JPEGXL=OFF: This switch turns off support for JPEG-XL images. Remove it if you have the optional package libjxl installed.

-DENABLE_BUBBLEWRAP_SANDBOX=ON: This switch enables the Bubblewrap sandbox, which helps mitigate the impact of most security vulnerabilities in this package. Change this switch to OFF if you do not want to install bubblewrap-0.8.0, libseccomp-2.5.4, or xdg-dbus-proxy-0.1.5, but note that this may put you at risk.

-DUSE_SYSTEM_MALLOC=ON: This switch enables building against the system installed malloc.

-DENABLE_GEOLOCATION=OFF: Use this switch if you don't want to install GeoClue-2.7.1.

-DUSE_AVIF=OFF: Use this switch if you don't want to install libavif-1.0.2. Note that you will not have support for AVIF images if you do this.

-DUSE_WOFF2=ON: Use this switch if the optional package WOFF2-1.0.2 is installed. This adds additional support for fonts.

Contents

Installed Program: WebKitWebDriver
Installed Libraries: libjavascriptcoregtk-4.1.so, libjavascriptcoregtk-6.0.so, libwebkit2gtk-4.1.so, and libwebkitgtk-6.0.so
Installed Directories: /usr/include/webkitgtk-4.1, /usr/include/webkitgtk-6.0, /usr/lib{,exec}/webkit2gtk-4.1, /usr/lib{,exec}/webkitgtk-6.0, and /usr/share/gtk-doc/html/{jsc-glib,webkit2gtk{,-web-extension}}-4.1

Short Descriptions

WebKitWebDriver

allows debugging and automation of web pages and browsers

libjavascriptcoregtk-4.1.so

contains core JavaScript API functions used by jsc and libwebkit2gtk-4.1

libjavascriptcoregtk-6.0.so

contains core JavaScript API functions used by jsc and libwebkitgtk-6.0

libwebkit2gtk-4.1.so

contains the WebKit2 API functions

libwebkitgtk-6.0.so

contains the WebKit API functions for GTK-4 applications