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/
Date: Thu, 24 Dec 2020 16:05:28
Message-Id: 1608825787.0f261968c53e914d3e339e57c7d157b72bf32f81.leio@gentoo
1 commit: 0f261968c53e914d3e339e57c7d157b72bf32f81
2 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 24 15:54:17 2020 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 24 16:03:07 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f261968
7
8 net-libs/webkit-gtk-2.30.4: workaround evolution bug, other improvements
9
10 * Porting from cmake-utils.eclass to cmake.eclass made -DNDEBUG not be passed
11 anymore, converting some mail-client/evolution issues into aborts. Keep
12 passing -DNDEBUG for the time being again.
13 * Improve cross-compilation by not requiring sys-apps/xdg-dbus-proxy on CBUILD
14 * Build the MiniBrowser with USE=examples
15
16 Bug: https://bugs.gentoo.org/761238
17 Closes: https://bugs.gentoo.org/760902
18 Closes: https://bugs.gentoo.org/758299
19 Package-Manager: Portage-3.0.12, Repoman-3.0.2
20 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
21
22 net-libs/webkit-gtk/metadata.xml | 1 +
23 net-libs/webkit-gtk/webkit-gtk-2.30.4-r1.ebuild | 300 ++++++++++++++++++++++++
24 2 files changed, 301 insertions(+)
25
26 diff --git a/net-libs/webkit-gtk/metadata.xml b/net-libs/webkit-gtk/metadata.xml
27 index 3e6a3fc0ecd..ab36b128219 100644
28 --- a/net-libs/webkit-gtk/metadata.xml
29 +++ b/net-libs/webkit-gtk/metadata.xml
30 @@ -7,6 +7,7 @@
31 </maintainer>
32 <use>
33 <flag name="egl">Enable EGL support</flag>
34 + <flag name="examples">Install the MiniBrowser example application</flag>
35 <flag name="gamepad">Enable gamepad input support via <pkg>dev-libs/libmanette</pkg></flag>
36 <flag name="geolocation">Enable geolocation support through <pkg>app-misc/geoclue</pkg></flag>
37 <flag name="jumbo-build">Combine source files to speed up build process</flag>
38
39 diff --git a/net-libs/webkit-gtk/webkit-gtk-2.30.4-r1.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.30.4-r1.ebuild
40 new file mode 100644
41 index 00000000000..b360de50319
42 --- /dev/null
43 +++ b/net-libs/webkit-gtk/webkit-gtk-2.30.4-r1.ebuild
44 @@ -0,0 +1,300 @@
45 +# Copyright 1999-2020 Gentoo Authors
46 +# Distributed under the terms of the GNU General Public License v2
47 +
48 +EAPI=7
49 +PYTHON_COMPAT=( python3_{6..8} )
50 +USE_RUBY="ruby24 ruby25 ruby26 ruby27"
51 +
52 +inherit check-reqs cmake flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs virtualx
53 +
54 +MY_P="webkitgtk-${PV}"
55 +DESCRIPTION="Open source web browser engine"
56 +HOMEPAGE="https://www.webkitgtk.org"
57 +SRC_URI="https://www.webkitgtk.org/releases/${MY_P}.tar.xz"
58 +
59 +LICENSE="LGPL-2+ BSD"
60 +SLOT="4/37" # soname version of libwebkit2gtk-4.0
61 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sparc ~x86"
62 +
63 +IUSE="aqua +egl examples gamepad +geolocation gles2-only gnome-keyring +gstreamer gtk-doc +introspection +jpeg2k +jumbo-build libnotify +opengl seccomp spell systemd wayland +X"
64 +
65 +# gstreamer with opengl/gles2 needs egl
66 +REQUIRED_USE="
67 + gles2-only? ( egl !opengl )
68 + gstreamer? ( opengl? ( egl ) )
69 + wayland? ( egl )
70 + || ( aqua wayland X )
71 +"
72 +
73 +# Tests fail to link for inexplicable reasons
74 +# https://bugs.webkit.org/show_bug.cgi?id=148210
75 +RESTRICT="test"
76 +
77 +# Aqua support in gtk3 is untested
78 +# Dependencies found at Source/cmake/OptionsGTK.cmake
79 +# Various compile-time optionals for gtk+-3.22.0 - ensure it
80 +# Missing WebRTC support, but ENABLE_MEDIA_STREAM/ENABLE_WEB_RTC is experimental upstream (PRIVATE OFF) and shouldn't be used yet in 2.30
81 +# >=gst-plugins-opus-1.14.4-r1 for opusparse (required by MSE)
82 +wpe_depend="
83 + >=gui-libs/libwpe-1.5.0:1.0
84 + >=gui-libs/wpebackend-fdo-1.7.0:1.0
85 +"
86 +# TODO: gst-plugins-base[X] is only needed when build configuration ends up with GLX set, but that's a bit automagic too to fix
87 +RDEPEND="
88 + >=x11-libs/cairo-1.16.0:=[X?]
89 + >=media-libs/fontconfig-2.13.0:1.0
90 + >=media-libs/freetype-2.9.0:2
91 + >=dev-libs/libgcrypt-1.7.0:0=
92 + >=x11-libs/gtk+-3.22.0:3[aqua?,introspection?,wayland?,X?]
93 + >=media-libs/harfbuzz-1.4.2:=[icu(+)]
94 + >=dev-libs/icu-60.2:=
95 + virtual/jpeg:0=
96 + >=net-libs/libsoup-2.54:2.4[introspection?]
97 + >=dev-libs/libxml2-2.8.0:2
98 + >=media-libs/libpng-1.4:0=
99 + dev-db/sqlite:3=
100 + sys-libs/zlib:0
101 + >=dev-libs/atk-2.16.0
102 + media-libs/libwebp:=
103 +
104 + >=dev-libs/glib-2.44.0:2
105 + >=dev-libs/libxslt-1.1.7
106 + media-libs/woff2
107 + gnome-keyring? ( app-crypt/libsecret )
108 + introspection? ( >=dev-libs/gobject-introspection-1.32.0:= )
109 + dev-libs/libtasn1:=
110 + spell? ( >=app-text/enchant-0.22:2 )
111 + gstreamer? (
112 + >=media-libs/gstreamer-1.14:1.0
113 + >=media-libs/gst-plugins-base-1.14:1.0[egl?,opengl?,X?]
114 + gles2-only? ( media-libs/gst-plugins-base:1.0[gles2] )
115 + >=media-plugins/gst-plugins-opus-1.14.4-r1:1.0
116 + >=media-libs/gst-plugins-bad-1.14:1.0 )
117 +
118 + X? (
119 + x11-libs/libX11
120 + x11-libs/libXcomposite
121 + x11-libs/libXdamage
122 + x11-libs/libXrender
123 + x11-libs/libXt )
124 +
125 + libnotify? ( x11-libs/libnotify )
126 + dev-libs/hyphen
127 + jpeg2k? ( >=media-libs/openjpeg-2.2.0:2= )
128 +
129 + egl? ( media-libs/mesa[egl] )
130 + gles2-only? ( media-libs/mesa[gles2] )
131 + opengl? ( virtual/opengl )
132 + wayland? (
133 + dev-libs/wayland
134 + >=dev-libs/wayland-protocols-1.12
135 + opengl? ( ${wpe_depend} )
136 + gles2-only? ( ${wpe_depend} )
137 + )
138 +
139 + seccomp? (
140 + >=sys-apps/bubblewrap-0.3.1
141 + sys-libs/libseccomp
142 + sys-apps/xdg-dbus-proxy
143 + )
144 +
145 + systemd? ( sys-apps/systemd:= )
146 + gamepad? ( >=dev-libs/libmanette-0.2.4 )
147 +"
148 +unset wpe_depend
149 +DEPEND="${RDEPEND}"
150 +# paxctl needed for bug #407085
151 +# Need real bison, not yacc
152 +BDEPEND="
153 + ${PYTHON_DEPS}
154 + ${RUBY_DEPS}
155 + >=app-accessibility/at-spi2-core-2.5.3
156 + dev-util/glib-utils
157 + >=dev-util/gperf-3.0.1
158 + >=sys-devel/bison-2.4.3
159 + || ( >=sys-devel/gcc-7.3 >=sys-devel/clang-5 )
160 + sys-devel/gettext
161 + virtual/pkgconfig
162 +
163 + >=dev-lang/perl-5.10
164 + virtual/perl-Data-Dumper
165 + virtual/perl-Carp
166 + virtual/perl-JSON-PP
167 +
168 + gtk-doc? ( >=dev-util/gtk-doc-1.32 )
169 + geolocation? ( dev-util/gdbus-codegen )
170 + >=dev-util/cmake-3.10
171 +"
172 +# test? (
173 +# dev-python/pygobject:3[python_targets_python2_7]
174 +# x11-themes/hicolor-icon-theme
175 +# jit? ( sys-apps/paxctl ) )
176 +RDEPEND="${RDEPEND}
177 + geolocation? ( >=app-misc/geoclue-2.1.5:2.0 )
178 +"
179 +
180 +S="${WORKDIR}/${MY_P}"
181 +
182 +CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307
183 +
184 +pkg_pretend() {
185 + if [[ ${MERGE_TYPE} != "binary" ]] ; then
186 + if is-flagq "-g*" && ! is-flagq "-g*0" ; then
187 + einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS"
188 + check-reqs_pkg_pretend
189 + fi
190 +
191 + if ! test-flag-CXX -std=c++17 ; then
192 + die "You need at least GCC 7.3.x or Clang >= 5 for C++17-specific compiler flags"
193 + fi
194 + fi
195 +
196 + if ! use opengl && ! use gles2-only; then
197 + ewarn
198 + ewarn "You are disabling OpenGL usage (USE=opengl or USE=gles2-only) completely."
199 + ewarn "This is an unsupported configuration meant for very specific embedded"
200 + ewarn "use cases, where there truly is no GL possible (and even that use case"
201 + ewarn "is very unlikely to come by). If you have GL (even software-only), you"
202 + ewarn "really really should be enabling OpenGL!"
203 + ewarn
204 + fi
205 +}
206 +
207 +pkg_setup() {
208 + if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
209 + check-reqs_pkg_setup
210 + fi
211 +
212 + python-any-r1_pkg_setup
213 +}
214 +
215 +src_prepare() {
216 + eapply "${FILESDIR}"/${PN}-2.24.4-eglmesaext-include.patch # bug 699054 # https://bugs.webkit.org/show_bug.cgi?id=204108
217 + eapply "${FILESDIR}"/2.28.2-opengl-without-X-fixes.patch
218 + eapply "${FILESDIR}"/2.28.2-non-jumbo-fix.patch
219 + eapply "${FILESDIR}"/2.28.4-non-jumbo-fix2.patch
220 + eapply "${FILESDIR}"/2.30.3-fix-noGL-build.patch
221 + cmake_src_prepare
222 + gnome2_src_prepare
223 +}
224 +
225 +src_configure() {
226 + # Respect CC, otherwise fails on prefix #395875
227 + tc-export CC
228 +
229 + # It does not compile on alpha without this in LDFLAGS
230 + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648761
231 + use alpha && append-ldflags "-Wl,--no-relax"
232 +
233 + # ld segfaults on ia64 with LDFLAGS --as-needed, bug #555504
234 + use ia64 && append-ldflags "-Wl,--no-as-needed"
235 +
236 + # Sigbuses on SPARC with mcpu and co., bug #???
237 + use sparc && filter-flags "-mvis"
238 +
239 + # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634
240 + use ppc64 && append-flags "-mminimal-toc"
241 +
242 + # Try to use less memory, bug #469942 (see Fedora .spec for reference)
243 + # --no-keep-memory doesn't work on ia64, bug #502492
244 + if ! use ia64; then
245 + append-ldflags "-Wl,--no-keep-memory"
246 + fi
247 +
248 + # We try to use gold when possible for this package
249 +# if ! tc-ld-is-gold ; then
250 +# append-ldflags "-Wl,--reduce-memory-overheads"
251 +# fi
252 +
253 + # Ruby situation is a bit complicated. See bug 513888
254 + local rubyimpl
255 + local ruby_interpreter=""
256 + for rubyimpl in ${USE_RUBY}; do
257 + if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; then
258 + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ${rubyimpl})"
259 + fi
260 + done
261 + # This will rarely occur. Only a couple of corner cases could lead us to
262 + # that failure. See bug 513888
263 + [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
264 +
265 + # TODO: Check Web Audio support
266 + # should somehow let user select between them?
267 + #
268 + # opengl needs to be explicetly handled, bug #576634
269 +
270 + local use_wpe_renderer=OFF
271 + local opengl_enabled
272 + if use opengl || use gles2-only; then
273 + opengl_enabled=ON
274 + use wayland && use_wpe_renderer=ON
275 + else
276 + opengl_enabled=OFF
277 + fi
278 +
279 + local mycmakeargs=(
280 + -DENABLE_UNIFIED_BUILDS=$(usex jumbo-build)
281 + -DENABLE_QUARTZ_TARGET=$(usex aqua)
282 + -DENABLE_API_TESTS=$(usex test)
283 + -DENABLE_GTKDOC=$(usex gtk-doc)
284 + -DENABLE_GEOLOCATION=$(usex geolocation) # Runtime optional (talks over dbus service)
285 + $(cmake_use_find_package gles2-only OpenGLES2)
286 + -DENABLE_GLES2=$(usex gles2-only)
287 + -DENABLE_MINIBROWSER=$(usex examples)
288 + -DENABLE_VIDEO=$(usex gstreamer)
289 + -DENABLE_WEB_AUDIO=$(usex gstreamer)
290 + -DENABLE_INTROSPECTION=$(usex introspection)
291 + -DUSE_LIBNOTIFY=$(usex libnotify)
292 + -DUSE_LIBSECRET=$(usex gnome-keyring)
293 + -DUSE_OPENJPEG=$(usex jpeg2k)
294 + -DUSE_WOFF2=ON
295 + -DENABLE_SPELLCHECK=$(usex spell)
296 + -DUSE_SYSTEMD=$(usex systemd) # Whether to enable journald logging
297 + -DENABLE_GAMEPAD=$(usex gamepad)
298 + -DENABLE_WAYLAND_TARGET=$(usex wayland)
299 + -DUSE_WPE_RENDERER=${use_wpe_renderer} # WPE renderer is used to implement accelerated compositing under wayland
300 + $(cmake_use_find_package egl EGL)
301 + $(cmake_use_find_package opengl OpenGL)
302 + -DENABLE_X11_TARGET=$(usex X)
303 + -DENABLE_GRAPHICS_CONTEXT_GL=${opengl_enabled}
304 + -DENABLE_WEBGL=${opengl_enabled}
305 + -DENABLE_BUBBLEWRAP_SANDBOX=$(usex seccomp)
306 + -DBWRAP_EXECUTABLE:FILEPATH="${EPREFIX}"/usr/bin/bwrap # If bubblewrap[suid] then portage makes it go-r and cmake find_program fails with that
307 + -DDBUS_PROXY_EXECUTABLE:FILEPATH="${EPREFIX}"/usr/bin/xdg-dbus-proxy
308 + -DPORT=GTK
309 + ${ruby_interpreter}
310 + )
311 +
312 + # Allow it to use GOLD when possible as it has all the magic to
313 + # detect when to use it and using gold for this concrete package has
314 + # multiple advantages and is also the upstream default, bug #585788
315 +# if tc-ld-is-gold ; then
316 +# mycmakeargs+=( -DUSE_LD_GOLD=ON )
317 +# else
318 +# mycmakeargs+=( -DUSE_LD_GOLD=OFF )
319 +# fi
320 +
321 + # https://bugs.gentoo.org/761238
322 + append-cppflags -DNDEBUG
323 +
324 + WK_USE_CCACHE=NO cmake_src_configure
325 +}
326 +
327 +src_compile() {
328 + cmake_src_compile
329 +}
330 +
331 +src_test() {
332 + # Prevents test failures on PaX systems
333 + pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test*
334 +
335 + cmake_src_test
336 +}
337 +
338 +src_install() {
339 + cmake_src_install
340 +
341 + # Prevents crashes on PaX systems, bug #522808
342 + pax-mark m "${ED}/usr/libexec/webkit2gtk-4.0/jsc" "${ED}/usr/libexec/webkit2gtk-4.0/WebKitWebProcess"
343 + pax-mark m "${ED}/usr/libexec/webkit2gtk-4.0/WebKitPluginProcess"
344 +}