|
Line 0
Link Here
|
| 0 |
- |
1 |
# Copyright 1999-2022 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
|
| 4 |
EAPI=7 |
| 5 |
PYTHON_COMPAT=( python3_{8..10} ) |
| 6 |
USE_RUBY="ruby26 ruby27 ruby30" |
| 7 |
|
| 8 |
inherit check-reqs cmake flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs virtualx |
| 9 |
|
| 10 |
MY_P="webkitgtk-${PV}" |
| 11 |
DESCRIPTION="Open source web browser engine" |
| 12 |
HOMEPAGE="https://www.webkitgtk.org" |
| 13 |
SRC_URI="https://www.webkitgtk.org/releases/${MY_P}.tar.xz" |
| 14 |
|
| 15 |
LICENSE="LGPL-2+ BSD" |
| 16 |
SLOT="4/37" # soname version of libwebkit2gtk-4.0 |
| 17 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86" |
| 18 |
|
| 19 |
IUSE="aqua avif +egl examples gamepad +geolocation gles2-only gnome-keyring +gstreamer gtk-doc +introspection +jpeg2k +jumbo-build lcms libnotify seccomp spell systemd wayland +X" |
| 20 |
|
| 21 |
# gstreamer with opengl/gles2 needs egl |
| 22 |
REQUIRED_USE=" |
| 23 |
gles2-only? ( egl ) |
| 24 |
gstreamer? ( egl ) |
| 25 |
wayland? ( egl ) |
| 26 |
|| ( aqua wayland X ) |
| 27 |
" |
| 28 |
|
| 29 |
# Tests fail to link for inexplicable reasons |
| 30 |
# https://bugs.webkit.org/show_bug.cgi?id=148210 |
| 31 |
RESTRICT="test" |
| 32 |
|
| 33 |
# Aqua support in gtk3 is untested |
| 34 |
# Dependencies found at Source/cmake/OptionsGTK.cmake |
| 35 |
# Various compile-time optionals for gtk+-3.22.0 - ensure it |
| 36 |
# Missing WebRTC support, but ENABLE_MEDIA_STREAM/ENABLE_WEB_RTC is experimental upstream (PRIVATE OFF) and shouldn't be used yet in 2.30 |
| 37 |
# >=gst-plugins-opus-1.14.4-r1 for opusparse (required by MSE) |
| 38 |
# 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 |
| 39 |
RDEPEND=" |
| 40 |
>=x11-libs/cairo-1.16.0:=[X?] |
| 41 |
>=media-libs/fontconfig-2.13.0:1.0 |
| 42 |
>=media-libs/freetype-2.9.0:2 |
| 43 |
>=dev-libs/libgcrypt-1.7.0:0= |
| 44 |
>=x11-libs/gtk+-3.22.0:3[aqua?,introspection?,wayland?,X?] |
| 45 |
>=media-libs/harfbuzz-1.4.2:=[icu(+)] |
| 46 |
>=dev-libs/icu-61.2:= |
| 47 |
virtual/jpeg:0= |
| 48 |
>=net-libs/libsoup-2.54:2.4[introspection?] |
| 49 |
>=dev-libs/libxml2-2.8.0:2 |
| 50 |
>=media-libs/libpng-1.4:0= |
| 51 |
dev-db/sqlite:3= |
| 52 |
sys-libs/zlib:0 |
| 53 |
>=dev-libs/atk-2.16.0 |
| 54 |
media-libs/libwebp:= |
| 55 |
|
| 56 |
>=dev-libs/glib-2.67.1:2 |
| 57 |
>=dev-libs/libxslt-1.1.7 |
| 58 |
media-libs/woff2 |
| 59 |
gnome-keyring? ( app-crypt/libsecret ) |
| 60 |
introspection? ( >=dev-libs/gobject-introspection-1.59.1:= ) |
| 61 |
dev-libs/libtasn1:= |
| 62 |
spell? ( >=app-text/enchant-0.22:2 ) |
| 63 |
gstreamer? ( |
| 64 |
>=media-libs/gstreamer-1.14:1.0 |
| 65 |
>=media-libs/gst-plugins-base-1.14:1.0[egl?,X?] |
| 66 |
gles2-only? ( media-libs/gst-plugins-base:1.0[gles2] ) |
| 67 |
!gles2-only? ( media-libs/gst-plugins-base:1.0[opengl] ) |
| 68 |
>=media-plugins/gst-plugins-opus-1.14.4-r1:1.0 |
| 69 |
>=media-libs/gst-plugins-bad-1.14:1.0 ) |
| 70 |
|
| 71 |
X? ( |
| 72 |
x11-libs/libX11 |
| 73 |
x11-libs/libXcomposite |
| 74 |
x11-libs/libXdamage |
| 75 |
x11-libs/libXrender |
| 76 |
x11-libs/libXt ) |
| 77 |
|
| 78 |
libnotify? ( x11-libs/libnotify ) |
| 79 |
dev-libs/hyphen |
| 80 |
jpeg2k? ( >=media-libs/openjpeg-2.2.0:2= ) |
| 81 |
avif? ( >=media-libs/libavif-0.9.0:= ) |
| 82 |
lcms? ( media-libs/lcms:2 ) |
| 83 |
|
| 84 |
egl? ( media-libs/mesa[egl(+)] ) |
| 85 |
gles2-only? ( media-libs/mesa[gles2] ) |
| 86 |
!gles2-only? ( virtual/opengl ) |
| 87 |
wayland? ( |
| 88 |
dev-libs/wayland |
| 89 |
>=dev-libs/wayland-protocols-1.12 |
| 90 |
>=gui-libs/libwpe-1.5.0:1.0 |
| 91 |
>=gui-libs/wpebackend-fdo-1.7.0:1.0 |
| 92 |
) |
| 93 |
|
| 94 |
seccomp? ( |
| 95 |
>=sys-apps/bubblewrap-0.3.1 |
| 96 |
sys-libs/libseccomp |
| 97 |
sys-apps/xdg-dbus-proxy |
| 98 |
) |
| 99 |
|
| 100 |
systemd? ( sys-apps/systemd:= ) |
| 101 |
gamepad? ( >=dev-libs/libmanette-0.2.4 ) |
| 102 |
" |
| 103 |
DEPEND="${RDEPEND}" |
| 104 |
# paxctl needed for bug #407085 |
| 105 |
# Need real bison, not yacc |
| 106 |
BDEPEND=" |
| 107 |
${PYTHON_DEPS} |
| 108 |
${RUBY_DEPS} |
| 109 |
>=app-accessibility/at-spi2-core-2.5.3 |
| 110 |
dev-util/glib-utils |
| 111 |
>=dev-util/gperf-3.0.1 |
| 112 |
>=sys-devel/bison-2.4.3 |
| 113 |
|| ( >=sys-devel/gcc-7.3 >=sys-devel/clang-5 ) |
| 114 |
sys-devel/gettext |
| 115 |
virtual/pkgconfig |
| 116 |
|
| 117 |
>=dev-lang/perl-5.10 |
| 118 |
virtual/perl-Data-Dumper |
| 119 |
virtual/perl-Carp |
| 120 |
virtual/perl-JSON-PP |
| 121 |
|
| 122 |
gtk-doc? ( >=dev-util/gtk-doc-1.32 ) |
| 123 |
geolocation? ( dev-util/gdbus-codegen ) |
| 124 |
>=dev-util/cmake-3.10 |
| 125 |
" |
| 126 |
# test? ( |
| 127 |
# dev-python/pygobject:3[python_targets_python2_7] |
| 128 |
# x11-themes/hicolor-icon-theme |
| 129 |
# jit? ( sys-apps/paxctl ) ) |
| 130 |
RDEPEND="${RDEPEND} |
| 131 |
geolocation? ( >=app-misc/geoclue-2.1.5:2.0 ) |
| 132 |
" |
| 133 |
|
| 134 |
S="${WORKDIR}/${MY_P}" |
| 135 |
|
| 136 |
CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307 |
| 137 |
|
| 138 |
pkg_pretend() { |
| 139 |
if [[ ${MERGE_TYPE} != "binary" ]] ; then |
| 140 |
if is-flagq "-g*" && ! is-flagq "-g*0" ; then |
| 141 |
einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS" |
| 142 |
check-reqs_pkg_pretend |
| 143 |
fi |
| 144 |
|
| 145 |
if ! test-flag-CXX -std=c++17 ; then |
| 146 |
die "You need at least GCC 7.3.x or Clang >= 5 for C++17-specific compiler flags" |
| 147 |
fi |
| 148 |
fi |
| 149 |
} |
| 150 |
|
| 151 |
pkg_setup() { |
| 152 |
if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then |
| 153 |
check-reqs_pkg_setup |
| 154 |
fi |
| 155 |
|
| 156 |
python-any-r1_pkg_setup |
| 157 |
} |
| 158 |
|
| 159 |
src_prepare() { |
| 160 |
eapply "${FILESDIR}"/2.34.3-opengl-without-X-fixes.patch |
| 161 |
eapply "${FILESDIR}"/2.34.3-non-jumbo-fix.patch |
| 162 |
eapply "${FILESDIR}"/2.34.3-jumbo-fix.patch # bug 830638 |
| 163 |
cmake_src_prepare |
| 164 |
gnome2_src_prepare |
| 165 |
} |
| 166 |
|
| 167 |
src_configure() { |
| 168 |
# Respect CC, otherwise fails on prefix #395875 |
| 169 |
tc-export CC |
| 170 |
|
| 171 |
# It does not compile on alpha without this in LDFLAGS |
| 172 |
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648761 |
| 173 |
use alpha && append-ldflags "-Wl,--no-relax" |
| 174 |
|
| 175 |
# ld segfaults on ia64 with LDFLAGS --as-needed, bug #555504 |
| 176 |
use ia64 && append-ldflags "-Wl,--no-as-needed" |
| 177 |
|
| 178 |
# Sigbuses on SPARC with mcpu and co., bug #??? |
| 179 |
use sparc && filter-flags "-mvis" |
| 180 |
|
| 181 |
# https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634 |
| 182 |
use ppc64 && append-flags "-mminimal-toc" |
| 183 |
|
| 184 |
# Try to use less memory, bug #469942 (see Fedora .spec for reference) |
| 185 |
# --no-keep-memory doesn't work on ia64, bug #502492 |
| 186 |
if ! use ia64; then |
| 187 |
append-ldflags $(test-flags-CCLD "-Wl,--no-keep-memory") |
| 188 |
fi |
| 189 |
|
| 190 |
# Ruby situation is a bit complicated. See bug 513888 |
| 191 |
local rubyimpl |
| 192 |
local ruby_interpreter="" |
| 193 |
for rubyimpl in ${USE_RUBY}; do |
| 194 |
if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; then |
| 195 |
ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ${rubyimpl})" |
| 196 |
fi |
| 197 |
done |
| 198 |
# This will rarely occur. Only a couple of corner cases could lead us to |
| 199 |
# that failure. See bug 513888 |
| 200 |
[[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found" |
| 201 |
|
| 202 |
# TODO: Check Web Audio support |
| 203 |
# should somehow let user select between them? |
| 204 |
|
| 205 |
local mycmakeargs=( |
| 206 |
${ruby_interpreter} |
| 207 |
$(cmake_use_find_package gles2-only OpenGLES2) |
| 208 |
$(cmake_use_find_package egl EGL) |
| 209 |
$(cmake_use_find_package !gles2-only OpenGL) |
| 210 |
-DBWRAP_EXECUTABLE:FILEPATH="${EPREFIX}"/usr/bin/bwrap # If bubblewrap[suid] then portage makes it go-r and cmake find_program fails with that |
| 211 |
-DDBUS_PROXY_EXECUTABLE:FILEPATH="${EPREFIX}"/usr/bin/xdg-dbus-proxy |
| 212 |
-DPORT=GTK |
| 213 |
# Source/cmake/WebKitFeatures.cmake |
| 214 |
-DENABLE_API_TESTS=$(usex test) |
| 215 |
-DENABLE_BUBBLEWRAP_SANDBOX=$(usex seccomp) |
| 216 |
-DENABLE_GAMEPAD=$(usex gamepad) |
| 217 |
-DENABLE_GEOLOCATION=$(usex geolocation) # Runtime optional (talks over dbus service) |
| 218 |
-DENABLE_MINIBROWSER=$(usex examples) |
| 219 |
-DENABLE_SPELLCHECK=$(usex spell) |
| 220 |
-DENABLE_UNIFIED_BUILDS=$(usex jumbo-build) |
| 221 |
-DENABLE_VIDEO=$(usex gstreamer) |
| 222 |
-DENABLE_WEBGL=ON |
| 223 |
# Supported only under ANGLE and default off PRIVATE option still@2.34.1, see |
| 224 |
# https://bugs.webkit.org/show_bug.cgi?id=225563 |
| 225 |
# https://bugs.webkit.org/show_bug.cgi?id=224888 |
| 226 |
-DENABLE_WEBGL2=OFF |
| 227 |
-DENABLE_WEB_AUDIO=$(usex gstreamer) |
| 228 |
# Source/cmake/OptionsGTK.cmake |
| 229 |
-DENABLE_GLES2=$(usex gles2-only) |
| 230 |
-DENABLE_GTKDOC=$(usex gtk-doc) |
| 231 |
-DENABLE_INTROSPECTION=$(usex introspection) |
| 232 |
-DENABLE_QUARTZ_TARGET=$(usex aqua) |
| 233 |
-DENABLE_WAYLAND_TARGET=$(usex wayland) |
| 234 |
-DENABLE_X11_TARGET=$(usex X) |
| 235 |
-DUSE_AVIF=$(usex avif) |
| 236 |
-DUSE_GTK4=OFF |
| 237 |
-DUSE_LCMS=$(usex lcms) |
| 238 |
-DUSE_LIBHYPHEN=ON |
| 239 |
-DUSE_LIBNOTIFY=$(usex libnotify) |
| 240 |
-DUSE_LIBSECRET=$(usex gnome-keyring) |
| 241 |
-DUSE_OPENGL_OR_ES=ON |
| 242 |
-DUSE_OPENJPEG=$(usex jpeg2k) |
| 243 |
-DUSE_SOUP2=ON |
| 244 |
-DUSE_SYSTEMD=$(usex systemd) # Whether to enable journald logging |
| 245 |
-DUSE_WOFF2=ON |
| 246 |
-DUSE_WPE_RENDERER=$(usex wayland) # WPE renderer is used to implement accelerated compositing under wayland |
| 247 |
) |
| 248 |
|
| 249 |
# https://bugs.gentoo.org/761238 |
| 250 |
append-cppflags -DNDEBUG |
| 251 |
|
| 252 |
WK_USE_CCACHE=NO cmake_src_configure |
| 253 |
} |
| 254 |
|
| 255 |
src_compile() { |
| 256 |
cmake_src_compile |
| 257 |
} |
| 258 |
|
| 259 |
src_test() { |
| 260 |
# Prevents test failures on PaX systems |
| 261 |
pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test* |
| 262 |
|
| 263 |
cmake_src_test |
| 264 |
} |
| 265 |
|
| 266 |
src_install() { |
| 267 |
cmake_src_install |
| 268 |
|
| 269 |
# Prevents crashes on PaX systems, bug #522808 |
| 270 |
pax-mark m "${ED}/usr/libexec/webkit2gtk-4.0/jsc" "${ED}/usr/libexec/webkit2gtk-4.0/WebKitWebProcess" |
| 271 |
pax-mark m "${ED}/usr/libexec/webkit2gtk-4.0/WebKitPluginProcess" |
| 272 |
} |