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.40.1-r200.ebuild (7547B)


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