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.42.4.ebuild (7570B)


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