logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

webkit-gtk-2.37.1-r200.ebuild (7719B)


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