diff options
Diffstat (limited to 'net-libs/webkit-gtk')
-rw-r--r-- | net-libs/webkit-gtk/Manifest | 2 | ||||
-rw-r--r-- | net-libs/webkit-gtk/files/webkit-gtk-arm-asm.patch | 12 | ||||
-rw-r--r-- | net-libs/webkit-gtk/files/webkit-gtk-bug153373.patch | 24 | ||||
-rw-r--r-- | net-libs/webkit-gtk/files/webkit-gtk-relax-ruby-version-and-fix-offsets.patch | 15 | ||||
-rw-r--r-- | net-libs/webkit-gtk/webkit-gtk-2.18.2.ebuild | 314 | ||||
-rw-r--r-- | net-libs/webkit-gtk/webkit-gtk-2.18.3.ebuild | 314 |
6 files changed, 681 insertions, 0 deletions
diff --git a/net-libs/webkit-gtk/Manifest b/net-libs/webkit-gtk/Manifest index bbb7e8f..65fde45 100644 --- a/net-libs/webkit-gtk/Manifest +++ b/net-libs/webkit-gtk/Manifest @@ -1,6 +1,8 @@ DIST webkitgtk-2.10.7.tar.xz 10988396 SHA256 990d62c82ed6dede31a6ff0a82d847f16b812842ff3e1093d17113627652864e SHA512 f0d7b303236910d18568ab1e0a522915a70e9d3658537b32ea2c6a42b8b3ece034a292490f7882760338f2afc56468fd7a8ad8659b7afaf87906220a5c815b5b WHIRLPOOL 7cbe8c42e9c245709eee19a9a01f2a4b238596d8119e3420ca750abb3518e1333ff99a596e9f09d511773a964bafed5baa91efca7b711ddc1c91cb601c520328 DIST webkitgtk-2.10.8.tar.xz 10994340 SHA256 313682b23f03c457b28a7ef2d5bdb70a8174cca1d32e0a853fb36fa4dcf928a9 SHA512 ec49b2549756953b25d4488f5f2c9932ac43f81febe5f24ce0e170440089aaa0326a8cf3af767d161dd6a9ee27d21748e91ee6ebc55c3143260326fe9823e924 WHIRLPOOL 4f5cb6467ee7f431e2b07d9110c754d7171ffe0c31c35b23f826da7f6058d20168a6bdf9cf865c0dda2e9a7266b0d58668922866ccf5c60f80a22ef39ad9f445 DIST webkitgtk-2.10.9.tar.xz 10992980 SHA256 bbb18d741780b1b7fa284beb9a97361ac57cda2e42bad2ae2fcdbf797919e969 SHA512 a8eda5381f227098e208a81c093f0b83f4996378e8f54ddfbe5c164254d7e1ff4a260c827e2521c748ca02bc5a691e8bbd0f59da0718cfe18812c3b257ec5228 WHIRLPOOL c6f36d4195bbd9f97358700ac446ad65d5a426ba7f0913d69163b2f37c1aedc623bdea3650f2ad7da009f1d234c9d54a163e9155794d8218342332b82ead76df +DIST webkitgtk-2.18.2.tar.xz 14823612 SHA256 b14cb3f1b5321b1dc50abcc0445a97f8e2f8813562bca7ce4d2f8069f6fec8e7 SHA512 94c8ce0fcee741dc9c054fa3f8ecac9756245c623f36e6b0bb5588d12b660aaa8bbbe28e82d0f694b94b75f1985f9dbf9231a4b63832fcf4efbe7a0116c7585c WHIRLPOOL a1ccd765d6699f07ecad8b4c899398bb2152076eda4f3a86af61d67c741229cf3d0ef02a7c8fbca2fb494e1bb1822518a18aa4f88026e91ebd2d4835d6807545 +DIST webkitgtk-2.18.3.tar.xz 14824668 SHA256 e15420e1616a6f70f321541d467af5ca285bff66b1e0fa68a01df3ccf1b18f9e SHA512 8ba68d7234205728ed4b92358304cf0d0b771647d9b4316085241adeacafe67dee685225b0b46752087b93416ce8d2053a5a7c2376fda1eee7bc6d9024ae787e WHIRLPOOL 1151c09119bfbb213bb3cd291f3ddcc49e3c9f77396bc960e381754e564d72ea21e70641f3cd57f42b2dcb77c05fd92e158b02b0ae94fade22129d8ae114524a DIST webkitgtk-2.4.6.tar.xz 9862200 SHA256 6fef4aa8d4a2668e03ea15472a71396ea7b776bbe56ad9459a4124b823c11457 SHA512 4b6f1e92b30879eb3bebb722d15aa8f265a562d2e3bfa3bdfe52eb2fa652f2cf4787ee74fcb775e0c8f5fbfa2ce65ce51aeace9ded1fc4abef1e974381f55b90 WHIRLPOOL 9abaa24183d5642348679e518946d55be91a9ae93a37c23d7903b3d1de327d19a690e774db4fd883a08f17f08617c15283ed9507934ff4af08ed4dab811baa65 DIST webkitgtk-2.4.7.tar.xz 9826208 SHA256 f5cf26e39abf1d6b2d25f1398348fef6bbe6c03fb4f99e11c569091c05197d38 SHA512 1ba2371b34e40e078f6d85774e171f559e4f269ac80f63c56e2e7612e2ec3a41db0f5999af028b1b93657634fcdfcc3612e1a55eeeec2578fe448bd0861b0729 WHIRLPOOL 1cd8382e91efdce9d3654fe16de2f664b1f874ed7e9f811e5d652dd96e7269a48492f44ccbb1cd46e36d41b92188466b68a6e3e009e8dd037dce35ec9582f3d8 DIST webkitgtk-2.4.8.tar.xz 9827632 SHA256 68f11559cb178679ca92acc9e3a3d7febede7acb7b98afd7fb761875bbc6bd23 SHA512 31b8b87142730aa27e5bd4fe85b0de2116fd492ef469592512c185d60df428a9913d6c2738ce57439bf9db10864ed9c121ddbc2a4da2f715818a70885c81c0de WHIRLPOOL 851e3973c00096dd3a98e64bfa9f9f0f278c3513656af9a9aa72442cd6c594119adefafa6c06d05e431ec77bf6e9f1e10432e9b6895d777adfe2952843602ef2 diff --git a/net-libs/webkit-gtk/files/webkit-gtk-arm-asm.patch b/net-libs/webkit-gtk/files/webkit-gtk-arm-asm.patch new file mode 100644 index 0000000..635e00e --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-arm-asm.patch @@ -0,0 +1,12 @@ +--- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp 2016-04-10 06:48:37 UTC ++++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp +@@ -403,7 +403,7 @@ TOSTRING(neonDrawLighting) ":" NL + "vmin.f32 " TMP2_D0 ", " TMP2_D0 ", " CONST_ONE_HI_D NL + "vmul.f32 " TMP3_Q ", " COLOR_Q ", " TMP2_D0 "[1]" NL + "vcvt.u32.f32 " TMP3_Q ", " TMP3_Q NL +- "vmov.u32 r2, r3, " TMP3_S0 ", " TMP3_S1 NL ++ "vmov r2, r3, " TMP3_S0 ", " TMP3_S1 NL + // The color values are stored in-place. + "strb r2, [" PIXELS_R ", #-11]" NL + "strb r3, [" PIXELS_R ", #-10]" NL + diff --git a/net-libs/webkit-gtk/files/webkit-gtk-bug153373.patch b/net-libs/webkit-gtk/files/webkit-gtk-bug153373.patch new file mode 100644 index 0000000..3f1b051 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-bug153373.patch @@ -0,0 +1,24 @@ +Index: CMakeLists.txt +=================================================================== +--- a/CMakeLists.txt (revision 195393) ++++ b/CMakeLists.txt (working copy) +@@ -112,9 +112,15 @@ include(WebKitCommon) + # ----------------------------------------------------------------------------- + # Output directories + #------------------------------------------------------------------------------ +-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) ++if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY) ++ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) ++endif () ++if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) ++ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) ++endif () ++if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) ++ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) ++endif () + + # ----------------------------------------------------------------------------- + # Enable API unit tests and create a target for the test runner + diff --git a/net-libs/webkit-gtk/files/webkit-gtk-relax-ruby-version-and-fix-offsets.patch b/net-libs/webkit-gtk/files/webkit-gtk-relax-ruby-version-and-fix-offsets.patch new file mode 100644 index 0000000..4c4277b --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-relax-ruby-version-and-fix-offsets.patch @@ -0,0 +1,15 @@ +--- a/Source/cmake/WebKitCommon.cmake 2017-11-20 11:00:46.010738308 -0800 ++++ b/Source/cmake/WebKitCommon.cmake 2017-11-20 12:07:36.479693880 -0800 +@@ -27,9 +27,9 @@ + # We cannot check for RUBY_FOUND because it is set only when the full package is installed and + # the only thing we need is the interpreter. Unlike Python, cmake does not provide a macro + # for finding only the Ruby interpreter. +- find_package(Ruby 1.9) +- if (NOT RUBY_EXECUTABLE OR RUBY_VERSION VERSION_LESS 1.9) +- message(FATAL_ERROR "Ruby 1.9 or higher is required.") ++ find_package(Ruby 1.8) ++ if (NOT RUBY_EXECUTABLE OR RUBY_VERSION VERSION_LESS 1.8) ++ message(FATAL_ERROR "Ruby 1.8 or higher is required.") + endif () + + # ----------------------------------------------------------------------------- diff --git a/net-libs/webkit-gtk/webkit-gtk-2.18.2.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.18.2.ebuild new file mode 100644 index 0000000..fc6a5b8 --- /dev/null +++ b/net-libs/webkit-gtk/webkit-gtk-2.18.2.ebuild @@ -0,0 +1,314 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +CMAKE_MAKEFILE_GENERATOR="ninja" +PYTHON_COMPAT=( python2_7 ) +USE_RUBY="ruby22 ruby23 ruby24" + +inherit check-reqs cmake-utils eutils flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs versionator virtualx + +MY_P="webkitgtk-${PV}" +DESCRIPTION="Open source web browser engine" +HOMEPAGE="http://www.webkitgtk.org/" +SRC_URI="http://www.webkitgtk.org/releases/${MY_P}.tar.xz" + +LICENSE="LGPL-2+ BSD" +SLOT="4/37" # soname version of libwebkit2gtk-4.0 +KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos" + +IUSE="aqua coverage doc +egl +geolocation gles2 glx gnome-keyring +gstreamer +introspection +jit libnotify neon nsplugin +opengl spell wayland +webgl X" + +# webgl needs gstreamer, bug #560612 +REQUIRED_USE=" + geolocation? ( introspection ) + gles2? ( egl ) + introspection? ( gstreamer ) + nsplugin? ( X ) + webgl? ( ^^ ( gles2 opengl ) ) + !webgl? ( ?? ( gles2 opengl ) ) + webgl? ( gstreamer ) + wayland? ( egl ) + || ( aqua wayland X ) +" + +# Tests fail to link for inexplicable reasons +# https://bugs.webkit.org/show_bug.cgi?id=148210 +RESTRICT="test" + +# Aqua support in gtk3 is untested +# Dependencies found at Source/cmake/OptionsGTK.cmake +# Various compile-time optionals for gtk+-3.22.0 - ensure it +# Missing OpenWebRTC checks and conditionals, but ENABLE_MEDIA_STREAM/ENABLE_WEB_RTC is experimental upstream (PRIVATE OFF) +RDEPEND=" + >=x11-libs/cairo-1.10.2:= + >=media-libs/fontconfig-2.8.0:1.0 + >=media-libs/freetype-2.4.2:2 + >=dev-libs/libgcrypt-1.6.0:0= + >=x11-libs/gtk+-3.22:3[aqua?,introspection?,wayland?,X?] + >=media-libs/harfbuzz-1.3.3:=[icu(+)] + >=dev-libs/icu-3.8.1-r1:= + virtual/jpeg:0= + >=net-libs/libsoup-2.48:2.4[introspection?] + >=dev-libs/libxml2-2.8.0:2 + >=media-libs/libpng-1.4:0= + dev-db/sqlite:3= + sys-libs/zlib:0 + >=dev-libs/atk-2.8.0 + media-libs/libwebp:= + + >=dev-libs/glib-2.40:2 + >=dev-libs/libxslt-1.1.7 + gnome-keyring? ( app-crypt/libsecret ) + geolocation? ( >=app-misc/geoclue-2.1.5:2.0 ) + introspection? ( >=dev-libs/gobject-introspection-1.32.0:= ) + dev-libs/libtasn1:= + >=dev-libs/libgcrypt-1.7.0:0= + nsplugin? ( >=x11-libs/gtk+-2.24.10:2 ) + spell? ( >=app-text/enchant-0.22:= ) + gstreamer? ( + >=media-libs/gstreamer-1.2.3:1.0 + >=media-libs/gst-plugins-base-1.2.3:1.0 + >=media-libs/gst-plugins-bad-1.10:1.0[opengl?,egl?] ) + + X? ( + x11-libs/cairo[X] + x11-libs/libX11 + x11-libs/libXcomposite + x11-libs/libXdamage + x11-libs/libXrender + x11-libs/libXt ) + + libnotify? ( x11-libs/libnotify ) + dev-libs/hyphen + + egl? ( media-libs/mesa[egl] ) + gles2? ( media-libs/mesa[gles2] ) + opengl? ( virtual/opengl + x11-libs/cairo[opengl] ) + webgl? ( + x11-libs/cairo[opengl] + x11-libs/libXcomposite + x11-libs/libXdamage ) +" + +# paxctl needed for bug #407085 +# Need real bison, not yacc +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + ${RUBY_DEPS} + >=app-accessibility/at-spi2-core-2.5.3 + >=dev-lang/perl-5.10 + >=dev-util/gtk-doc-am-1.10 + >=dev-util/gperf-3.0.1 + >=sys-devel/bison-2.4.3 + || ( >=sys-devel/gcc-4.9 >=sys-devel/clang-3.3 ) + sys-devel/gettext + virtual/pkgconfig + + dev-lang/perl + virtual/perl-Data-Dumper + virtual/perl-Carp + + doc? ( >=dev-util/gtk-doc-1.10 ) + geolocation? ( dev-util/gdbus-codegen ) + introspection? ( jit? ( sys-apps/paxctl ) ) + test? ( + dev-lang/python:2.7 + dev-python/pygobject:3[python_targets_python2_7] + x11-themes/hicolor-icon-theme + jit? ( sys-apps/paxctl ) ) +" + +S="${WORKDIR}/${MY_P}" + +CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307 + +pkg_pretend() { + if [[ ${MERGE_TYPE} != "binary" ]] ; then + if is-flagq "-g*" && ! is-flagq "-g*0" ; then + einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS" + check-reqs_pkg_pretend + fi + + if ! test-flag-CXX -std=c++11 ; then + die "You need at least GCC 4.9.x or Clang >= 3.3 for C++11-specific compiler flags" + fi + + if tc-is-gcc && [[ $(gcc-version) < 4.9 ]] ; then + die 'The active compiler needs to be gcc 4.9 (or newer)' + fi + fi +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then + check-reqs_pkg_setup + fi + + python-any-r1_pkg_setup +} + +src_prepare() { + # https://bugs.gentoo.org/show_bug.cgi?id=555504 + eapply "${FILESDIR}"/${PN}-2.8.5-fix-ia64-build.patch \ + "${FILESDIR}"/${PN}-arm-asm.patch \ + "${FILESDIR}"/${PN}-bug153373.patch +# "${FILESDIR}"/${PN}-relax-ruby-version-and-fix-offsets.patch + + cmake-utils_src_prepare + gnome2_src_prepare +} + +src_configure() { + # Respect CC, otherwise fails on prefix #395875 + tc-export CC + + # Arches without JIT support also need this to really disable it in all places + use jit || append-cppflags -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0 + + # It does not compile on alpha without this in LDFLAGS + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648761 + use alpha && append-ldflags "-Wl,--no-relax" + + # ld segfaults on ia64 with LDFLAGS --as-needed, bug #555504 + use ia64 && append-ldflags "-Wl,--no-as-needed" + + # Sigbuses on SPARC with mcpu and co., bug #??? + use sparc && filter-flags "-mvis" + + # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634 + use ppc64 && append-flags "-mminimal-toc" + + # Try to use less memory, bug #469942 (see Fedora .spec for reference) + # --no-keep-memory doesn't work on ia64, bug #502492 + if ! use ia64; then + append-ldflags "-Wl,--no-keep-memory" + fi + + # workaround for busted argument handling + if use opengl ; then + local mycmakeargs+=( -WTF_USE_OPENGL=1 ) + if use glx ; then + mycmakeargs+=( -WTF_USE_GLX=1 ) + fi + else + mycmakeargs+=( -WTF_USE_OPENGL=0 ) + mycmakeargs+=( -WTF_USE_GLX=0 ) + fi + + # yes, this is stupid, but webkit is stupider... + if use arm ; then + append-cppflags "-D_ARM_" + append-cppflags "-D__ARM_PCS_VFP" + if [[ ${CHOST} == armv7* ]] ; then + append-cppflags "-D__ARM_ARCH_7A__" + fi + if use neon ; then + append-cppflags "-D__ARM_NEON__" + fi + fi + + if tc-ld-is-gold ; then + mycmakeargs+=( -DUSE_LD_GOLD=OFF ) + fi + + # testing... +# mycmakeargs+=( -DDISABLE_STRICT_BUILD=ON ) + append-cxxflags -std=c++11 + + # Multiple rendering bugs on youtube, github, etc without this, bug #547224 + append-flags $(test-flags -fno-strict-aliasing) + + local ruby_interpreter="" + + if has_version "virtual/rubygems[ruby_targets_ruby24]"; then + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby24)" + elif has_version "virtual/rubygems[ruby_targets_ruby23]"; then + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby23)" + elif has_version "virtual/rubygems[ruby_targets_ruby22]"; then + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby22)" + else + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby21)" + fi + + # TODO: Check Web Audio support + # should somehow let user select between them? + # + # FTL_JIT requires llvm + # + # opengl needs to be explicetly handled, bug #576634 + + local opengl_enabled + if use opengl || use gles2; then + opengl_enabled=ON + else + opengl_enabled=OFF + fi + + # support for webgl (aka 2d-canvas accelerating) + local canvas_enabled + if use webgl && ! use gles2 ; then + canvas_enabled=ON + else + canvas_enabled=OFF + fi + + mycmakeargs+=( + -DENABLE_QUARTZ_TARGET=$(usex aqua) + -DENABLE_API_TESTS=$(usex test) + -DENABLE_GTKDOC=$(usex doc) + -DENABLE_GEOLOCATION=$(usex geolocation) + $(cmake-utils_use_find_package gles2 OpenGLES2) + -DENABLE_GLES2=$(usex gles2) + -DENABLE_VIDEO=$(usex gstreamer) + -DENABLE_WEB_AUDIO=$(usex gstreamer) + -DENABLE_INTROSPECTION=$(usex introspection) + -DENABLE_JIT=$(usex jit) + -DUSE_LIBNOTIFY=$(usex libnotify) + -DUSE_LIBSECRET=$(usex gnome-keyring) + -DENABLE_PLUGIN_PROCESS_GTK2=$(usex nsplugin) + -DENABLE_SPELLCHECK=$(usex spell) + -DENABLE_WAYLAND_TARGET=$(usex wayland) + -DENABLE_WEBGL=$(usex webgl) + $(cmake-utils_use_find_package egl EGL) + $(cmake-utils_use_find_package opengl OpenGL) + -DENABLE_X11_TARGET=$(usex X) + -DENABLE_OPENGL=${opengl_enabled} + -DENABLE_ACCELERATED_2D_CANVAS=${canvas_enabled} + -DCMAKE_BUILD_TYPE=Release + -DPORT=GTK + ${ruby_interpreter} + ) + + # Allow it to use GOLD when possible as it has all the magic to + # detect when to use it and using gold for this concrete package has + # multiple advantages and is also the upstream default, bug #585788 +# if tc-ld-is-gold ; then +# mycmakeargs+=( -DUSE_LD_GOLD=ON ) +# else +# mycmakeargs+=( -DUSE_LD_GOLD=OFF ) +# fi + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_compile +} + +src_test() { + # Prevents test failures on PaX systems + use jit && pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test* + + cmake-utils_src_test +} + +src_install() { + cmake-utils_src_install + + # Prevents crashes on PaX systems, bug #522808 + use jit && pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/jsc" "${ED}usr/libexec/webkit2gtk-4.0/WebKitWebProcess" + pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/WebKitPluginProcess" + use nsplugin && pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/WebKitPluginProcess"2 +} diff --git a/net-libs/webkit-gtk/webkit-gtk-2.18.3.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.18.3.ebuild new file mode 100644 index 0000000..6bb67d6 --- /dev/null +++ b/net-libs/webkit-gtk/webkit-gtk-2.18.3.ebuild @@ -0,0 +1,314 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +CMAKE_MAKEFILE_GENERATOR="ninja" +PYTHON_COMPAT=( python2_7 ) +USE_RUBY="ruby22 ruby23 ruby24" + +inherit check-reqs cmake-utils eutils flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs versionator virtualx + +MY_P="webkitgtk-${PV}" +DESCRIPTION="Open source web browser engine" +HOMEPAGE="http://www.webkitgtk.org/" +SRC_URI="http://www.webkitgtk.org/releases/${MY_P}.tar.xz" + +LICENSE="LGPL-2+ BSD" +SLOT="4/37" # soname version of libwebkit2gtk-4.0 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos" + +IUSE="aqua coverage doc +egl +geolocation gles2 glx gnome-keyring +gstreamer +introspection +jit libnotify neon nsplugin +opengl spell wayland +webgl X" + +# webgl needs gstreamer, bug #560612 +REQUIRED_USE=" + geolocation? ( introspection ) + gles2? ( egl ) + introspection? ( gstreamer ) + nsplugin? ( X ) + webgl? ( ^^ ( gles2 opengl ) ) + !webgl? ( ?? ( gles2 opengl ) ) + webgl? ( gstreamer ) + wayland? ( egl ) + || ( aqua wayland X ) +" + +# Tests fail to link for inexplicable reasons +# https://bugs.webkit.org/show_bug.cgi?id=148210 +RESTRICT="test" + +# Aqua support in gtk3 is untested +# Dependencies found at Source/cmake/OptionsGTK.cmake +# Various compile-time optionals for gtk+-3.22.0 - ensure it +# Missing OpenWebRTC checks and conditionals, but ENABLE_MEDIA_STREAM/ENABLE_WEB_RTC is experimental upstream (PRIVATE OFF) +RDEPEND=" + >=x11-libs/cairo-1.10.2:= + >=media-libs/fontconfig-2.8.0:1.0 + >=media-libs/freetype-2.4.2:2 + >=dev-libs/libgcrypt-1.6.0:0= + >=x11-libs/gtk+-3.22:3[aqua?,introspection?,wayland?,X?] + >=media-libs/harfbuzz-1.3.3:=[icu(+)] + >=dev-libs/icu-3.8.1-r1:= + virtual/jpeg:0= + >=net-libs/libsoup-2.48:2.4[introspection?] + >=dev-libs/libxml2-2.8.0:2 + >=media-libs/libpng-1.4:0= + dev-db/sqlite:3= + sys-libs/zlib:0 + >=dev-libs/atk-2.8.0 + media-libs/libwebp:= + + >=dev-libs/glib-2.40:2 + >=dev-libs/libxslt-1.1.7 + gnome-keyring? ( app-crypt/libsecret ) + geolocation? ( >=app-misc/geoclue-2.1.5:2.0 ) + introspection? ( >=dev-libs/gobject-introspection-1.32.0:= ) + dev-libs/libtasn1:= + >=dev-libs/libgcrypt-1.7.0:0= + nsplugin? ( >=x11-libs/gtk+-2.24.10:2 ) + spell? ( >=app-text/enchant-0.22:= ) + gstreamer? ( + >=media-libs/gstreamer-1.2.3:1.0 + >=media-libs/gst-plugins-base-1.2.3:1.0 + >=media-libs/gst-plugins-bad-1.10:1.0[opengl?,egl?] ) + + X? ( + x11-libs/cairo[X] + x11-libs/libX11 + x11-libs/libXcomposite + x11-libs/libXdamage + x11-libs/libXrender + x11-libs/libXt ) + + libnotify? ( x11-libs/libnotify ) + dev-libs/hyphen + + egl? ( media-libs/mesa[egl] ) + gles2? ( media-libs/mesa[gles2] ) + opengl? ( virtual/opengl + x11-libs/cairo[opengl] ) + webgl? ( + x11-libs/cairo[opengl] + x11-libs/libXcomposite + x11-libs/libXdamage ) +" + +# paxctl needed for bug #407085 +# Need real bison, not yacc +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + ${RUBY_DEPS} + >=app-accessibility/at-spi2-core-2.5.3 + >=dev-lang/perl-5.10 + >=dev-util/gtk-doc-am-1.10 + >=dev-util/gperf-3.0.1 + >=sys-devel/bison-2.4.3 + || ( >=sys-devel/gcc-4.9 >=sys-devel/clang-3.3 ) + sys-devel/gettext + virtual/pkgconfig + + dev-lang/perl + virtual/perl-Data-Dumper + virtual/perl-Carp + + doc? ( >=dev-util/gtk-doc-1.10 ) + geolocation? ( dev-util/gdbus-codegen ) + introspection? ( jit? ( sys-apps/paxctl ) ) + test? ( + dev-lang/python:2.7 + dev-python/pygobject:3[python_targets_python2_7] + x11-themes/hicolor-icon-theme + jit? ( sys-apps/paxctl ) ) +" + +S="${WORKDIR}/${MY_P}" + +CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307 + +pkg_pretend() { + if [[ ${MERGE_TYPE} != "binary" ]] ; then + if is-flagq "-g*" && ! is-flagq "-g*0" ; then + einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS" + check-reqs_pkg_pretend + fi + + if ! test-flag-CXX -std=c++11 ; then + die "You need at least GCC 4.9.x or Clang >= 3.3 for C++11-specific compiler flags" + fi + + if tc-is-gcc && [[ $(gcc-version) < 4.9 ]] ; then + die 'The active compiler needs to be gcc 4.9 (or newer)' + fi + fi +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then + check-reqs_pkg_setup + fi + + python-any-r1_pkg_setup +} + +src_prepare() { + # https://bugs.gentoo.org/show_bug.cgi?id=555504 + eapply "${FILESDIR}"/${PN}-2.8.5-fix-ia64-build.patch \ + "${FILESDIR}"/${PN}-arm-asm.patch \ + "${FILESDIR}"/${PN}-bug153373.patch +# "${FILESDIR}"/${PN}-relax-ruby-version-and-fix-offsets.patch + + cmake-utils_src_prepare + gnome2_src_prepare +} + +src_configure() { + # Respect CC, otherwise fails on prefix #395875 + tc-export CC + + # Arches without JIT support also need this to really disable it in all places + use jit || append-cppflags -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0 + + # It does not compile on alpha without this in LDFLAGS + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648761 + use alpha && append-ldflags "-Wl,--no-relax" + + # ld segfaults on ia64 with LDFLAGS --as-needed, bug #555504 + use ia64 && append-ldflags "-Wl,--no-as-needed" + + # Sigbuses on SPARC with mcpu and co., bug #??? + use sparc && filter-flags "-mvis" + + # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634 + use ppc64 && append-flags "-mminimal-toc" + + # Try to use less memory, bug #469942 (see Fedora .spec for reference) + # --no-keep-memory doesn't work on ia64, bug #502492 + if ! use ia64; then + append-ldflags "-Wl,--no-keep-memory" + fi + + # workaround for busted argument handling + if use opengl ; then + local mycmakeargs+=( -WTF_USE_OPENGL=1 ) + if use glx ; then + mycmakeargs+=( -WTF_USE_GLX=1 ) + fi + else + mycmakeargs+=( -WTF_USE_OPENGL=0 ) + mycmakeargs+=( -WTF_USE_GLX=0 ) + fi + + # yes, this is stupid, but webkit is stupider... + if use arm ; then + append-cppflags "-D_ARM_" + append-cppflags "-D__ARM_PCS_VFP" + if [[ ${CHOST} == armv7* ]] ; then + append-cppflags "-D__ARM_ARCH_7A__" + fi + if use neon ; then + append-cppflags "-D__ARM_NEON__" + fi + fi + + if tc-ld-is-gold ; then + mycmakeargs+=( -DUSE_LD_GOLD=OFF ) + fi + + # testing... +# mycmakeargs+=( -DDISABLE_STRICT_BUILD=ON ) + append-cxxflags -std=c++11 + + # Multiple rendering bugs on youtube, github, etc without this, bug #547224 + append-flags $(test-flags -fno-strict-aliasing) + + local ruby_interpreter="" + + if has_version "virtual/rubygems[ruby_targets_ruby24]"; then + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby24)" + elif has_version "virtual/rubygems[ruby_targets_ruby23]"; then + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby23)" + elif has_version "virtual/rubygems[ruby_targets_ruby22]"; then + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby22)" + else + ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby21)" + fi + + # TODO: Check Web Audio support + # should somehow let user select between them? + # + # FTL_JIT requires llvm + # + # opengl needs to be explicetly handled, bug #576634 + + local opengl_enabled + if use opengl || use gles2; then + opengl_enabled=ON + else + opengl_enabled=OFF + fi + + # support for webgl (aka 2d-canvas accelerating) + local canvas_enabled + if use webgl && ! use gles2 ; then + canvas_enabled=ON + else + canvas_enabled=OFF + fi + + mycmakeargs+=( + -DENABLE_QUARTZ_TARGET=$(usex aqua) + -DENABLE_API_TESTS=$(usex test) + -DENABLE_GTKDOC=$(usex doc) + -DENABLE_GEOLOCATION=$(usex geolocation) + $(cmake-utils_use_find_package gles2 OpenGLES2) + -DENABLE_GLES2=$(usex gles2) + -DENABLE_VIDEO=$(usex gstreamer) + -DENABLE_WEB_AUDIO=$(usex gstreamer) + -DENABLE_INTROSPECTION=$(usex introspection) + -DENABLE_JIT=$(usex jit) + -DUSE_LIBNOTIFY=$(usex libnotify) + -DUSE_LIBSECRET=$(usex gnome-keyring) + -DENABLE_PLUGIN_PROCESS_GTK2=$(usex nsplugin) + -DENABLE_SPELLCHECK=$(usex spell) + -DENABLE_WAYLAND_TARGET=$(usex wayland) + -DENABLE_WEBGL=$(usex webgl) + $(cmake-utils_use_find_package egl EGL) + $(cmake-utils_use_find_package opengl OpenGL) + -DENABLE_X11_TARGET=$(usex X) + -DENABLE_OPENGL=${opengl_enabled} + -DENABLE_ACCELERATED_2D_CANVAS=${canvas_enabled} + -DCMAKE_BUILD_TYPE=Release + -DPORT=GTK + ${ruby_interpreter} + ) + + # Allow it to use GOLD when possible as it has all the magic to + # detect when to use it and using gold for this concrete package has + # multiple advantages and is also the upstream default, bug #585788 +# if tc-ld-is-gold ; then +# mycmakeargs+=( -DUSE_LD_GOLD=ON ) +# else +# mycmakeargs+=( -DUSE_LD_GOLD=OFF ) +# fi + + cmake-utils_src_configure +} + +src_compile() { + cmake-utils_src_compile +} + +src_test() { + # Prevents test failures on PaX systems + use jit && pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test* + + cmake-utils_src_test +} + +src_install() { + cmake-utils_src_install + + # Prevents crashes on PaX systems, bug #522808 + use jit && pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/jsc" "${ED}usr/libexec/webkit2gtk-4.0/WebKitWebProcess" + pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/WebKitPluginProcess" + use nsplugin && pax-mark m "${ED}usr/libexec/webkit2gtk-4.0/WebKitPluginProcess"2 +} |