logo

overlay

My own overlay for experimentations, use with caution, no support is provided

webkit-gtk-2.30.2.ebuild (8944B)


  1. # Copyright 1999-2020 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. CMAKE_MAKEFILE_GENERATOR="ninja"
  5. PYTHON_COMPAT=( python{3_6,3_7} )
  6. USE_RUBY="ruby24 ruby25 ruby26 ruby27"
  7. CMAKE_MIN_VERSION=3.10
  8. inherit check-reqs cmake-utils flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs virtualx
  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="4/37" # soname version of libwebkit2gtk-4.0
  15. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~x86-macos"
  16. IUSE="aqua debug +egl examples +geolocation gles2-only gnome-keyring +gstreamer gtk4 gtk-doc +introspection +jpeg2k +jumbo-build libnotify media-source +opengl seccomp spell systemd wayland +X"
  17. # gstreamer with opengl/gles2 needs egl
  18. REQUIRED_USE="
  19. geolocation? ( introspection )
  20. gles2-only? ( egl !opengl )
  21. gstreamer? ( opengl? ( egl ) )
  22. wayland? ( egl )
  23. media-source? ( gstreamer )
  24. || ( aqua wayland X )
  25. "
  26. # Aqua support in gtk3 is untested
  27. # Dependencies found at Source/cmake/OptionsGTK.cmake
  28. # Various compile-time optionals for gtk+-3.22.0 - ensure it
  29. # Missing WebRTC support, but ENABLE_MEDIA_STREAM/ENABLE_WEB_RTC is experimental upstream (PRIVATE OFF) and shouldn't be used yet in 2.26
  30. # >=gst-plugins-opus-1.14.4-r1 for opusparse (required by MSE)
  31. wpe_depend="
  32. >=gui-libs/libwpe-1.3.0:1.0
  33. >=gui-libs/wpebackend-fdo-1.3.1:1.0
  34. "
  35. RDEPEND="
  36. >=x11-libs/cairo-1.16.0:=[X?]
  37. >=media-libs/fontconfig-2.13.0:1.0
  38. >=media-libs/freetype-2.9.0:2
  39. >=dev-libs/libgcrypt-1.7.0:0=
  40. !gtk4? ( >=x11-libs/gtk+-3.22.0:3[aqua?,introspection?,wayland?,X?] )
  41. gtk4? ( x11-libs/gtk+:4[aqua?,introspection?,wayland?,X?] )
  42. >=media-libs/harfbuzz-1.4.2:=[icu(+)]
  43. >=dev-libs/icu-3.8.1-r1:=
  44. virtual/jpeg:0=
  45. >=net-libs/libsoup-2.54:2.4[introspection?]
  46. >=dev-libs/libxml2-2.8.0:2
  47. >=media-libs/libpng-1.4:0=
  48. dev-db/sqlite:3=
  49. sys-libs/zlib:0
  50. >=dev-libs/atk-2.16.0
  51. media-libs/libwebp:=
  52. >=dev-libs/glib-2.44.0:2
  53. >=dev-libs/libxslt-1.1.7
  54. media-libs/woff2
  55. gnome-keyring? ( app-crypt/libsecret )
  56. introspection? ( >=dev-libs/gobject-introspection-1.32.0:= )
  57. dev-libs/libtasn1:=
  58. spell? ( >=app-text/enchant-0.22:= )
  59. gstreamer? (
  60. >=media-libs/gstreamer-1.14:1.0
  61. >=media-libs/gst-plugins-base-1.14:1.0[egl?,opengl?,X?]
  62. gles2-only? ( media-libs/gst-plugins-base:1.0[gles2] )
  63. >=media-plugins/gst-plugins-opus-1.14.4-r1:1.0
  64. >=media-libs/gst-plugins-bad-1.14:1.0[X?]
  65. )
  66. media-source? ( >=media-libs/gstreamer-1.16:1.0 )
  67. X? (
  68. x11-libs/libX11
  69. x11-libs/libXcomposite
  70. x11-libs/libXdamage
  71. x11-libs/libXrender
  72. x11-libs/libXt )
  73. libnotify? ( x11-libs/libnotify )
  74. dev-libs/hyphen
  75. jpeg2k? ( >=media-libs/openjpeg-2.2.0:2= )
  76. egl? ( media-libs/mesa[egl] )
  77. gles2-only? ( media-libs/mesa[gles2] )
  78. opengl? ( virtual/opengl )
  79. wayland? (
  80. dev-libs/wayland
  81. >=dev-libs/wayland-protocols-1.12
  82. opengl? ( ${wpe_depend} )
  83. gles2-only? ( ${wpe_depend} )
  84. )
  85. seccomp? (
  86. >=sys-apps/bubblewrap-0.3.1
  87. sys-libs/libseccomp
  88. sys-apps/xdg-dbus-proxy
  89. )
  90. systemd? ( sys-apps/systemd:= )
  91. "
  92. unset wpe_depend
  93. # paxctl needed for bug #407085
  94. # Need real bison, not yacc
  95. DEPEND="${RDEPEND}
  96. ${PYTHON_DEPS}
  97. ${RUBY_DEPS}
  98. dev-util/glib-utils
  99. >=dev-util/gtk-doc-am-1.10
  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. gtk-doc? ( >=dev-util/gtk-doc-1.32 )
  110. geolocation? ( dev-util/gdbus-codegen )
  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-utils_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 --host-root "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. # end PRIVATE options
  213. -DUSE_SYSTEMD=$(usex systemd)
  214. -DUSE_GTK4=$(usex gtk4)
  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-utils_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-utils_use_find_package egl EGL)
  234. $(cmake-utils_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. -DPORT=GTK
  244. ${ruby_interpreter}
  245. )
  246. cmake-utils_src_configure
  247. }
  248. src_compile() {
  249. cmake-utils_src_compile
  250. }
  251. src_test() {
  252. # Prevents test failures on PaX systems
  253. pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test*
  254. cmake-utils_src_test
  255. }
  256. src_install() {
  257. cmake-utils_src_install
  258. # Prevents crashes on PaX systems, bug #522808
  259. pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/jsc" "${ED}usr/libexec/webkit2gtk-4.0/WebKitWebProcess"
  260. pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/WebKitPluginProcess"
  261. }