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.1.ebuild (7565B)


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