blob: 3c6b7db8117ab11b2ae4e777b00373a85a21a945 [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001SUMMARY = "WebKit web rendering engine for the GTK+ platform"
2HOMEPAGE = "https://www.webkitgtk.org/"
3BUGTRACKER = "https://bugs.webkit.org/"
4
5LICENSE = "BSD-2-Clause & LGPL-2.0-or-later"
6LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d84286dda758da57bd691 \
7 file://Source/WebCore/LICENSE-APPLE;md5=4646f90082c40bcf298c285f8bab0b12 \
8 file://Source/WebCore/LICENSE-LGPL-2;md5=36357ffde2b64ae177b2494445b79d21 \
9 file://Source/WebCore/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 \
10 "
11
12SRC_URI = "https://www.webkitgtk.org/releases/webkitgtk-${PV}.tar.xz \
13 file://0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch \
14 file://reproducibility.patch \
15 file://0d3344e17d258106617b0e6d783d073b188a2548.patch \
16 file://no-musttail-arm.patch \
17 "
Patrick Williams705982a2024-01-12 09:51:57 -060018SRC_URI[sha256sum] = "52288b30bda22373442cecb86f9c9a569ad8d4769a1f97b352290ed92a67ed86"
Patrick Williamsac13d5f2023-11-24 18:59:46 -060019
20inherit cmake pkgconfig gobject-introspection perlnative features_check upstream-version-is-even gi-docgen
21
22S = "${WORKDIR}/webkitgtk-${PV}"
23
24ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
25REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'opengl', '', d)}"
26
27CVE_PRODUCT = "webkitgtk webkitgtk\+"
28
29DEPENDS += " \
30 ruby-native \
31 gperf-native \
32 unifdef-native \
33 cairo \
34 harfbuzz \
35 jpeg \
36 atk \
37 libwebp \
38 gtk+3 \
39 libxslt \
40 libtasn1 \
41 libnotify \
42 gstreamer1.0 \
43 gstreamer1.0-plugins-base \
44 glib-2.0-native \
45 gettext-native \
46 "
47
48PACKAGECONFIG_SOUP ?= "soup3"
49PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd wayland x11', d)} \
50 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'webgl opengl', '', d)} \
51 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'webgl gles2', d)} \
52 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl-or-es', '', d)} \
53 enchant \
54 libsecret \
55 ${PACKAGECONFIG_SOUP} \
56 "
57
58PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND_TARGET=ON,-DENABLE_WAYLAND_TARGET=OFF,wayland libwpe wpebackend-fdo wayland-native"
59PACKAGECONFIG[angle] = "-DUSE_ANGLE_WEBGL=ON,-DUSE_ANGLE_WEBGL=OFF"
60PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/libx11 libxcomposite libxdamage libxrender libxt"
61PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
62PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant2"
63PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
64PACKAGECONFIG[jpegxl] = " -DUSE_JPEGXL=ON,-DUSE_JPEGXL=OFF,libjxl"
65PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/egl"
66PACKAGECONFIG[opengl] = "-DENABLE_GRAPHICS_CONTEXT_GL=ON,-DENABLE_GRAPHICS_CONTEXT_GL=OFF,virtual/egl"
67PACKAGECONFIG[opengl-or-es] = "-DUSE_OPENGL_OR_ES=ON,-DUSE_OPENGL_OR_ES=OFF"
68PACKAGECONFIG[libsecret] = "-DUSE_LIBSECRET=ON,-DUSE_LIBSECRET=OFF,libsecret"
69PACKAGECONFIG[libhyphen] = "-DUSE_LIBHYPHEN=ON,-DUSE_LIBHYPHEN=OFF,libhyphen"
70PACKAGECONFIG[woff2] = "-DUSE_WOFF2=ON,-DUSE_WOFF2=OFF,woff2"
71PACKAGECONFIG[openjpeg] = "-DUSE_OPENJPEG=ON,-DUSE_OPENJPEG=OFF,openjpeg"
72PACKAGECONFIG[systemd] = "-DUSE_SYSTEMD=ON,-DUSE_SYSTEMD=off,systemd"
73PACKAGECONFIG[reduce-size] = "-DCMAKE_BUILD_TYPE=MinSizeRel,-DCMAKE_BUILD_TYPE=Release,,"
74PACKAGECONFIG[lcms] = "-DUSE_LCMS=ON,-DUSE_LCMS=OFF,lcms"
75PACKAGECONFIG[soup2] = "-DUSE_SOUP2=ON,-DUSE_SOUP2=OFF,libsoup-2.4,,,soup3"
76PACKAGECONFIG[soup3] = ",,libsoup,,,soup2"
77PACKAGECONFIG[journald] = "-DENABLE_JOURNALD_LOG=ON,-DENABLE_JOURNALD_LOG=OFF,systemd"
78PACKAGECONFIG[avif] = "-DUSE_AVIF_LOG=ON,-DUSE_AVIF=OFF,libavif"
79PACKAGECONFIG[media-recorder] = "-DENABLE_MEDIA_RECORDER=ON,-DENABLE_MEDIA_RECORDER=OFF,gstreamer1.0-plugins-bad"
80PACKAGECONFIG[gamepad] = "-DENABLE_GAMEPAD=ON,-DENABLE_GAMEPAD=OFF,libmanette"
81PACKAGECONFIG[webrtc] = "-DENABLE_WEB_RTC=ON,-DENABLE_WEB_RTC=OFF"
82PACKAGECONFIG[bubblewrap] = "-DENABLE_BUBBLEWRAP_SANDBOX=ON -DBWRAP_EXECUTABLE=${bindir}/bwrap -DDBUS_PROXY_EXECUTABLE=${bindir}/xdg-dbus-proxy,-DENABLE_BUBBLEWRAP_SANDBOX=OFF,,bubblewrap xdg-dbus-proxy"
83
84EXTRA_OECMAKE = " \
85 -DPORT=GTK \
86 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
87 ${@bb.utils.contains('GIDOCGEN_ENABLED', 'True', '-DENABLE_DOCUMENTATION=ON', '-DENABLE_DOCUMENTATION=OFF', d)} \
88 -DENABLE_MINIBROWSER=ON \
89 "
90# Unless DEBUG_BUILD is enabled, pass -g1 to massively reduce the size of the
91# debug symbols (4.3GB to 700M at time of writing)
92DEBUG_FLAGS:append = "${@oe.utils.vartrue('DEBUG_BUILD', '', ' -g1', d)}"
93
94# Javascript JIT is not supported on ARC
95EXTRA_OECMAKE:append:arc = " -DENABLE_JIT=OFF "
96# By default 25-bit "medium" calls are used on ARC
97# which is not enough for binaries larger than 32 MiB
98CFLAGS:append:arc = " -mlong-calls"
99CXXFLAGS:append:arc = " -mlong-calls"
100
101# Needed for non-mesa graphics stacks when x11 is disabled
102CXXFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '-DEGL_NO_X11=1', d)}"
103
104# Javascript JIT is not supported on powerpc
105EXTRA_OECMAKE:append:powerpc = " -DENABLE_JIT=OFF "
106EXTRA_OECMAKE:append:powerpc64 = " -DENABLE_JIT=OFF "
107
108# ARM JIT code does not build on ARMv4/5/6 anymore
109EXTRA_OECMAKE:append:armv4 = " -DENABLE_JIT=OFF "
110EXTRA_OECMAKE:append:armv5 = " -DENABLE_JIT=OFF "
111EXTRA_OECMAKE:append:armv6 = " -DENABLE_JIT=OFF "
112
113# And for armv7* don't enable it for softfp, because after:
114# https://github.com/WebKit/WebKit/commit/a2ec4ef1997d6fafa6ffc607bffb54e76168a918
115# https://bugs.webkit.org/show_bug.cgi?id=242172
116# softfp armv7* fails because WEBASSEMBLY is left enabled by default and JIT gets
117# explicitly disabled causing:
118# http://errors.yoctoproject.org/Errors/Details/734587/
119# PR was sent upstream, but the end result is the same both JIT and WEBASSEMBLY disabled
120# https://github.com/WebKit/WebKit/pull/17447
121EXTRA_OECMAKE:append:armv7a = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
122EXTRA_OECMAKE:append:armv7r = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
123EXTRA_OECMAKE:append:armv7ve = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
124
125EXTRA_OECMAKE:append:mipsarch = " -DUSE_LD_GOLD=OFF "
126EXTRA_OECMAKE:append:powerpc = " -DUSE_LD_GOLD=OFF "
127
128# JIT and gold linker does not work on RISCV
129EXTRA_OECMAKE:append:riscv32 = " -DUSE_LD_GOLD=OFF -DENABLE_JIT=OFF"
130EXTRA_OECMAKE:append:riscv64 = " -DUSE_LD_GOLD=OFF"
131
132# JIT not supported on MIPS either
133EXTRA_OECMAKE:append:mipsarch = " -DENABLE_JIT=OFF -DENABLE_C_LOOP=ON "
134
135# JIT not supported on X32
136# An attempt was made to upstream JIT support for x32 in
137# https://bugs.webkit.org/show_bug.cgi?id=100450, but this was closed as
138# unresolved due to limited X32 adoption.
139EXTRA_OECMAKE:append:x86-x32 = " -DENABLE_JIT=OFF "
140
141SECURITY_CFLAGS:remove:aarch64 = "-fpie"
142SECURITY_CFLAGS:append:aarch64 = " -fPIE"
143
144FILES:${PN} += "${libdir}/webkit2gtk-4.*/injected-bundle/libwebkit2gtkinjectedbundle.so"
145
146RRECOMMENDS:${PN} += "ca-certificates shared-mime-info"
147
148# http://errors.yoctoproject.org/Errors/Details/20370/
149ARM_INSTRUCTION_SET:armv4 = "arm"
150ARM_INSTRUCTION_SET:armv5 = "arm"
151ARM_INSTRUCTION_SET:armv6 = "arm"
152
153# https://bugzilla.yoctoproject.org/show_bug.cgi?id=9474
154# https://bugs.webkit.org/show_bug.cgi?id=159880
155# JSC JIT can build on ARMv7 with -marm, but doesn't work on runtime.
156# Upstream only tests regularly the JSC JIT on ARMv7 with Thumb2 (-mthumb).
157ARM_INSTRUCTION_SET:armv7a = "thumb"
158ARM_INSTRUCTION_SET:armv7r = "thumb"
159ARM_INSTRUCTION_SET:armv7ve = "thumb"
160
161# ANGLE requires SSE support as of webkit 2.40.x on 32 bit x86
162COMPATIBLE_HOST:x86 = "${@bb.utils.contains_any('TUNE_FEATURES', 'core2 corei7', '.*', 'null', d)}"
163
164# introspection inside qemu-arm hangs forever on musl/arm builds
165# therefore disable GI_DATA
166GI_DATA_ENABLED:libc-musl:armv7a = "False"
167GI_DATA_ENABLED:libc-musl:armv7ve = "False"
168
169do_install:append() {
170 mv ${D}${bindir}/WebKitWebDriver ${D}${bindir}/WebKitWebDriver3
171}
172
173PACKAGE_PREPROCESS_FUNCS += "src_package_preprocess"
174src_package_preprocess () {
175 # Trim build paths from comments in generated sources to ensure reproducibility
176 sed -i -e "s,${WORKDIR},,g" \
177 ${B}/JavaScriptCore/DerivedSources/*.h \
178 ${B}/JavaScriptCore/DerivedSources/yarr/*.h \
179 ${B}/JavaScriptCore/PrivateHeaders/JavaScriptCore/*.h \
180 ${B}/WebCore/DerivedSources/*.cpp \
181 ${B}/WebKitGTK/DerivedSources/webkit/*.cpp
182}
183