blob: 997aa5575b06effc8f41ae68dd2097b31da93a8f [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -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/${BPN}-${PV}.tar.xz \
13 file://0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch \
14 file://reproducibility.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060015 file://0d3344e17d258106617b0e6d783d073b188a2548.patch \
Andrew Geissler5082cc72023-09-11 08:41:39 -040016 file://0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch \
Patrick Williams56b44a92024-01-19 08:49:29 -060017 file://no-musttail-arm.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060018 "
Patrick Williamsda295312023-12-05 16:48:56 -060019SRC_URI[sha256sum] = "5720aa3e8627f1b9f63252187d4df0f8233ae71d697b1796ebfbe5ca750bd118"
Andrew Geissler517393d2023-01-13 08:55:19 -060020
21inherit cmake pkgconfig gobject-introspection perlnative features_check upstream-version-is-even gi-docgen
22
23ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
Andrew Geissler5082cc72023-09-11 08:41:39 -040024REQUIRED_DISTRO_FEATURES = "opengl"
Andrew Geissler517393d2023-01-13 08:55:19 -060025
26CVE_PRODUCT = "webkitgtk webkitgtk\+"
27
Andrew Geisslerc5535c92023-01-27 16:10:19 -060028DEPENDS += " \
Andrew Geissler517393d2023-01-13 08:55:19 -060029 ruby-native \
30 gperf-native \
Andrew Geissler8f840682023-07-21 09:09:43 -050031 unifdef-native \
Andrew Geissler517393d2023-01-13 08:55:19 -060032 cairo \
33 harfbuzz \
34 jpeg \
35 atk \
36 libwebp \
Patrick Williams2a254922023-08-11 09:48:11 -050037 gtk4 \
Andrew Geissler517393d2023-01-13 08:55:19 -060038 libxslt \
39 libtasn1 \
40 libnotify \
41 gstreamer1.0 \
42 gstreamer1.0-plugins-base \
Patrick Williams8e7b46e2023-05-01 14:19:06 -050043 glib-2.0-native \
44 gettext-native \
Andrew Geissler517393d2023-01-13 08:55:19 -060045 "
46
47PACKAGECONFIG_SOUP ?= "soup3"
48PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd wayland x11', d)} \
49 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'webgl opengl', '', d)} \
50 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'webgl gles2', d)} \
51 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl-or-es', '', d)} \
52 enchant \
53 libsecret \
54 ${PACKAGECONFIG_SOUP} \
55 "
56
57PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND_TARGET=ON,-DENABLE_WAYLAND_TARGET=OFF,wayland libwpe wpebackend-fdo wayland-native"
58PACKAGECONFIG[angle] = "-DUSE_ANGLE_WEBGL=ON,-DUSE_ANGLE_WEBGL=OFF"
59PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/libx11 libxcomposite libxdamage libxrender libxt"
60PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
61PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant2"
62PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
63PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/egl"
64PACKAGECONFIG[opengl] = "-DENABLE_GRAPHICS_CONTEXT_GL=ON,-DENABLE_GRAPHICS_CONTEXT_GL=OFF,virtual/egl"
65PACKAGECONFIG[opengl-or-es] = "-DUSE_OPENGL_OR_ES=ON,-DUSE_OPENGL_OR_ES=OFF"
66PACKAGECONFIG[libsecret] = "-DUSE_LIBSECRET=ON,-DUSE_LIBSECRET=OFF,libsecret"
67PACKAGECONFIG[libhyphen] = "-DUSE_LIBHYPHEN=ON,-DUSE_LIBHYPHEN=OFF,libhyphen"
68PACKAGECONFIG[woff2] = "-DUSE_WOFF2=ON,-DUSE_WOFF2=OFF,woff2"
69PACKAGECONFIG[openjpeg] = "-DUSE_OPENJPEG=ON,-DUSE_OPENJPEG=OFF,openjpeg"
70PACKAGECONFIG[systemd] = "-DUSE_SYSTEMD=ON,-DUSE_SYSTEMD=off,systemd"
71PACKAGECONFIG[reduce-size] = "-DCMAKE_BUILD_TYPE=MinSizeRel,-DCMAKE_BUILD_TYPE=Release,,"
72PACKAGECONFIG[lcms] = "-DUSE_LCMS=ON,-DUSE_LCMS=OFF,lcms"
73PACKAGECONFIG[soup2] = "-DUSE_SOUP2=ON,-DUSE_SOUP2=OFF,libsoup-2.4,,,soup3"
74PACKAGECONFIG[soup3] = ",,libsoup,,,soup2"
75PACKAGECONFIG[journald] = "-DENABLE_JOURNALD_LOG=ON,-DENABLE_JOURNALD_LOG=OFF,systemd"
Andrew Geissler8f840682023-07-21 09:09:43 -050076PACKAGECONFIG[avif] = "-DUSE_AVIF_LOG=ON,-DUSE_AVIF=OFF,libavif"
77PACKAGECONFIG[media-recorder] = "-DENABLE_MEDIA_RECORDER=ON,-DENABLE_MEDIA_RECORDER=OFF,gstreamer1.0-plugins-bad"
Patrick Williamsda295312023-12-05 16:48:56 -060078PACKAGECONFIG[jpegxl] = "-DUSE_JPEGXL=ON,-DUSE_JPEGXL=OFF,libjxl"
Andrew Geissler517393d2023-01-13 08:55:19 -060079
Andrew Geissler517393d2023-01-13 08:55:19 -060080EXTRA_OECMAKE = " \
Andrew Geissler5082cc72023-09-11 08:41:39 -040081 -DPORT=GTK \
82 ${@oe.utils.vartrue('GI_DATA_ENABLED', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
83 ${@oe.utils.vartrue('GIDOCGEN_ENABLED', '-DENABLE_DOCUMENTATION=ON', '-DENABLE_DOCUMENTATION=OFF', d)} \
84 ${@oe.utils.vartrue('DEBUG_BUILD', '-DWEBKIT_NO_INLINE_HINTS=ON', '-DWEBKIT_NO_INLINE_HINTS=OFFF', d)} \
85 -DENABLE_MINIBROWSER=ON \
86 -DENABLE_BUBBLEWRAP_SANDBOX=OFF \
87 -DENABLE_GAMEPAD=OFF \
88 -DUSE_GTK4=ON \
89 "
Andrew Geissler517393d2023-01-13 08:55:19 -060090
Andrew Geissler220dafd2023-10-04 10:18:08 -050091# Unless DEBUG_BUILD is enabled, pass -g1 to massively reduce the size of the
92# debug symbols (4.3GB to 700M at time of writing)
93DEBUG_FLAGS:append = "${@oe.utils.vartrue('DEBUG_BUILD', '', ' -g1', d)}"
94
Andrew Geissler517393d2023-01-13 08:55:19 -060095# Javascript JIT is not supported on ARC
96EXTRA_OECMAKE:append:arc = " -DENABLE_JIT=OFF "
97# By default 25-bit "medium" calls are used on ARC
98# which is not enough for binaries larger than 32 MiB
99CFLAGS:append:arc = " -mlong-calls"
100CXXFLAGS:append:arc = " -mlong-calls"
101
102# Needed for non-mesa graphics stacks when x11 is disabled
103CXXFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '-DEGL_NO_X11=1', d)}"
104
105# Javascript JIT is not supported on powerpc
106EXTRA_OECMAKE:append:powerpc = " -DENABLE_JIT=OFF "
107EXTRA_OECMAKE:append:powerpc64 = " -DENABLE_JIT=OFF "
108
109# ARM JIT code does not build on ARMv4/5/6 anymore
Andrew Geissler5082cc72023-09-11 08:41:39 -0400110EXTRA_OECMAKE:append:armv4 = " -DENABLE_JIT=OFF "
Andrew Geissler517393d2023-01-13 08:55:19 -0600111EXTRA_OECMAKE:append:armv5 = " -DENABLE_JIT=OFF "
112EXTRA_OECMAKE:append:armv6 = " -DENABLE_JIT=OFF "
Andrew Geissler5082cc72023-09-11 08:41:39 -0400113
114# And for armv7* don't enable it for softfp, because after:
115# https://github.com/WebKit/WebKit/commit/a2ec4ef1997d6fafa6ffc607bffb54e76168a918
116# https://bugs.webkit.org/show_bug.cgi?id=242172
117# softfp armv7* fails because WEBASSEMBLY is left enabled by default and JIT gets
118# explicitly disabled causing:
119# http://errors.yoctoproject.org/Errors/Details/734587/
120# PR was sent upstream, but the end result is the same both JIT and WEBASSEMBLY disabled
121# https://github.com/WebKit/WebKit/pull/17447
122EXTRA_OECMAKE:append:armv7a = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
123EXTRA_OECMAKE:append:armv7r = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
124EXTRA_OECMAKE:append:armv7ve = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
Andrew Geissler517393d2023-01-13 08:55:19 -0600125
126EXTRA_OECMAKE:append:mipsarch = " -DUSE_LD_GOLD=OFF "
127EXTRA_OECMAKE:append:powerpc = " -DUSE_LD_GOLD=OFF "
128
129# JIT and gold linker does not work on RISCV
130EXTRA_OECMAKE:append:riscv32 = " -DUSE_LD_GOLD=OFF -DENABLE_JIT=OFF"
Andrew Geissler8f840682023-07-21 09:09:43 -0500131EXTRA_OECMAKE:append:riscv64 = " -DUSE_LD_GOLD=OFF"
Andrew Geissler517393d2023-01-13 08:55:19 -0600132
133# JIT not supported on MIPS either
134EXTRA_OECMAKE:append:mipsarch = " -DENABLE_JIT=OFF -DENABLE_C_LOOP=ON "
135
136# JIT not supported on X32
137# An attempt was made to upstream JIT support for x32 in
138# https://bugs.webkit.org/show_bug.cgi?id=100450, but this was closed as
139# unresolved due to limited X32 adoption.
140EXTRA_OECMAKE:append:x86-x32 = " -DENABLE_JIT=OFF "
141
142SECURITY_CFLAGS:remove:aarch64 = "-fpie"
143SECURITY_CFLAGS:append:aarch64 = " -fPIE"
144
Patrick Williams2a254922023-08-11 09:48:11 -0500145FILES:${PN} += "${libdir}/webkitgtk-*/injected-bundle/*.so"
Andrew Geissler517393d2023-01-13 08:55:19 -0600146
147RRECOMMENDS:${PN} += "ca-certificates shared-mime-info"
148
149# http://errors.yoctoproject.org/Errors/Details/20370/
150ARM_INSTRUCTION_SET:armv4 = "arm"
151ARM_INSTRUCTION_SET:armv5 = "arm"
152ARM_INSTRUCTION_SET:armv6 = "arm"
153
154# https://bugzilla.yoctoproject.org/show_bug.cgi?id=9474
155# https://bugs.webkit.org/show_bug.cgi?id=159880
156# JSC JIT can build on ARMv7 with -marm, but doesn't work on runtime.
157# Upstream only tests regularly the JSC JIT on ARMv7 with Thumb2 (-mthumb).
158ARM_INSTRUCTION_SET:armv7a = "thumb"
159ARM_INSTRUCTION_SET:armv7r = "thumb"
160ARM_INSTRUCTION_SET:armv7ve = "thumb"
161
Andrew Geissler8f840682023-07-21 09:09:43 -0500162# ANGLE requires SSE support as of webkit 2.40.x on 32 bit x86
163COMPATIBLE_HOST:x86 = "${@bb.utils.contains_any('TUNE_FEATURES', 'core2 corei7', '.*', 'null', d)}"
164
Andrew Geissler517393d2023-01-13 08:55:19 -0600165# introspection inside qemu-arm hangs forever on musl/arm builds
166# therefore disable GI_DATA
167GI_DATA_ENABLED:libc-musl:armv7a = "False"
168GI_DATA_ENABLED:libc-musl:armv7ve = "False"
169
170# Can't be built with ccache
171CCACHE_DISABLE = "1"
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 \
Andrew Geissler8f840682023-07-21 09:09:43 -0500180 ${B}/WebCore/DerivedSources/*.cpp \
181 ${B}/WebKitGTK/DerivedSources/webkit/*.cpp
Andrew Geissler517393d2023-01-13 08:55:19 -0600182}
183