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.41.92-r410.ebuild (7519B)


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