diff options
author | 2015-02-18 12:25:16 +0200 | |
---|---|---|
committer | 2015-02-18 12:25:16 +0200 | |
commit | ae6f55d70ff27d1990d7e2eb8c4a02314fd21422 (patch) | |
tree | 109055d017abb1b4f243d879a46b4c261dfb80b6 | |
parent | raspberrypi-userland: Copy the wayland-egl pkgconfig file to libdir (diff) | |
download | leio-ae6f55d70ff27d1990d7e2eb8c4a02314fd21422.tar.gz leio-ae6f55d70ff27d1990d7e2eb8c4a02314fd21422.tar.bz2 leio-ae6f55d70ff27d1990d7e2eb8c4a02314fd21422.zip |
Add net-libs/webkit-gtk that merges on Raspberry Pi
The append-ldflags part is untested, as due to the compile times after a failure
had to add it manually. Ought to work though, let me know if not.
USE=rpi is used to pick up rpi-userland gles2/egl together with USE=webgl, which
actually also enables accelerated compositing..
As newer version does not support building without accelerated compositing, and
with that a GL implementation will be mandatory, no point in introducing new USE
flags in an overlay to separate webgl and AC. metadata.xml is updated here, though
13 files changed, 629 insertions, 0 deletions
diff --git a/net-libs/webkit-gtk/Manifest b/net-libs/webkit-gtk/Manifest new file mode 100644 index 0000000..e877ce7 --- /dev/null +++ b/net-libs/webkit-gtk/Manifest @@ -0,0 +1 @@ +DIST webkitgtk-2.4.8.tar.xz 9827632 SHA256 68f11559cb178679ca92acc9e3a3d7febede7acb7b98afd7fb761875bbc6bd23 SHA512 31b8b87142730aa27e5bd4fe85b0de2116fd492ef469592512c185d60df428a9913d6c2738ce57439bf9db10864ed9c121ddbc2a4da2f715818a70885c81c0de WHIRLPOOL 851e3973c00096dd3a98e64bfa9f9f0f278c3513656af9a9aa72442cd6c594119adefafa6c06d05e431ec77bf6e9f1e10432e9b6895d777adfe2952843602ef2 diff --git a/net-libs/webkit-gtk/files/webkit-gtk-1.11.90-gtk-docize-fix.patch b/net-libs/webkit-gtk/files/webkit-gtk-1.11.90-gtk-docize-fix.patch new file mode 100644 index 0000000..8f56ab2 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-1.11.90-gtk-docize-fix.patch @@ -0,0 +1,10 @@ +--- configure.ac.old 2013-03-02 09:22:53.791750644 +0200 ++++ configure.ac 2013-03-02 09:24:56.725213764 +0200 +@@ -24,6 +24,7 @@ + m4_include([Source/autotools/SetupLibtool.m4]) + m4_include([Source/autotools/ReadCommandLineArguments.m4]) + m4_include([Source/autotools/FindDependencies.m4]) ++GTK_DOC_CHECK([1.10]) + m4_include([Source/autotools/SetupCompilerFlags.m4]) + m4_include([Source/autotools/SetupAutoconfHeader.m4]) + diff --git a/net-libs/webkit-gtk/files/webkit-gtk-1.6.1-darwin-quartz.patch b/net-libs/webkit-gtk/files/webkit-gtk-1.6.1-darwin-quartz.patch new file mode 100644 index 0000000..5ad357e --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-1.6.1-darwin-quartz.patch @@ -0,0 +1,67 @@ +Original from: +http://trac.macports.org/browser/trunk/dports/www/webkit-gtk/files/patch-quartz-WebCore-plugins-gtk-gtkxtbin.c.diff?format=txt +http://trac.macports.org/browser/trunk/dports/www/webkit-gtk/files/patch-quartz-WebCore-plugins-gtk-PluginViewGtk.cpp.diff?format=txt + +Adapted for 1.6.1 + +--- Source/WebCore/plugins/gtk/PluginViewGtk.cpp ++++ Source/WebCore/plugins/gtk/PluginViewGtk.cpp +@@ -70,6 +70,8 @@ + #endif + #include <gtk/gtk.h> + ++#undef XP_UNIX ++ + #if defined(XP_UNIX) + #include "RefPtrCairo.h" + #include "gtk2xtbin.h" +@@ -439,9 +441,9 @@ + event->setDefaultHandled(); + } + +-#if defined(XP_UNIX) + void PluginView::handleFocusInEvent() + { ++#if defined(XP_UNIX) + if (!m_isStarted || m_status != PluginStatusLoadedSuccessfully) + return; + +@@ -454,10 +456,12 @@ + event.detail = NotifyDetailNone; + + dispatchNPEvent(npEvent); ++#endif + } + + void PluginView::handleFocusOutEvent() + { ++#if defined(XP_UNIX) + if (!m_isStarted || m_status != PluginStatusLoadedSuccessfully) + return; + +@@ -470,8 +474,8 @@ + event.detail = NotifyDetailNone; + + dispatchNPEvent(npEvent); +-} + #endif ++} + + void PluginView::setParent(ScrollView* parent) + { +--- Source/WebCore/plugins/gtk/gtk2xtbin.c ++++ Source/WebCore/plugins/gtk/gtk2xtbin.c +@@ -41,7 +41,7 @@ + * The GtkXtBin widget allows for Xt toolkit code to be used + * inside a GTK application. + */ +- ++#if 0 + #include "GtkVersioning.h" + #include "xembed.h" + #include "gtk2xtbin.h" +@@ -966,3 +966,4 @@ + + return; + } ++#endif diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-hppa-platform.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-hppa-platform.patch new file mode 100644 index 0000000..8aee778 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-hppa-platform.patch @@ -0,0 +1,20 @@ +Index: webkitgtk/Source/WTF/wtf/Platform.h +=================================================================== +--- webkitgtk.orig/Source/WTF/wtf/Platform.h ++++ webkitgtk/Source/WTF/wtf/Platform.h +@@ -72,6 +72,15 @@ + #define WTF_CPU_BIG_ENDIAN 1 + #endif + ++/* CPU(HPPA) - HP PARISC */ ++#if defined(__hppa__) ++#define WTF_CPU_HPPA 1 ++#define WTF_CPU_BIG_ENDIAN 1 ++#define ENABLE_JIT 0 ++#define ENABLE_YARR_JIT 0 ++#define ENABLE_ASSEMBLER 0 ++#endif ++ + /* CPU(IA64) - Itanium / IA-64 */ + #if defined(__ia64__) + #define WTF_CPU_IA64 1 diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-platform.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-platform.patch new file mode 100644 index 0000000..a63e9e8 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-platform.patch @@ -0,0 +1,12 @@ +--- a/Source/WTF/wtf/Platform.h 2014-02-25 00:33:16.561606810 +0100 ++++ b/Source/WTF/wtf/Platform.h 2014-02-25 00:49:52.895512955 +0100 +@@ -79,6 +79,9 @@ + #if !defined(__LP64__) + #define WTF_CPU_IA64_32 1 + #endif ++#define ENABLE_JIT 0 ++#define ENABLE_YARR_JIT 0 ++#define ENABLE_ASSEMBLER 0 + #endif + + /* CPU(MIPS) - MIPS 32-bit */ diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-ia64-malloc.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-ia64-malloc.patch new file mode 100644 index 0000000..8c387ff --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-ia64-malloc.patch @@ -0,0 +1,20 @@ +Description: Fix wide pointer issues on ia64 (closes: #642750). +Author: Stephan Schreiber <info@fs-driver.org> +Index: webkitgtk/Source/WTF/wtf/Platform.h +=================================================================== +--- webkitgtk.orig/Source/WTF/wtf/Platform.h ++++ webkitgtk/Source/WTF/wtf/Platform.h +@@ -705,6 +705,13 @@ + #define ENABLE_JIT 1 + #endif + ++/* FIXME: The fast malloc implementation is broken on Itanium / IA64 because ++ some memory barriers are missing in the thread-unsafe code around the ++ pagemap_cache_ object. */ ++#if CPU(IA64) || CPU(IA64_32) ++#define USE_SYSTEM_MALLOC 1 ++#endif ++ + /* The JIT is enabled by default on all x86, x86-64, ARM & MIPS platforms except Win64. */ + #if !defined(ENABLE_JIT) \ + && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)) \ diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.4-atomic-ppc.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.4-atomic-ppc.patch new file mode 100644 index 0000000..3c0ea88 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.4-atomic-ppc.patch @@ -0,0 +1,32 @@ +$OpenBSD: patch-Source_WebKit2_Platform_IPC_Connection_h,v 1.2 2014/07/14 21:13:31 ajacoutot Exp $ +https://bugs.webkit.org/show_bug.cgi?id=130837 +--- Source/WebKit2/Platform/IPC/Connection.h.orig Fri Jul 4 11:06:55 2014 ++++ Source/WebKit2/Platform/IPC/Connection.h Mon Jul 14 19:31:35 2014 +@@ -216,7 +216,11 @@ class Connection : public ThreadSafeRefCounted<Connect + + Client* m_client; + bool m_isServer; ++#if CPU(PPC) ++ uint64_t m_syncRequestID; ++#else + std::atomic<uint64_t> m_syncRequestID; ++#endif + + bool m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage; + bool m_shouldExitOnSyncMessageSendFailure; +$OpenBSD: patch-Source_WebKit2_UIProcess_StatisticsRequest_cpp,v 1.3 2014/03/27 22:03:48 landry Exp $ +https://bugs.webkit.org/show_bug.cgi?id=130837 +--- Source/WebKit2/UIProcess/StatisticsRequest.cpp.orig Thu Mar 27 21:13:49 2014 ++++ Source/WebKit2/UIProcess/StatisticsRequest.cpp Thu Mar 27 21:14:23 2014 +@@ -44,7 +44,11 @@ StatisticsRequest::~StatisticsRequest() + + uint64_t StatisticsRequest::addOutstandingRequest() + { ++#if CPU(PPC) ++ static int64_t uniqueRequestID; ++#else + static std::atomic<int64_t> uniqueRequestID; ++#endif + + uint64_t requestID = ++uniqueRequestID; + m_outstandingRequests.add(requestID); diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.4-jpeg-9a.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.4-jpeg-9a.patch new file mode 100644 index 0000000..4226f2f --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.4-jpeg-9a.patch @@ -0,0 +1,30 @@ +http://bugs.gentoo.org/481688 +http://trac.webkit.org/changeset/166490/trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp + +--- Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp ++++ Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp +@@ -334,5 +334,5 @@ + case JPEG_HEADER: + // Read file parameters with jpeg_read_header(). +- if (jpeg_read_header(&m_info, true) == JPEG_SUSPENDED) ++ if (jpeg_read_header(&m_info, TRUE) == JPEG_SUSPENDED) + return false; // I/O suspension. + +@@ -420,7 +420,7 @@ + m_info.dct_method = dctMethod(); + m_info.dither_mode = ditherMode(); +- m_info.do_fancy_upsampling = doFancyUpsampling(); +- m_info.enable_2pass_quant = false; +- m_info.do_block_smoothing = true; ++ m_info.do_fancy_upsampling = doFancyUpsampling() ? TRUE : FALSE; ++ m_info.enable_2pass_quant = FALSE; ++ m_info.do_block_smoothing = TRUE; + + // Start decompressor. +@@ -573,5 +573,5 @@ + // called, then we have hit the end of the buffer. A return value of false + // indicates that we have no data to supply yet. +- return false; ++ return FALSE; + } + diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.7-disable-accelerated-compositing.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.7-disable-accelerated-compositing.patch new file mode 100644 index 0000000..4113471 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.7-disable-accelerated-compositing.patch @@ -0,0 +1,11 @@ +--- webkitgtk-2.4.6.orig/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp 2014-09-26 11:40:45.000000000 +0400 ++++ webkitgtk-2.4.6.orig/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp 2014-10-11 20:43:16.687116807 +0400 +@@ -110,7 +110,7 @@ + WebCore::memoryCache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval); + WebCore::pageCache()->setCapacity(pageCacheCapacity); + +-#if PLATFORM(GTK) ++#if PLATFORM(GTK) && USE(ACCELERATED_COMPOSITING) + WebCore::pageCache()->setShouldClearBackingStores(true); + #endif + diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.7-disable-webgl.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.7-disable-webgl.patch new file mode 100644 index 0000000..67760e2 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.7-disable-webgl.patch @@ -0,0 +1,11 @@ +--- webkitgtk-2.4.6.orig/Source/WebCore/platform/graphics/OpenGLShims.cpp 2014-09-26 11:40:44.000000000 +0400 ++++ webkitgtk-2.4.6.orig/Source/WebCore/platform/graphics/OpenGLShims.cpp 2014-10-13 15:38:38.496444600 +0400 +@@ -17,7 +17,7 @@ + */ + + #include "config.h" +-#if USE(3D_GRAPHICS) || defined(QT_OPENGL_SHIMS) ++#if USE(3D_GRAPHICS) || defined(QT_OPENGL_SHIMS) || USE(EGL) || USE(GLX) + + #define DISABLE_SHIMS + #include "OpenGLShims.h" diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.8-wayland-webkit2.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.8-wayland-webkit2.patch new file mode 100644 index 0000000..fd016a5 --- /dev/null +++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.8-wayland-webkit2.patch @@ -0,0 +1,71 @@ +From ea9a80ffb659f1b65cc4ccef1f092cfbf79d6ad5 Mon Sep 17 00:00:00 2001 +From: Tomas Popela <tpopela@redhat.com> +Date: Fri, 16 Jan 2015 12:29:48 +0100 +Subject: [PATCH] 2015-01-16 Tomas Popela <tpopela@redhat.com> + + REGRESSION(r177885): [GTK][WK1] Cannot compile 2.4.8 when WK2 is disabled + https://bugs.webkit.org/show_bug.cgi?id=140241 + + Reviewed by NOBODY (OOPS!). + + We have to compile the PluginPackageNone.cpp and PluginViewNone.cpp + just when WebKit2 is enabled and we are not building for X11. + + * GNUmakefile.list.am: +--- + Source/WebCore/ChangeLog | 12 ++++++++++++ + Source/WebCore/GNUmakefile.list.am | 8 ++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog +index 587a6c3..7e91646 100644 +--- a/Source/WebCore/ChangeLog ++++ b/Source/WebCore/ChangeLog +@@ -1,3 +1,15 @@ ++2015-01-16 Tomas Popela <tpopela@redhat.com> ++ ++ REGRESSION(r177885): [GTK][WK1] Cannot compile 2.4.8 when WK2 is disabled ++ https://bugs.webkit.org/show_bug.cgi?id=140241 ++ ++ Reviewed by NOBODY (OOPS!). ++ ++ We have to compile the PluginPackageNone.cpp and PluginViewNone.cpp ++ just when WebKit2 is enabled and we are not building for X11. ++ ++ * GNUmakefile.list.am: ++ + 2014-11-10 Csaba Osztrogonác <ossy@webkit.org> + + Crash in WebCore::Node::getFlag +diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am +index 2f5cb19..22956c7 100644 +--- a/Source/WebCore/GNUmakefile.list.am ++++ b/Source/WebCore/GNUmakefile.list.am +@@ -6254,9 +6254,13 @@ endif # END USE_GLX + endif # END TARGET_X11 + + if TARGET_WAYLAND ++if !TARGET_X11 ++if ENABLE_WEBKIT2 + webcore_sources += \ + Source/WebCore/plugins/PluginPackageNone.cpp \ + Source/WebCore/plugins/PluginViewNone.cpp ++endif # END ENABLE_WEBKIT2 ++endif # END !TARGET_X11 + endif # END TARGET_WAYLAND + + if TARGET_X11_OR_WAYLAND +@@ -6305,9 +6309,13 @@ webcoregtk_sources += \ + endif # END TARGET_WIN32 + + if TARGET_QUARTZ ++if !TARGET_X11 ++if ENABLE_WEBKIT2 + webcore_sources += \ + Source/WebCore/plugins/PluginPackageNone.cpp \ + Source/WebCore/plugins/PluginViewNone.cpp ++endif # END ENABLE_WEBKIT2 ++endif # END !TARGET_X11 + platformgtk_sources += \ + Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h \ + Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp diff --git a/net-libs/webkit-gtk/metadata.xml b/net-libs/webkit-gtk/metadata.xml new file mode 100644 index 0000000..2cfd701 --- /dev/null +++ b/net-libs/webkit-gtk/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>gnome</herd> + <use> + <flag name="coverage">Enable code coverage support</flag> + <flag name='egl'>Enable EGL support.</flag> + <flag name="geoloc">Enable geolocation support through <pkg>app-misc/geoclue</pkg></flag> + <flag name='gles2'>Enable GLESv2 support.</flag> + <flag name="libsecret">Enable libsecret support to store login credentials</flag> + <flag name="rpi">Use Raspberry Pi GLES2 libraries instead of mesa (for USE=gles2 egl together with USE=webgl)</flag> + <flag name="webgl">Build support for the WebGL HTML API and use Accelerated Compositing</flag> + </use> +</pkgmetadata> diff --git a/net-libs/webkit-gtk/webkit-gtk-2.4.8.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.4.8.ebuild new file mode 100644 index 0000000..3a549dc --- /dev/null +++ b/net-libs/webkit-gtk/webkit-gtk-2.4.8.ebuild @@ -0,0 +1,330 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-libs/webkit-gtk/webkit-gtk-2.4.8.ebuild,v 1.6 2015/01/27 09:30:36 pacho Exp $ + +EAPI="5" +GCONF_DEBUG="no" +PYTHON_COMPAT=( python{2_6,2_7} ) + +inherit autotools check-reqs eutils flag-o-matic gnome2 pax-utils python-any-r1 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="3/25" # soname version of libwebkit2gtk-3.0 +KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~x86-macos" + +IUSE="aqua coverage debug +egl +geoloc gles2 +gstreamer +introspection +jit libsecret +opengl rpi spell wayland +webgl +X" +# bugs 372493, 416331 +REQUIRED_USE=" + geoloc? ( introspection ) + introspection? ( gstreamer ) + gles2? ( egl ) + rpi? ( !opengl ) + webgl? ( ^^ ( gles2 opengl ) ) + !webgl? ( ?? ( gles2 opengl ) ) + || ( aqua wayland X ) +" + +# use sqlite, svg by default +# Aqua support in gtk3 is untested +# gtk2 is needed for plugin process support +# gtk3-3.10 required for wayland +RDEPEND=" + dev-libs/libxml2:2 + dev-libs/libxslt + media-libs/harfbuzz:=[icu(+)] + media-libs/libwebp:= + virtual/jpeg:0= + >=media-libs/libpng-1.4:0= + >=x11-libs/cairo-1.10:=[X] + >=dev-libs/glib-2.36.0:2 + >=x11-libs/gtk+-3.6.0:3[aqua=,introspection?] + >=dev-libs/icu-3.8.1-r1:= + >=net-libs/libsoup-2.42.0:2.4[introspection?] + dev-db/sqlite:3= + >=x11-libs/pango-1.30.0.0 + x11-libs/libXrender + x11-libs/libXt + >=x11-libs/gtk+-2.24.10:2 + + geoloc? ( >=app-misc/geoclue-2.1.5:2.0 ) + gstreamer? ( + >=media-libs/gstreamer-1.2:1.0 + >=media-libs/gst-plugins-base-1.2:1.0 ) + introspection? ( >=dev-libs/gobject-introspection-1.32.0 ) + libsecret? ( app-crypt/libsecret ) + opengl? ( virtual/opengl ) + spell? ( >=app-text/enchant-0.22:= ) + wayland? ( >=x11-libs/gtk+-3.10:3[wayland] ) + egl? ( + !rpi? ( media-libs/mesa[egl] ) + rpi? ( media-libs/raspberrypi-userland ) + ) + gles2? ( + !rpi? ( media-libs/mesa[gles2] ) + rpi? ( media-libs/raspberrypi-userland ) + ) + webgl? ( + x11-libs/cairo[gles2=,opengl=] + x11-libs/libXcomposite + x11-libs/libXdamage ) +" + +# paxctl needed for bug #407085 +# Need real bison, not yacc +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + dev-lang/perl + || ( + virtual/rubygems[ruby_targets_ruby20] + virtual/rubygems[ruby_targets_ruby21] + virtual/rubygems[ruby_targets_ruby19] + ) + >=app-accessibility/at-spi2-core-2.5.3 + >=dev-libs/atk-2.8.0 + >=dev-util/gtk-doc-am-1.10 + dev-util/gperf + >=sys-devel/bison-2.4.3 + >=sys-devel/flex-2.5.33 + || ( >=sys-devel/gcc-4.7 >=sys-devel/clang-3.3 ) + sys-devel/gettext + >=sys-devel/make-3.82-r4 + virtual/pkgconfig + + geoloc? ( 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() { + #nvidia_check || die #463960 + + if [[ ${MERGE_TYPE} != "binary" ]] && 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.7.x or Clang >= 3.3 for C++11-specific compiler flags" + fi +} + +pkg_setup() { + #nvidia_check || die #463960 + + # Check whether any of the debugging flags is enabled + if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then + if is-flagq "-ggdb" && [[ ${WEBKIT_GTK_GGDB} != "yes" ]]; then + replace-flags -ggdb -g + ewarn "Replacing \"-ggdb\" with \"-g\" in your CFLAGS." + ewarn "Building ${PN} with \"-ggdb\" produces binaries which are too" + ewarn "large for current binutils releases (bug #432784) and has very" + ewarn "high temporary build space and memory requirements." + ewarn "If you really want to build ${PN} with \"-ggdb\", add" + ewarn "WEBKIT_GTK_GGDB=yes" + ewarn "to your make.conf file." + fi + einfo "You need to have at least 18GB of temporary build space available" + einfo "to build ${PN} with debugging CFLAGS. Note that it might still" + einfo "not be enough, as the total space requirements depend on the flags" + einfo "(-ggdb vs -g1) and enabled features." + check-reqs_pkg_setup + fi + + [[ ${MERGE_TYPE} = "binary" ]] || python-any-r1_pkg_setup +} + +src_prepare() { + # intermediate MacPorts hack while upstream bug is not fixed properly + # https://bugs.webkit.org/show_bug.cgi?id=28727 + use aqua && epatch "${FILESDIR}"/${PN}-1.6.1-darwin-quartz.patch + + # Leave optimization level to user CFLAGS + # FORTIFY_SOURCE is enabled by default in Gentoo + sed -e 's/-O[012]//g' \ + -e 's/-D_FORTIFY_SOURCE=2//g' \ + -i Source/autotools/SetupCompilerFlags.m4 || die + + # Failing tests + # * webinspector -> https://bugs.webkit.org/show_bug.cgi?id=50744 + # * keyevents is interactive + # * mimehandling test sometimes fails under Xvfb (works fine manually), bug #??? + # * webdatasource test needs a network connection and intermittently fails with icedtea-web + # * webplugindatabase intermittently fails with icedtea-web, bug #???? + sed -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebinspector/ d' \ + -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testkeyevents/ d' \ + -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testmimehandling/ d' \ + -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebdatasource/ d' \ + -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebplugindatabase/ d' \ + -i Tools/TestWebKitAPI/GNUmakefile.am || die + + # bug #459978, upstream bug #113397 + epatch "${FILESDIR}/${PN}-1.11.90-gtk-docize-fix.patch" + + # Deadlock causing infinite compilations with nvidia-drivers: + # https://bugs.gentoo.org/show_bug.cgi?id=463960 + # http://osdyson.org/issues/161 + # https://bugs.webkit.org/show_bug.cgi?id=125651 +# FIXME: it doesn't really work for us +# epatch "${FILESDIR}"/${PN}-2.2.5-gir-nvidia-hangs.patch + + # Debian patches to fix support for some arches + # https://bugs.webkit.org/show_bug.cgi?id=129540 + epatch "${FILESDIR}"/${PN}-2.2.5-{hppa,ia64}-platform.patch + # https://bugs.webkit.org/show_bug.cgi?id=129542 + epatch "${FILESDIR}"/${PN}-2.4.1-ia64-malloc.patch + + # Fix building on ppc (from OpenBSD, only needed on slot 3) + # https://bugs.webkit.org/show_bug.cgi?id=130837 + epatch "${FILESDIR}"/${PN}-2.4.4-atomic-ppc.patch + + epatch "${FILESDIR}"/${PN}-2.4.4-jpeg-9a.patch #481688 + + # Fix building with --disable-webgl, bug #500966 + # https://bugs.webkit.org/show_bug.cgi?id=131267 + epatch "${FILESDIR}"/${PN}-2.4.7-disable-webgl.patch + + # Fix building with --disable-accelerated-compositing, bug #525072 + # https://bugs.webkit.org/show_bug.cgi?id=137640 + epatch "${FILESDIR}"/${PN}-2.4.7-disable-accelerated-compositing.patch + + # Fix building with x11+wayland, bug #536898 + # https://bugs.webkit.org/show_bug.cgi?id=140241 + epatch "${FILESDIR}"/${PN}-2.4.8-wayland-webkit2.patch + + AT_M4DIR=Source/autotools eautoreconf + + 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 + + if use webgl; then + use rpi && append-cppflags $(pkg-config --cflags egl glesv2) + use rpi && append-ldflags $(pkg-config --libs egl glesv2) + fi + + # It doesn't compile on alpha without this in LDFLAGS, bug #??? + use alpha && append-ldflags "-Wl,--no-relax" + + # 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 + if ! $(tc-getLD) --version | grep -q "GNU gold"; then + append-ldflags "-Wl,--reduce-memory-overheads" + fi + + local myconf="" + + if has_version "virtual/rubygems[ruby_targets_ruby21]"; then + myconf="${myconf} RUBY=$(type -P ruby21)" + elif has_version "virtual/rubygems[ruby_targets_ruby20]"; then + myconf="${myconf} RUBY=$(type -P ruby20)" + else + myconf="${myconf} RUBY=$(type -P ruby19)" + fi + + # TODO: Check Web Audio support + # should somehow let user select between them? + # + # * Aqua support in gtk3 is untested + # * dependency-tracking is required so parallel builds won't fail + gnome2_src_configure \ + $(use_enable aqua quartz-target) \ + $(use_enable coverage) \ + $(use_enable debug) \ + $(use_enable egl) \ + $(use_enable geoloc geolocation) \ + $(use_enable gles2) \ + $(use_enable gstreamer video) \ + $(use_enable gstreamer web-audio) \ + $(use_enable introspection) \ + $(use_enable jit) \ + $(use_enable libsecret credential_storage) \ + $(use_enable opengl glx) \ + $(use_enable spell spellcheck) \ + $(use_enable webgl) \ + $(use_enable webgl accelerated-compositing) \ + $(use_enable wayland wayland-target) \ + $(use_enable X x11-target) \ + --with-gtk=3.0 \ + --enable-dependency-tracking \ + --disable-gtk-doc \ + ${myconf} +} + +src_compile() { + # Try to avoid issues like bug #463960 + unset DISPLAY + gnome2_src_compile +} + +src_test() { + # Tests expect an out-of-source build in WebKitBuild + ln -s . WebKitBuild || die "ln failed" + + # Prevents test failures on PaX systems + use jit && pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test* + + unset DISPLAY + # Tests need virtualx, bug #294691, bug #310695 + # Parallel tests sometimes fail + Xemake -j1 check +} + +src_install() { + DOCS="ChangeLog NEWS" # other ChangeLog files handled by src_install + + # https://bugs.webkit.org/show_bug.cgi?id=129242 + MAKEOPTS="${MAKEOPTS} -j1" gnome2_src_install + + newdoc Source/WebKit/gtk/ChangeLog ChangeLog.gtk + newdoc Source/JavaScriptCore/ChangeLog ChangeLog.JavaScriptCore + newdoc Source/WebCore/ChangeLog ChangeLog.WebCore + + # Prevents crashes on PaX systems, bug #522808 + use jit && pax-mark m "${ED}usr/bin/jsc-3" "${ED}usr/libexec/WebKitWebProcess" + pax-mark m "${ED}usr/libexec/WebKitPluginProcess" +} + +#nvidia_check() { +# if [[ ${MERGE_TYPE} != "binary" ]] && +# use introspection && +# has_version 'x11-drivers/nvidia-drivers' && +# [[ $(eselect opengl show 2> /dev/null) = "nvidia" ]] +# then +# eerror "${PN} freezes while compiling if x11-drivers/nvidia-drivers is" +# eerror "used as the system OpenGL library. We are very sorry about that." +# eerror "You should temporarily select Mesa as the system OpenGL library:" +# eerror " # eselect opengl set xorg-x11" +# eerror " and then run emerge again." +# eerror "See https://bugs.gentoo.org/463960 for more details." +# eerror +# return 1 +# fi +#} |