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.91.ebuild (7543B)


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