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.36.5-r200.ebuild (7849B)


  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. KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
  16. IUSE="aqua +avif debug +egl examples gamepad +geolocation gles2-only gnome-keyring +gstreamer gtk-doc +introspection +jpeg2k +jumbo-build lcms libnotify +seccomp spell systemd test wayland +X"
  17. # gstreamer with opengl/gles2 needs egl
  18. REQUIRED_USE="
  19. gles2-only? ( egl )
  20. gstreamer? ( egl )
  21. wayland? ( egl )
  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/gtk-doc-am-1.10
  97. >=dev-util/gperf-3.0.1
  98. >=sys-devel/bison-2.4.3
  99. || ( >=sys-devel/gcc-7.3 >=sys-devel/clang-5 )
  100. sys-devel/gettext
  101. virtual/pkgconfig
  102. >=dev-lang/perl-5.10
  103. virtual/perl-Data-Dumper
  104. virtual/perl-Carp
  105. virtual/perl-JSON-PP
  106. gtk-doc? ( >=dev-util/gtk-doc-1.32 )
  107. geolocation? ( dev-util/gdbus-codegen )
  108. >=dev-util/cmake-3.10
  109. "
  110. RDEPEND="${RDEPEND}
  111. geolocation? ( >=app-misc/geoclue-2.1.5:2.0 )
  112. "
  113. S="${WORKDIR}/${MY_P}"
  114. CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307
  115. pkg_pretend() {
  116. if [[ ${MERGE_TYPE} != "binary" ]] ; then
  117. if is-flagq "-g*" && ! is-flagq "-g*0" ; then
  118. einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS"
  119. check-reqs_pkg_pretend
  120. fi
  121. if ! test-flag-CXX -std=c++17 ; then
  122. die "You need at least GCC 7.3.x or Clang >= 5 for C++17-specific compiler flags"
  123. fi
  124. fi
  125. }
  126. pkg_setup() {
  127. if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
  128. check-reqs_pkg_setup
  129. fi
  130. python-any-r1_pkg_setup
  131. }
  132. src_prepare() {
  133. cmake_src_prepare
  134. gnome2_src_prepare
  135. }
  136. src_configure() {
  137. if use debug; then
  138. CMAKE_BUILD_TYPE="Debug"
  139. fi
  140. # gtk-doc fails to generate docs when ld.lld is used, force binutils
  141. if use gtk-doc; then
  142. export CC_LD="ld"
  143. export LD="ld"
  144. fi
  145. # Respect CC, otherwise fails on prefix #395875
  146. tc-export CC
  147. # WebkitGTK doesn't likes -D_FORTIFY_SOURCE=2
  148. strip-flags
  149. filter-flags "-D_FORTIFY_SOURCE=*"
  150. # It does not compile on alpha without this in LDFLAGS
  151. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648761
  152. use alpha && append-ldflags "-Wl,--no-relax"
  153. # ld segfaults on ia64 with LDFLAGS --as-needed, bug #555504
  154. use ia64 && append-ldflags "-Wl,--no-as-needed"
  155. # Sigbuses on SPARC with mcpu and co., bug #???
  156. use sparc && filter-flags "-mvis"
  157. # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634
  158. use ppc64 && append-flags "-mminimal-toc"
  159. # Try to use less memory, bug #469942 (see Fedora .spec for reference)
  160. # --no-keep-memory doesn't work on ia64, bug #502492
  161. if ! use ia64; then
  162. append-ldflags $(test-flags-CCLD "-Wl,--no-keep-memory")
  163. fi
  164. # Ruby situation is a bit complicated. See bug 513888
  165. local rubyimpl
  166. local ruby_interpreter=""
  167. for rubyimpl in ${USE_RUBY}; do
  168. if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; then
  169. ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ${rubyimpl})"
  170. fi
  171. done
  172. # This will rarely occur. Only a couple of corner cases could lead us to
  173. # that failure. See bug 513888
  174. [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
  175. # TODO: Check Web Audio support
  176. # should somehow let user select between them?
  177. local mycmakeargs=(
  178. ${ruby_interpreter}
  179. $(cmake_use_find_package gles2-only OpenGLES2)
  180. $(cmake_use_find_package egl EGL)
  181. $(cmake_use_find_package !gles2-only OpenGL)
  182. -DBWRAP_EXECUTABLE:FILEPATH="${EPREFIX}"/usr/bin/bwrap # If bubblewrap[suid] then portage makes it go-r and cmake find_program fails with that
  183. -DDBUS_PROXY_EXECUTABLE:FILEPATH="${EPREFIX}"/usr/bin/xdg-dbus-proxy
  184. -DPORT=GTK
  185. # Source/cmake/WebKitFeatures.cmake
  186. -DENABLE_API_TESTS=$(usex test)
  187. -DENABLE_BUBBLEWRAP_SANDBOX=$(usex seccomp)
  188. -DENABLE_GAMEPAD=$(usex gamepad)
  189. -DENABLE_GEOLOCATION=$(usex geolocation) # Runtime optional (talks over dbus service)
  190. -DENABLE_MINIBROWSER=$(usex examples)
  191. -DSHOULD_INSTALL_JS_SHELL=$(usex examples)
  192. -DENABLE_SPELLCHECK=$(usex spell)
  193. -DENABLE_UNIFIED_BUILDS=$(usex jumbo-build)
  194. -DENABLE_VIDEO=$(usex gstreamer)
  195. -DENABLE_WEBGL=ON
  196. # Supported only under ANGLE, see
  197. # https://bugs.webkit.org/show_bug.cgi?id=225563
  198. # https://bugs.webkit.org/show_bug.cgi?id=224888
  199. -DENABLE_WEBGL2=OFF
  200. -DENABLE_WEB_AUDIO=$(usex gstreamer)
  201. -DENABLE_WEBDRIVER=OFF
  202. -DENABLE_WEB_CRYPTO=OFF
  203. # -DENABLE_TOUCH_EVENTS=OFF
  204. # -DENABLE_DRAG_SUPPORT=OFF
  205. # Source/cmake/OptionsGTK.cmake
  206. -DENABLE_GLES2=$(usex gles2-only)
  207. -DENABLE_GTKDOC=$(usex gtk-doc)
  208. -DENABLE_INTROSPECTION=$(usex introspection)
  209. -DENABLE_JOURNALD_LOG=$(usex systemd)
  210. -DENABLE_QUARTZ_TARGET=$(usex aqua)
  211. -DENABLE_WAYLAND_TARGET=$(usex wayland)
  212. -DENABLE_X11_TARGET=$(usex X)
  213. -DUSE_ANGLE_WEBGL=OFF
  214. -DUSE_AVIF=$(usex avif)
  215. -DUSE_GTK4=ON
  216. -DUSE_JPEGXL=OFF
  217. -DUSE_LCMS=$(usex lcms)
  218. -DUSE_LIBHYPHEN=ON
  219. -DUSE_LIBNOTIFY=$(usex libnotify)
  220. -DUSE_LIBSECRET=$(usex gnome-keyring)
  221. -DUSE_OPENGL_OR_ES=ON
  222. -DUSE_OPENJPEG=$(usex jpeg2k)
  223. -DUSE_SOUP2=OFF
  224. -DUSE_WOFF2=ON
  225. -DUSE_WPE_RENDERER=$(usex wayland) # WPE renderer is used to implement accelerated compositing under wayland
  226. )
  227. # https://bugs.gentoo.org/761238
  228. append-cppflags -DNDEBUG
  229. cmake_src_configure
  230. }