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.30.6.ebuild (8874B)


  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. CMAKE_MAKEFILE_GENERATOR="ninja"
  5. PYTHON_COMPAT=( python3_{7..8} )
  6. USE_RUBY="ruby24 ruby25 ruby26 ruby27 ruby30"
  7. inherit check-reqs cmake flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs virtualx
  8. MY_P="webkitgtk-${PV}"
  9. DESCRIPTION="Open source web browser engine"
  10. HOMEPAGE="https://www.webkitgtk.org"
  11. SRC_URI="https://www.webkitgtk.org/releases/${MY_P}.tar.xz"
  12. LICENSE="LGPL-2+ BSD"
  13. SLOT="4/37" # soname version of libwebkit2gtk-4.0
  14. KEYWORDS="~amd64 ~arm ~arm64 ~x86"
  15. IUSE="aqua debug +egl examples gamepad +geolocation gles2-only gnome-keyring +gstreamer gtk-doc +introspection +jpeg2k +jumbo-build libnotify media-source +opengl seccomp spell systemd wayland +X"
  16. # gstreamer with opengl/gles2 needs egl
  17. REQUIRED_USE="
  18. geolocation? ( introspection )
  19. gles2-only? ( egl !opengl )
  20. gstreamer? ( opengl? ( egl ) )
  21. wayland? ( egl )
  22. media-source? ( gstreamer )
  23. || ( aqua wayland X )
  24. "
  25. # Aqua support in gtk3 is untested
  26. # Dependencies found at Source/cmake/OptionsGTK.cmake
  27. # Various compile-time optionals for gtk+-3.22.0 - ensure it
  28. # Missing WebRTC support, but ENABLE_MEDIA_STREAM/ENABLE_WEB_RTC is experimental upstream (PRIVATE OFF) and shouldn't be used yet in 2.30
  29. # >=gst-plugins-opus-1.14.4-r1 for opusparse (required by MSE)
  30. wpe_depend="
  31. >=gui-libs/libwpe-1.5.0:1.0
  32. >=gui-libs/wpebackend-fdo-1.7.0:1.0
  33. "
  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-60.2:=
  42. virtual/jpeg:0=
  43. >=net-libs/libsoup-2.54:2.4[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
  49. media-libs/libwebp:=
  50. >=dev-libs/glib-2.44.0: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:= )
  57. gstreamer? (
  58. >=media-libs/gstreamer-1.14:1.0
  59. >=media-libs/gst-plugins-base-1.14:1.0[egl?,opengl?,X?]
  60. gles2-only? ( media-libs/gst-plugins-base:1.0[gles2] )
  61. >=media-plugins/gst-plugins-opus-1.14.4-r1:1.0
  62. >=media-libs/gst-plugins-bad-1.14:1.0[X?]
  63. )
  64. media-source? ( >=media-libs/gstreamer-1.16:1.0 )
  65. X? (
  66. x11-libs/libX11
  67. x11-libs/libXcomposite
  68. x11-libs/libXdamage
  69. x11-libs/libXrender
  70. x11-libs/libXt )
  71. libnotify? ( x11-libs/libnotify )
  72. dev-libs/hyphen
  73. jpeg2k? ( >=media-libs/openjpeg-2.2.0:2= )
  74. egl? ( media-libs/mesa[egl] )
  75. gles2-only? ( media-libs/mesa[gles2] )
  76. opengl? ( virtual/opengl )
  77. wayland? (
  78. dev-libs/wayland
  79. >=dev-libs/wayland-protocols-1.12
  80. opengl? ( ${wpe_depend} )
  81. gles2-only? ( ${wpe_depend} )
  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. unset wpe_depend
  92. BDEPEND="${RUBY_DEPS}"
  93. # paxctl needed for bug #407085
  94. # Need real bison, not yacc
  95. DEPEND="${RDEPEND}
  96. ${PYTHON_DEPS}
  97. dev-util/glib-utils
  98. >=dev-util/gtk-doc-am-1.10
  99. >=dev-util/gperf-3.0.1
  100. >=sys-devel/bison-2.4.3
  101. || ( >=sys-devel/gcc-7.3 >=sys-devel/clang-5 )
  102. sys-devel/gettext
  103. virtual/pkgconfig
  104. >=dev-lang/perl-5.10
  105. virtual/perl-Data-Dumper
  106. virtual/perl-Carp
  107. virtual/perl-JSON-PP
  108. gtk-doc? ( >=dev-util/gtk-doc-1.32 )
  109. geolocation? ( dev-util/gdbus-codegen )
  110. >=dev-util/cmake-3.10
  111. sys-apps/paxctl
  112. "
  113. RDEPEND="${RDEPEND}
  114. geolocation? ( >=app-misc/geoclue-2.1.5:2.0 )
  115. "
  116. RESTRICT="test"
  117. # tests are b0rk, PYTHON_USEDEP is as well
  118. # test? (
  119. # dev-python/pygobject:3[${PYTHON_USEDEP}]
  120. # x11-themes/hicolor-icon-theme )
  121. S="${WORKDIR}/${MY_P}"
  122. CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307
  123. pkg_pretend() {
  124. if [[ ${MERGE_TYPE} != "binary" ]] ; then
  125. if is-flagq "-g*" && ! is-flagq "-g*0" ; then
  126. einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS"
  127. check-reqs_pkg_pretend
  128. fi
  129. if ! test-flag-CXX -std=c++17 ; then
  130. die "You need at least GCC 7.3.x or Clang >= 5 for C++17-specific compiler flags"
  131. fi
  132. fi
  133. if ! use opengl && ! use gles2-only; then
  134. ewarn
  135. ewarn "You are disabling OpenGL usage (USE=opengl or USE=gles2-only) completely."
  136. ewarn "This is an unsupported configuration meant for very specific embedded"
  137. ewarn "use cases, where there truly is no GL possible (and even that use case"
  138. ewarn "is very unlikely to come by). If you have GL (even software-only), you"
  139. ewarn "really really should be enabling OpenGL!"
  140. ewarn
  141. fi
  142. }
  143. pkg_setup() {
  144. if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
  145. check-reqs_pkg_setup
  146. fi
  147. python-any-r1_pkg_setup
  148. }
  149. src_prepare() {
  150. eapply "${FILESDIR}"/2.28.2-opengl-without-X-fixes.patch
  151. cmake_src_prepare
  152. gnome2_src_prepare
  153. }
  154. src_configure() {
  155. if use debug; then
  156. CMAKE_BUILD_TYPE="Debug"
  157. fi
  158. # gtk-doc fails to generate docs when ld.lld is used, force binutils
  159. if use gtk-doc; then
  160. export CC_LD="ld"
  161. export LD="ld"
  162. fi
  163. # Respect CC, otherwise fails on prefix #395875
  164. tc-export CC
  165. # It does not compile on alpha without this in LDFLAGS
  166. # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648761
  167. use alpha && append-ldflags "-Wl,--no-relax"
  168. # ld segfaults on ia64 with LDFLAGS --as-needed, bug #555504
  169. use ia64 && append-ldflags "-Wl,--no-as-needed"
  170. # Sigbuses on SPARC with mcpu and co., bug #???
  171. use sparc && filter-flags "-mvis"
  172. # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634
  173. use ppc64 && append-flags "-mminimal-toc"
  174. # Try to use less memory, bug #469942 (see Fedora .spec for reference)
  175. # --no-keep-memory doesn't work on ia64, bug #502492
  176. if ! use ia64; then
  177. append-ldflags "-Wl,--no-keep-memory"
  178. fi
  179. # We try to use gold when possible for this package
  180. # if ! tc-ld-is-gold ; then
  181. # append-ldflags "-Wl,--reduce-memory-overheads"
  182. # fi
  183. # Ruby situation is a bit complicated. See bug 513888
  184. local rubyimpl
  185. local ruby_interpreter=""
  186. for rubyimpl in ${USE_RUBY}; do
  187. if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; then
  188. ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ${rubyimpl})"
  189. fi
  190. done
  191. # This will rarely occur. Only a couple of corner cases could lead us to
  192. # that failure. See bug 513888
  193. [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
  194. # TODO: Check Web Audio support
  195. # should somehow let user select between them?
  196. #
  197. # opengl needs to be explicetly handled, bug #576634
  198. local use_wpe_renderer=OFF
  199. local opengl_enabled
  200. if use opengl || use gles2-only; then
  201. opengl_enabled=ON
  202. use wayland && use_wpe_renderer=ON
  203. else
  204. opengl_enabled=OFF
  205. fi
  206. local mycmakeargs=(
  207. # begin PRIVATE options
  208. -DENABLE_API_TESTS=$(usex test)
  209. -DSHOULD_INSTALL_JS_SHELL=$(usex examples)
  210. -DENABLE_GEOLOCATION=$(usex geolocation) # Runtime optional (talks over dbus service)
  211. -DENABLE_UNIFIED_BUILDS=$(usex jumbo-build)
  212. -DENABLE_GAMEPAD=$(usex gamepad)
  213. # end PRIVATE options
  214. -DUSE_SYSTEMD=$(usex systemd)
  215. -DENABLE_WEBDRIVER=OFF
  216. -DENABLE_WEB_CRYPTO=OFF
  217. # -DENABLE_TOUCH_EVENTS=OFF
  218. # -DENABLE_DRAG_SUPPORT=OFF
  219. -DENABLE_MINIBROWSER=$(usex examples)
  220. -DENABLE_QUARTZ_TARGET=$(usex aqua)
  221. -DENABLE_GTKDOC=$(usex gtk-doc)
  222. $(cmake_use_find_package gles2-only OpenGLES2)
  223. -DENABLE_GLES2=$(usex gles2-only)
  224. -DENABLE_VIDEO=$(usex gstreamer)
  225. -DENABLE_WEB_AUDIO=$(usex gstreamer)
  226. -DENABLE_INTROSPECTION=$(usex introspection)
  227. -DUSE_LIBNOTIFY=$(usex libnotify)
  228. -DUSE_LIBSECRET=$(usex gnome-keyring)
  229. -DUSE_OPENJPEG=$(usex jpeg2k)
  230. -DUSE_WOFF2=ON
  231. -DENABLE_SPELLCHECK=$(usex spell)
  232. -DENABLE_WAYLAND_TARGET=$(usex wayland)
  233. $(cmake_use_find_package egl EGL)
  234. $(cmake_use_find_package opengl OpenGL)
  235. -DENABLE_X11_TARGET=$(usex X)
  236. -DENABLE_GRAPHICS_CONTEXT_GL=${opengl_enabled}
  237. -DENABLE_WEBGL=${opengl_enabled}
  238. -DUSE_WPE_RENDERER=${use_wpe_renderer}
  239. -DENABLE_BUBBLEWRAP_SANDBOX=$(usex seccomp)
  240. -DENABLE_MEDIA_SOURCE=$(usex media-source)
  241. -DBWRAP_EXECUTABLE="${EPREFIX}"/usr/bin/bwrap # If bubblewrap[suid] then portage makes it go-r and cmake find_program fails with that
  242. -DUSE_LD_GOLD=ON
  243. -DUSE_GTK4=OFF
  244. -DPORT=GTK
  245. ${ruby_interpreter}
  246. )
  247. # https://bugs.gentoo.org/761238
  248. append-cppflags -DNDEBUG
  249. cmake_src_configure
  250. }
  251. src_compile() {
  252. cmake_src_compile
  253. }
  254. src_test() {
  255. # Prevents test failures on PaX systems
  256. pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test*
  257. cmake_src_test
  258. }
  259. src_install() {
  260. cmake_src_install
  261. # Prevents crashes on PaX systems, bug #522808
  262. pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/jsc" "${ED}usr/libexec/webkit2gtk-4.0/WebKitWebProcess"
  263. pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/WebKitPluginProcess"
  264. }