Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/webkit-gtk/files/, net-libs/webkit-gtk/
Date: Sat, 09 May 2020 20:40:29
Message-Id: 1589056773.cad04281bde21306bed8efe2fb68e6cc955bdab4.leio@gentoo
1 commit: cad04281bde21306bed8efe2fb68e6cc955bdab4
2 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
3 AuthorDate: Sat May 9 19:16:08 2020 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Sat May 9 20:39:33 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cad04281
7
8 net-libs/webkit-gtk: bump to 2.28.2, fix various build issues
9
10 Fix build issue when ccache is found.
11 Try to fix various opengl without X build issues.
12 USE="gstreamer X" requires gst-plugins-base[X].
13
14 Includes a few patches that have been marked as 2.28.3 candidates by
15 upstream.
16
17 Closes: https://bugs.gentoo.org/717888
18 Bug: https://bugs.gentoo.org/712260
19 Package-Manager: Portage-2.3.84, Repoman-2.3.20
20 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
21
22 net-libs/webkit-gtk/Manifest | 1 +
23 .../webkit-gtk/files/2.28.2-fix-ppc64-JSC.patch | 59 +++++
24 .../files/2.28.2-fix-yelp-desktopless-build.patch | 53 ++++
25 .../files/2.28.2-opengl-without-X-fixes.patch | 53 ++++
26 .../files/2.28.2-use-gst-audiointerleave.patch | 55 ++++
27 net-libs/webkit-gtk/webkit-gtk-2.28.2.ebuild | 291 +++++++++++++++++++++
28 6 files changed, 512 insertions(+)
29
30 diff --git a/net-libs/webkit-gtk/Manifest b/net-libs/webkit-gtk/Manifest
31 index ba34c035271..ec39ddf8a52 100644
32 --- a/net-libs/webkit-gtk/Manifest
33 +++ b/net-libs/webkit-gtk/Manifest
34 @@ -1,3 +1,4 @@
35 DIST webkitgtk-2.24.4.tar.xz 17575784 BLAKE2B c30683ea365a50d7def572305b49278343d67739f9bd3cfd78cb08b5cc87b5453504df9b09752f8d6483b18b9b812f3d3cddc084762cfa8990fcc651660b89c2 SHA512 1d713955a735ae2e2229beea7bda7f518a6247c6aa7f5753aeb5b5c6395339d451d0d146f7188e7ba65cb82ea5a74a5e73e956fe59d5f5f97659a44af33df112
36 DIST webkitgtk-2.26.4.tar.xz 19329636 BLAKE2B 9dc88bf9e2bec4f3ccc316f4967e991595fa17151ad74781ea514e72700f2bd1f3ed32c5ee662eb1d04fa023e7c33ad1215078415b67c939ee0d4f6d55358d4a SHA512 b4d96672d0a41fb7591dd312254fc1b7a85e632923bf2d954d79d395306db96d5a6b4f85e24ea4ba0a447e45e29a41882249c26f6b2d6d572225abefcf28a474
37 DIST webkitgtk-2.28.1.tar.xz 21427628 BLAKE2B 58f19d68598ed1aee58f9f700c84e76c9c58980e39d7fe1883c3be991f575074db3156b9a7a041bb3d59130d87d37b1bdee9cf6c122c4f0b0ba6637d66534c32 SHA512 30cfe63d202673d1f0b0ab32e062eab225e51b993d9bb0f51c02d0497423e1591b5a2e943c30d1c9ee6d9073dfbd13b8ec24bca94f380fe8886019e8185628b8
38 +DIST webkitgtk-2.28.2.tar.xz 21427772 BLAKE2B 0749ffac526ae90ffb8af3fbf8f9ce87db80f229b96e2daa435f9bd6e6e985bbb8c33011976213b2e4ce286c9f1d38f0b85279507cdc9c52b95fbeb32c9f676c SHA512 c7c0c55b1ebc61c0ec9cd9af96a12058a96ba9b011330b12c7c2776685736e0edf604f5eee639637cb50b2967d77c2db4dea15050a575fd34a1f6f0a8b8c56f8
39
40 diff --git a/net-libs/webkit-gtk/files/2.28.2-fix-ppc64-JSC.patch b/net-libs/webkit-gtk/files/2.28.2-fix-ppc64-JSC.patch
41 new file mode 100644
42 index 00000000000..96e4d7d0aa2
43 --- /dev/null
44 +++ b/net-libs/webkit-gtk/files/2.28.2-fix-ppc64-JSC.patch
45 @@ -0,0 +1,59 @@
46 +From 46c7d3ea88dd77223f25c48ce4a8688db71c489b Mon Sep 17 00:00:00 2001
47 +From: "commit-queue@××××××.org"
48 + <commit-queue@××××××.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
49 +Date: Thu, 7 May 2020 19:30:28 +0000
50 +Subject: [PATCH] REGRESSION(r251875): Crash in JSC::StructureIDTable::get on
51 + ppc64le: gcSafeMemcpy broken on JSVALUE64 platforms other than x86_64 and
52 + aarch64 https://bugs.webkit.org/show_bug.cgi?id=210685
53 +
54 +Patch by Daniel Kolesa <daniel@×××××××××.org> on 2020-05-07
55 +Reviewed by Michael Catanzaro.
56 +
57 +Fix gcSafeMemcpy on non-x86_64/aarch64 64-bit architectures.
58 +
59 +We were hitting an incorrect x86_64 assertion on values larger than
60 +mediumCutoff on JSVALUE64 architectures other than x86_64 and aarch64,
61 +as the control flow is wrong.
62 +
63 +* heap/GCMemoryOperations.h:
64 +(JSC::gcSafeMemcpy):
65 +
66 +git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
67 +---
68 + Source/JavaScriptCore/heap/GCMemoryOperations.h | 6 ++----
69 + 1 file changed, 2 insertions(+), 4 deletions(-)
70 +
71 +diff --git a/Source/JavaScriptCore/heap/GCMemoryOperations.h b/Source/JavaScriptCore/heap/GCMemoryOperations.h
72 +index f2b9e385bc9..ff66071db20 100644
73 +--- a/Source/JavaScriptCore/heap/GCMemoryOperations.h
74 ++++ b/Source/JavaScriptCore/heap/GCMemoryOperations.h
75 +@@ -53,7 +53,7 @@ ALWAYS_INLINE void gcSafeMemcpy(T* dst, T* src, size_t bytes)
76 + bitwise_cast<volatile uint64_t*>(dst)[i] = bitwise_cast<volatile uint64_t*>(src)[i];
77 + };
78 +
79 +-#if COMPILER(GCC_COMPATIBLE) && USE(JSVALUE64)
80 ++#if COMPILER(GCC_COMPATIBLE) && (CPU(X86_64) || CPU(ARM64))
81 + if (bytes <= smallCutoff)
82 + slowPathForwardMemcpy();
83 + else if (isARM64() || bytes <= mediumCutoff) {
84 +@@ -121,8 +121,6 @@ ALWAYS_INLINE void gcSafeMemcpy(T* dst, T* src, size_t bytes)
85 + :
86 + : "d0", "d1", "memory"
87 + );
88 +-#else
89 +- slowPathForwardMemcpy();
90 + #endif // CPU(X86_64)
91 + } else {
92 + RELEASE_ASSERT(isX86_64());
93 +@@ -139,7 +137,7 @@ ALWAYS_INLINE void gcSafeMemcpy(T* dst, T* src, size_t bytes)
94 + }
95 + #else
96 + slowPathForwardMemcpy();
97 +-#endif // COMPILER(GCC_COMPATIBLE)
98 ++#endif // COMPILER(GCC_COMPATIBLE) && (CPU(X86_64) || CPU(ARM64))
99 + #else
100 + memcpy(dst, src, bytes);
101 + #endif // USE(JSVALUE64)
102 +--
103 +2.20.1
104 +
105
106 diff --git a/net-libs/webkit-gtk/files/2.28.2-fix-yelp-desktopless-build.patch b/net-libs/webkit-gtk/files/2.28.2-fix-yelp-desktopless-build.patch
107 new file mode 100644
108 index 00000000000..fdf9d7d4d20
109 --- /dev/null
110 +++ b/net-libs/webkit-gtk/files/2.28.2-fix-yelp-desktopless-build.patch
111 @@ -0,0 +1,53 @@
112 +From 9cd4011a12bf658aad3776251792bacdc894643a Mon Sep 17 00:00:00 2001
113 +From: "berto@××××××.com"
114 + <berto@××××××.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
115 +Date: Mon, 27 Apr 2020 11:52:10 +0000
116 +Subject: [PATCH] [GTK] [2.28.0] The Yelp build crashes if DISPLAY is not set
117 + https://bugs.webkit.org/show_bug.cgi?id=209431
118 +
119 +Reviewed by Carlos Garcia Campos.
120 +
121 +Don't create a PlatformDisplayLibWPE as a fallback when using
122 +Wayland or X11.
123 +
124 +* platform/graphics/PlatformDisplay.cpp:
125 +(WebCore::PlatformDisplay::createPlatformDisplay):
126 +
127 +git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
128 +---
129 + Source/WebCore/platform/graphics/PlatformDisplay.cpp | 12 ++++++------
130 + 1 file changed, 6 insertions(+), 6 deletions(-)
131 +
132 +diff --git a/Source/WebCore/platform/graphics/PlatformDisplay.cpp b/Source/WebCore/platform/graphics/PlatformDisplay.cpp
133 +index 8bb47ca2b77..f9547b3af69 100644
134 +--- a/Source/WebCore/platform/graphics/PlatformDisplay.cpp
135 ++++ b/Source/WebCore/platform/graphics/PlatformDisplay.cpp
136 +@@ -98,12 +98,6 @@ std::unique_ptr<PlatformDisplay> PlatformDisplay::createPlatformDisplay()
137 + }
138 + #endif // PLATFORM(GTK)
139 +
140 +-#if USE(WPE_RENDERER)
141 +- return PlatformDisplayLibWPE::create();
142 +-#elif PLATFORM(WIN)
143 +- return PlatformDisplayWin::create();
144 +-#endif
145 +-
146 + #if PLATFORM(WAYLAND)
147 + if (auto platformDisplay = PlatformDisplayWayland::create())
148 + return platformDisplay;
149 +@@ -121,6 +115,12 @@ std::unique_ptr<PlatformDisplay> PlatformDisplay::createPlatformDisplay()
150 + return PlatformDisplayX11::create(nullptr);
151 + #endif
152 +
153 ++#if USE(WPE_RENDERER)
154 ++ return PlatformDisplayLibWPE::create();
155 ++#elif PLATFORM(WIN)
156 ++ return PlatformDisplayWin::create();
157 ++#endif
158 ++
159 + RELEASE_ASSERT_NOT_REACHED();
160 + }
161 +
162 +--
163 +2.20.1
164 +
165
166 diff --git a/net-libs/webkit-gtk/files/2.28.2-opengl-without-X-fixes.patch b/net-libs/webkit-gtk/files/2.28.2-opengl-without-X-fixes.patch
167 new file mode 100644
168 index 00000000000..6976c3ce4db
169 --- /dev/null
170 +++ b/net-libs/webkit-gtk/files/2.28.2-opengl-without-X-fixes.patch
171 @@ -0,0 +1,53 @@
172 +From c67efa2bbe2094b40b4e104bb26497c2aff5ce68 Mon Sep 17 00:00:00 2001
173 +From: Mart Raudsepp <leio@g.o>
174 +Date: Sat, 9 May 2020 23:11:52 +0300
175 +Subject: [PATCH] Clean up OpenGLShims.h conditionals in a few places to fix
176 + some build configurations
177 +
178 +---
179 + Source/WebCore/platform/graphics/GLContext.cpp | 5 ++++-
180 + Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp | 5 ++++-
181 + 2 files changed, 8 insertions(+), 2 deletions(-)
182 +
183 +diff --git a/Source/WebCore/platform/graphics/GLContext.cpp b/Source/WebCore/platform/graphics/GLContext.cpp
184 +index b217988b990..1ba0eb8a482 100644
185 +--- a/Source/WebCore/platform/graphics/GLContext.cpp
186 ++++ b/Source/WebCore/platform/graphics/GLContext.cpp
187 +@@ -28,6 +28,9 @@
188 +
189 + #if USE(GLX)
190 + #include "GLContextGLX.h"
191 ++#endif
192 ++
193 ++#if !USE(OPENGL_ES) && !USE(LIBEPOXY) && !USE(ANGLE)
194 + #include "OpenGLShims.h"
195 + #endif
196 +
197 +@@ -57,7 +60,7 @@ inline ThreadGlobalGLContext* currentContext()
198 +
199 + static bool initializeOpenGLShimsIfNeeded()
200 + {
201 +-#if USE(OPENGL_ES) || USE(LIBEPOXY)
202 ++#if USE(OPENGL_ES) || USE(LIBEPOXY) || USE(ANGLE)
203 + return true;
204 + #else
205 + static bool initialized = false;
206 +diff --git a/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp b/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
207 +index 3515be452b2..82cce70f14b 100644
208 +--- a/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
209 ++++ b/Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
210 +@@ -64,7 +64,10 @@
211 +
212 + #if USE(GLX)
213 + #include <GL/glx.h>
214 +-#include <WebCore/OpenGLShims.h>
215 ++#endif
216 ++
217 ++#if !USE(OPENGL_ES) && !USE(LIBEPOXY) && !USE(ANGLE)
218 ++#include "WebCore/OpenGLShims.h"
219 + #endif
220 +
221 + #if USE(GSTREAMER)
222 +--
223 +2.20.1
224 +
225
226 diff --git a/net-libs/webkit-gtk/files/2.28.2-use-gst-audiointerleave.patch b/net-libs/webkit-gtk/files/2.28.2-use-gst-audiointerleave.patch
227 new file mode 100644
228 index 00000000000..f4bc7291a80
229 --- /dev/null
230 +++ b/net-libs/webkit-gtk/files/2.28.2-use-gst-audiointerleave.patch
231 @@ -0,0 +1,55 @@
232 +From 43686247013a1230d47b46d637f928eb47c99609 Mon Sep 17 00:00:00 2001
233 +From: "commit-queue@××××××.org"
234 + <commit-queue@××××××.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
235 +Date: Wed, 29 Apr 2020 08:14:06 +0000
236 +Subject: [PATCH] [GStreamer] Switch to audiointerleave
237 + https://bugs.webkit.org/show_bug.cgi?id=211124
238 +
239 +Patch by Philippe Normand <pnormand@××××××.com> on 2020-04-29
240 +Reviewed by Xabier Rodriguez-Calvar.
241 +
242 +The audiointerleave element is a drop-in replacement of
243 +interleave. It should behave a bit better in live.
244 +
245 +No new tests, existing webaudio tests cover this change.
246 +
247 +* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
248 +(webKitWebAudioSrcConstructed):
249 +(webKitWebAudioSrcChangeState):
250 +
251 +git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
252 +---
253 + .../audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp | 8 ++++----
254 + 1 file changed, 4 insertions(+), 4 deletions(-)
255 +
256 +diff --git a/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
257 +index 2f937f677cc..ea134b7b1b2 100644
258 +--- a/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
259 ++++ b/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
260 +@@ -211,10 +211,10 @@ static void webKitWebAudioSrcConstructed(GObject* object)
261 + ASSERT(priv->provider);
262 + ASSERT(priv->sampleRate);
263 +
264 +- priv->interleave = gst_element_factory_make("interleave", nullptr);
265 ++ priv->interleave = gst_element_factory_make("audiointerleave", nullptr);
266 +
267 + if (!priv->interleave) {
268 +- GST_ERROR_OBJECT(src, "Failed to create interleave");
269 ++ GST_ERROR_OBJECT(src, "Failed to create audiointerleave");
270 + return;
271 + }
272 +
273 +@@ -398,8 +398,8 @@ static GstStateChangeReturn webKitWebAudioSrcChangeState(GstElement* element, Gs
274 + switch (transition) {
275 + case GST_STATE_CHANGE_NULL_TO_READY:
276 + if (!src->priv->interleave) {
277 +- gst_element_post_message(element, gst_missing_element_message_new(element, "interleave"));
278 +- GST_ELEMENT_ERROR(src, CORE, MISSING_PLUGIN, (nullptr), ("no interleave"));
279 ++ gst_element_post_message(element, gst_missing_element_message_new(element, "audiointerleave"));
280 ++ GST_ELEMENT_ERROR(src, CORE, MISSING_PLUGIN, (nullptr), ("no audiointerleave"));
281 + return GST_STATE_CHANGE_FAILURE;
282 + }
283 + src->priv->numberOfSamples = 0;
284 +--
285 +2.20.1
286 +
287
288 diff --git a/net-libs/webkit-gtk/webkit-gtk-2.28.2.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.28.2.ebuild
289 new file mode 100644
290 index 00000000000..2d5533bf953
291 --- /dev/null
292 +++ b/net-libs/webkit-gtk/webkit-gtk-2.28.2.ebuild
293 @@ -0,0 +1,291 @@
294 +# Copyright 1999-2020 Gentoo Authors
295 +# Distributed under the terms of the GNU General Public License v2
296 +
297 +EAPI=6
298 +CMAKE_MAKEFILE_GENERATOR="ninja"
299 +PYTHON_COMPAT=( python{3_6,3_7} )
300 +USE_RUBY="ruby24 ruby25 ruby26 ruby27"
301 +CMAKE_MIN_VERSION=3.10
302 +
303 +inherit check-reqs cmake-utils flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs virtualx
304 +
305 +MY_P="webkitgtk-${PV}"
306 +DESCRIPTION="Open source web browser engine"
307 +HOMEPAGE="https://www.webkitgtk.org"
308 +SRC_URI="https://www.webkitgtk.org/releases/${MY_P}.tar.xz"
309 +
310 +LICENSE="LGPL-2+ BSD"
311 +SLOT="4/37" # soname version of libwebkit2gtk-4.0
312 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~sparc ~x86"
313 +
314 +IUSE="aqua +egl +geolocation gles2-only gnome-keyring +gstreamer gtk-doc +introspection +jpeg2k +jumbo-build libnotify +opengl seccomp spell wayland +X"
315 +
316 +# gstreamer with opengl/gles2 needs egl
317 +REQUIRED_USE="
318 + gles2-only? ( egl !opengl )
319 + gstreamer? ( opengl? ( egl ) )
320 + wayland? ( egl )
321 + || ( aqua wayland X )
322 +"
323 +
324 +# Tests fail to link for inexplicable reasons
325 +# https://bugs.webkit.org/show_bug.cgi?id=148210
326 +RESTRICT="test"
327 +
328 +# Aqua support in gtk3 is untested
329 +# Dependencies found at Source/cmake/OptionsGTK.cmake
330 +# Various compile-time optionals for gtk+-3.22.0 - ensure it
331 +# Missing WebRTC support, but ENABLE_MEDIA_STREAM/ENABLE_WEB_RTC is experimental upstream (PRIVATE OFF) and shouldn't be used yet in 2.26
332 +# >=gst-plugins-opus-1.14.4-r1 for opusparse (required by MSE)
333 +wpe_depend="
334 + >=gui-libs/libwpe-1.3.0:1.0
335 + >=gui-libs/wpebackend-fdo-1.3.1:1.0
336 +"
337 +RDEPEND="
338 + >=x11-libs/cairo-1.16.0:=[X?]
339 + >=media-libs/fontconfig-2.13.0:1.0
340 + >=media-libs/freetype-2.9.0:2
341 + >=dev-libs/libgcrypt-1.7.0:0=
342 + >=x11-libs/gtk+-3.22.0:3[aqua?,introspection?,wayland?,X?]
343 + >=media-libs/harfbuzz-1.4.2:=[icu(+)]
344 + >=dev-libs/icu-3.8.1-r1:=
345 + virtual/jpeg:0=
346 + >=net-libs/libsoup-2.54:2.4[introspection?]
347 + >=dev-libs/libxml2-2.8.0:2
348 + >=media-libs/libpng-1.4:0=
349 + dev-db/sqlite:3=
350 + sys-libs/zlib:0
351 + >=dev-libs/atk-2.16.0
352 + media-libs/libwebp:=
353 +
354 + >=dev-libs/glib-2.44.0:2
355 + >=dev-libs/libxslt-1.1.7
356 + media-libs/woff2
357 + gnome-keyring? ( app-crypt/libsecret )
358 + introspection? ( >=dev-libs/gobject-introspection-1.32.0:= )
359 + dev-libs/libtasn1:=
360 + spell? ( >=app-text/enchant-0.22:2 )
361 + gstreamer? (
362 + >=media-libs/gstreamer-1.14:1.0
363 + >=media-libs/gst-plugins-base-1.14:1.0[egl?,opengl?,X?]
364 + gles2-only? ( media-libs/gst-plugins-base:1.0[gles2] )
365 + >=media-plugins/gst-plugins-opus-1.14.4-r1:1.0
366 + >=media-libs/gst-plugins-bad-1.14:1.0 )
367 +
368 + X? (
369 + x11-libs/libX11
370 + x11-libs/libXcomposite
371 + x11-libs/libXdamage
372 + x11-libs/libXrender
373 + x11-libs/libXt )
374 +
375 + libnotify? ( x11-libs/libnotify )
376 + dev-libs/hyphen
377 + jpeg2k? ( >=media-libs/openjpeg-2.2.0:2= )
378 +
379 + egl? ( media-libs/mesa[egl] )
380 + gles2-only? ( media-libs/mesa[gles2] )
381 + opengl? ( virtual/opengl )
382 + wayland? (
383 + dev-libs/wayland
384 + >=dev-libs/wayland-protocols-1.12
385 + opengl? ( ${wpe_depend} )
386 + gles2-only? ( ${wpe_depend} )
387 + )
388 +
389 + seccomp? (
390 + >=sys-apps/bubblewrap-0.3.1
391 + sys-libs/libseccomp
392 + sys-apps/xdg-dbus-proxy
393 + )
394 +"
395 +unset wpe_depend
396 +# paxctl needed for bug #407085
397 +# Need real bison, not yacc
398 +DEPEND="${RDEPEND}
399 + ${PYTHON_DEPS}
400 + ${RUBY_DEPS}
401 + >=app-accessibility/at-spi2-core-2.5.3
402 + dev-util/glib-utils
403 + >=dev-util/gperf-3.0.1
404 + >=sys-devel/bison-2.4.3
405 + || ( >=sys-devel/gcc-7.3 >=sys-devel/clang-5 )
406 + sys-devel/gettext
407 + virtual/pkgconfig
408 +
409 + >=dev-lang/perl-5.10
410 + virtual/perl-Data-Dumper
411 + virtual/perl-Carp
412 + virtual/perl-JSON-PP
413 +
414 + gtk-doc? ( >=dev-util/gtk-doc-1.10 )
415 + geolocation? ( dev-util/gdbus-codegen )
416 +"
417 +# test? (
418 +# dev-python/pygobject:3[python_targets_python2_7]
419 +# x11-themes/hicolor-icon-theme
420 +# jit? ( sys-apps/paxctl ) )
421 +RDEPEND="${RDEPEND}
422 + geolocation? ( >=app-misc/geoclue-2.1.5:2.0 )
423 +"
424 +
425 +S="${WORKDIR}/${MY_P}"
426 +
427 +CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307
428 +
429 +pkg_pretend() {
430 + if [[ ${MERGE_TYPE} != "binary" ]] ; then
431 + if is-flagq "-g*" && ! is-flagq "-g*0" ; then
432 + einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS"
433 + check-reqs_pkg_pretend
434 + fi
435 +
436 + if ! test-flag-CXX -std=c++17 ; then
437 + die "You need at least GCC 7.3.x or Clang >= 5 for C++17-specific compiler flags"
438 + fi
439 + fi
440 +
441 + if ! use opengl && ! use gles2-only; then
442 + ewarn
443 + ewarn "You are disabling OpenGL usage (USE=opengl or USE=gles2-only) completely."
444 + ewarn "This is an unsupported configuration meant for very specific embedded"
445 + ewarn "use cases, where there truly is no GL possible (and even that use case"
446 + ewarn "is very unlikely to come by). If you have GL (even software-only), you"
447 + ewarn "really really should be enabling OpenGL!"
448 + ewarn
449 + fi
450 +}
451 +
452 +pkg_setup() {
453 + if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
454 + check-reqs_pkg_setup
455 + fi
456 +
457 + python-any-r1_pkg_setup
458 +}
459 +
460 +src_prepare() {
461 + eapply "${FILESDIR}/${PN}-2.24.4-eglmesaext-include.patch" # bug 699054 # https://bugs.webkit.org/show_bug.cgi?id=204108
462 + eapply "${FILESDIR}"/2.26.3-fix-gtk-doc.patch # bug 704550 - retest without it once we can depend on >=gtk-doc-1.32
463 + eapply "${FILESDIR}"/${PV}-fix-yelp-desktopless-build.patch
464 + eapply "${FILESDIR}"/${PV}-use-gst-audiointerleave.patch
465 + eapply "${FILESDIR}"/${PV}-fix-ppc64-JSC.patch
466 + eapply "${FILESDIR}"/${PV}-opengl-without-X-fixes.patch
467 + cmake-utils_src_prepare
468 + gnome2_src_prepare
469 +}
470 +
471 +src_configure() {
472 + # Respect CC, otherwise fails on prefix #395875
473 + tc-export CC
474 +
475 + # It does not compile on alpha without this in LDFLAGS
476 + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648761
477 + use alpha && append-ldflags "-Wl,--no-relax"
478 +
479 + # ld segfaults on ia64 with LDFLAGS --as-needed, bug #555504
480 + use ia64 && append-ldflags "-Wl,--no-as-needed"
481 +
482 + # Sigbuses on SPARC with mcpu and co., bug #???
483 + use sparc && filter-flags "-mvis"
484 +
485 + # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634
486 + use ppc64 && append-flags "-mminimal-toc"
487 +
488 + # Try to use less memory, bug #469942 (see Fedora .spec for reference)
489 + # --no-keep-memory doesn't work on ia64, bug #502492
490 + if ! use ia64; then
491 + append-ldflags "-Wl,--no-keep-memory"
492 + fi
493 +
494 + # We try to use gold when possible for this package
495 +# if ! tc-ld-is-gold ; then
496 +# append-ldflags "-Wl,--reduce-memory-overheads"
497 +# fi
498 +
499 + # Ruby situation is a bit complicated. See bug 513888
500 + local rubyimpl
501 + local ruby_interpreter=""
502 + for rubyimpl in ${USE_RUBY}; do
503 + if has_version --host-root "virtual/rubygems[ruby_targets_${rubyimpl}]"; then
504 + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ${rubyimpl})"
505 + fi
506 + done
507 + # This will rarely occur. Only a couple of corner cases could lead us to
508 + # that failure. See bug 513888
509 + [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
510 +
511 + # TODO: Check Web Audio support
512 + # should somehow let user select between them?
513 + #
514 + # opengl needs to be explicetly handled, bug #576634
515 +
516 + local use_wpe_renderer=OFF
517 + local opengl_enabled
518 + if use opengl || use gles2-only; then
519 + opengl_enabled=ON
520 + use wayland && use_wpe_renderer=ON
521 + else
522 + opengl_enabled=OFF
523 + fi
524 +
525 + local mycmakeargs=(
526 + -DENABLE_UNIFIED_BUILDS=$(usex jumbo-build)
527 + -DENABLE_QUARTZ_TARGET=$(usex aqua)
528 + -DENABLE_API_TESTS=$(usex test)
529 + -DENABLE_GTKDOC=$(usex gtk-doc)
530 + -DENABLE_GEOLOCATION=$(usex geolocation) # Runtime optional (talks over dbus service)
531 + $(cmake-utils_use_find_package gles2-only OpenGLES2)
532 + -DENABLE_GLES2=$(usex gles2-only)
533 + -DENABLE_VIDEO=$(usex gstreamer)
534 + -DENABLE_WEB_AUDIO=$(usex gstreamer)
535 + -DENABLE_INTROSPECTION=$(usex introspection)
536 + -DUSE_LIBNOTIFY=$(usex libnotify)
537 + -DUSE_LIBSECRET=$(usex gnome-keyring)
538 + -DUSE_OPENJPEG=$(usex jpeg2k)
539 + -DUSE_WOFF2=ON
540 + -DENABLE_SPELLCHECK=$(usex spell)
541 + -DENABLE_WAYLAND_TARGET=$(usex wayland)
542 + -DUSE_WPE_RENDERER=${use_wpe_renderer} # WPE renderer is used to implement accelerated compositing under wayland
543 + $(cmake-utils_use_find_package egl EGL)
544 + $(cmake-utils_use_find_package opengl OpenGL)
545 + -DENABLE_X11_TARGET=$(usex X)
546 + -DENABLE_OPENGL=${opengl_enabled}
547 + -DENABLE_WEBGL=${opengl_enabled}
548 + -DENABLE_BUBBLEWRAP_SANDBOX=$(usex seccomp)
549 + -DBWRAP_EXECUTABLE="${EPREFIX}"/usr/bin/bwrap # If bubblewrap[suid] then portage makes it go-r and cmake find_program fails with that
550 + -DCMAKE_BUILD_TYPE=Release
551 + -DPORT=GTK
552 + ${ruby_interpreter}
553 + )
554 +
555 + # Allow it to use GOLD when possible as it has all the magic to
556 + # detect when to use it and using gold for this concrete package has
557 + # multiple advantages and is also the upstream default, bug #585788
558 +# if tc-ld-is-gold ; then
559 +# mycmakeargs+=( -DUSE_LD_GOLD=ON )
560 +# else
561 +# mycmakeargs+=( -DUSE_LD_GOLD=OFF )
562 +# fi
563 +
564 + WK_USE_CCACHE=NO cmake-utils_src_configure
565 +}
566 +
567 +src_compile() {
568 + cmake-utils_src_compile
569 +}
570 +
571 +src_test() {
572 + # Prevents test failures on PaX systems
573 + pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test*
574 +
575 + cmake-utils_src_test
576 +}
577 +
578 +src_install() {
579 + cmake-utils_src_install
580 +
581 + # Prevents crashes on PaX systems, bug #522808
582 + pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/jsc" "${ED}usr/libexec/webkit2gtk-4.0/WebKitWebProcess"
583 + pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/WebKitPluginProcess"
584 +}