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.46.3-r600.ebuild (7298B)


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