Skip to content

Commit

Permalink
WIP WebKit2
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomato committed Jan 22, 2015
1 parent a856137 commit e212119
Show file tree
Hide file tree
Showing 13 changed files with 607 additions and 0 deletions.
35 changes: 35 additions & 0 deletions modulesets-stable/gtk-osx-unsupported.modules
Expand Up @@ -226,4 +226,39 @@
<dep package="meta-gstreamer-1.0"/>
</after>
</autotools>

<cmake id="webkit2gtk3"
cmakeargs="-DPORT=GTK -DENABLE_X11_TARGET=OFF -DENABLE_QUARTZ_TARGET=ON -DENABLE_PLUGIN_PROCESS_GTK2=OFF -DENABLE_VIDEO=OFF -DENABLE_WEB_AUDIO=OFF -DENABLE_CREDENTIAL_STORAGE=OFF -DCMAKE_CXX_FLAGS='-stdlib=libc++'">
<branch repo="webkit.org" module="webkitgtk-2.6.5.tar.xz" version="2.6.5">
<patch file="webkit-2.6-quartz-backend.patch"
strip="1"/>
<patch file="webkit-2.6-platform-fixes.patch"
strip="1"/>
<patch file="webkit-127059-link-libedit.patch"
strip="1"/>
<patch file="webkit-2.6-link-injected-bundle.patch"
strip="1"/>
<patch file="webkit-2.6-darwin-physical-memory-size.patch"
strip="1"/>
<patch file="webkit-2.6-disable-version-script.patch"
strip="1"/>
<patch file="webkit-2.6-disable-whole-archive.patch"
strip="1"/>
<patch file="webkit-138332-fix-opengl-link.patch"
strip="1"/>
<patch file="webkit-2.6-workaround-gir-scanner.patch"
strip="1"/>
</branch>
<dependencies>
<dep package="libwebp"/>
<dep package="enchant"/>
<dep package="icu"/>
<dep package="libsoup"/>
<dep package="meta-gtk-osx-freetype"/>
</dependencies>
<after>
<dep package="meta-gtk-osx-gtk3"/>
<dep package="meta-gstreamer-1.0"/>
</after>
</cmake>
</moduleset>
2 changes: 2 additions & 0 deletions modulesets-stable/gtk-osx.modules
Expand Up @@ -107,6 +107,8 @@
version="1.42.0"
hash="sha256:3ba2edfad4f71d4f0de16960b5d5f2511335fa646b2c49bbb93ce5942b3f95f7">
<patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/girscanner-objc.patch" strip="1"/>
<patch file="gobject-introspection-625195-Fix-non-libtool-linker-flags-on-Darwin.patch"
strip="1"/>
</branch>
<dependencies>
<dep package="glib"/>
Expand Down
@@ -0,0 +1,48 @@
From 296a5e0f79b37a3e37b75e935350519b42a5da43 Mon Sep 17 00:00:00 2001
From: Philip Chimento <philip.chimento@gmail.com>
Date: Sun, 18 Jan 2015 13:32:54 -0800
Subject: [PATCH] Fix non-libtool linker flags on Darwin

Darwin's linker doesn't like "-rpath=path"; instead pass "-rpath path".
Additionally, there is no equivalent for "--no-as-needed" (it seems to do
the right thing by default?)

https://bugzilla.gnome.org/show_bug.cgi?id=625195
---
giscanner/ccompiler.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 1c66aac..d42aa93 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -68,12 +68,15 @@ class CCompiler(object):
ns_version + '.lib')
else:
args.append(str.lower(ns) + '.lib')
+ elif sys.platform == 'darwin':
+ args.append('-Wl,-rpath')
+ args.append('-Wl,.')
else:
args.append('-Wl,-rpath=.')

# Ensure libraries are always linked as we are going to use ldd to work
# out their names later
- if not libtool and pkgconfig_msvc_flags == '':
+ if not libtool and pkgconfig_msvc_flags == '' and not sys.platform == 'darwin':
args.append('-Wl,--no-as-needed')

for library in libraries:
@@ -95,6 +98,9 @@ class CCompiler(object):
if libtool:
args.append('-rpath')
args.append(library_path)
+ elif sys.platform == 'darwin':
+ args.append('-Wl,-rpath')
+ args.append('-Wl,' + library_path)
else:
args.append('-Wl,-rpath=' + library_path)

--
1.9.3 (Apple Git-50)

13 changes: 13 additions & 0 deletions patches/patch status
Expand Up @@ -11,6 +11,9 @@ gobject-intro: 0001-scanner-split-CC-environment-variable.patch fixed, not
released in stable.
girscanner-objc.patch: Bug 626995, will likely never be
committed.
gobject-introspection-625195-Fix-non-libtool-linker-flags-on-Darwin.patch:
https://bugzilla.gnome.org/show_bug.cgi?id=625195, required only
for --no-libtool, i.e. webkit2gtk3.

gtk2: 0004-Bug-571582-GtkSelection-implementation-for-quartz.patch
0006-Bug-658722-Drag-and-Drop-sometimes-stops-working.patch
Expand Down Expand Up @@ -50,6 +53,16 @@ webkit1gtk: webkit-126324-clang-check.patch
webkit-126433-check-platform-gtk.patch
https://bugs.webkit.org/show_bug.cgi?id=126433

webkit2gtk: webkit-2.6-quartz-backend.patch
webkit-2.6-platform-fixes.patch
webkit-127059-link-libedit-cmake.patch
webkit-2.6-link-injected-bundle.patch
webkit-2.6-darwin-physical-memory-size.patch
webkit-2.6-disable-version-script.patch
webkit-2.6-disable-whole-archive.patch
webkit-138332-fix-opengl-link.patch
webkit-2.6-workaround-gir-scanner.patch

GConf: GConf-characters.patch Bug 161209. Unlikely ever to be fixed.

Glade: Glade-3-8-Bug-663492-Update-Mac-integration-bindings-to-.patch
Expand Down
13 changes: 13 additions & 0 deletions patches/webkit-127059-link-libedit.patch
@@ -0,0 +1,13 @@
--- a/Source/JavaScriptCore/shell/CMakeLists.txt 2014-12-31 13:24:53.000000000 -0700
+++ b/Source/JavaScriptCore/shell/CMakeLists.txt 2014-12-31 13:24:56.000000000 -0700
@@ -8,6 +8,10 @@
WTF
)

+if (WTF_OS_MAC_OS_X)
+ list(APPEND JSC_LIBRARIES edit)
+endif ()
+
if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
add_definitions(-DSTATICALLY_LINKED_WITH_JavaScriptCore)
endif ()
64 changes: 64 additions & 0 deletions patches/webkit-138332-fix-opengl-link.patch
@@ -0,0 +1,64 @@
--- a/Source/WebCore/PlatformGTK.cmake
+++ a/Source/WebCore/PlatformGTK.cmake
@@ -22,6 +22,8 @@
"${WEBCORE_DIR}/platform/network/soup"
"${WEBCORE_DIR}/platform/text/gtk"
"${WEBCORE_DIR}/platform/text/icu"
+ "${CMAKE_SOURCE_DIR}/Source/ThirdParty/ANGLE/include/GLSLANG"
+ "${CMAKE_SOURCE_DIR}/Source/ThirdParty/ANGLE/include/KHR"
)

list(APPEND WebCore_SOURCES
@@ -213,6 +215,8 @@
platform/graphics/gtk/ImageBufferGtk.cpp
platform/graphics/gtk/ImageGtk.cpp

+ platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
+
platform/gtk/ContextMenuGtk.cpp
platform/gtk/ContextMenuItemGtk.cpp
platform/gtk/CursorGtk.cpp
@@ -374,7 +378,6 @@
"${WEBCORE_DIR}/platform/graphics/texmap"
)
list(APPEND WebCore_SOURCES
- platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
platform/graphics/texmap/TextureMapperGL.cpp
platform/graphics/texmap/TextureMapperShaderProgram.cpp
)
--- a/Source/cmake/OptionsGTK.cmake
+++ a/Source/cmake/OptionsGTK.cmake
@@ -55,6 +55,7 @@ if (NOT GEOCLUE2_FOUND)
endif ()

if (ENABLE_X11_TARGET)
+ find_package(X11)
# We don't use find_package for GLX because it is part of -lGL, unlike EGL.
check_include_files("GL/glx.h" GLX_FOUND)
endif ()
@@ -78,6 +79,9 @@ if (OPENGL_FOUND AND (GLX_FOUND OR EGL_FOUND))
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS OFF)
endif ()
else ()
+ if (ENABLE_WEBGL)
+ message(FATAL_ERROR "OpenGL is needed for WebGL support")
+ endif ()
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS OFF)
endif ()
@@ -294,13 +298,14 @@ if (ENABLE_SPELLCHECK)
find_package(Enchant REQUIRED)
endif ()

+add_definitions(-DWTF_USE_TEXTURE_MAPPER=1)
+
if (OPENGL_FOUND AND (GLX_FOUND OR EGL_FOUND))
set(ENABLE_TEXTURE_MAPPER 1)
set(WTF_USE_3D_GRAPHICS 1)

add_definitions(-DWTF_USE_OPENGL=1)
add_definitions(-DWTF_USE_3D_GRAPHICS=1)
- add_definitions(-DWTF_USE_TEXTURE_MAPPER=1)
add_definitions(-DWTF_USE_TEXTURE_MAPPER_GL=1)
add_definitions(-DENABLE_3D_RENDERING=1)

58 changes: 58 additions & 0 deletions patches/webkit-2.6-darwin-physical-memory-size.patch
@@ -0,0 +1,58 @@
--- a/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp 2015-01-01 00:58:29.000000000 -0700
+++ b/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp 2015-01-01 01:36:54.000000000 -0700
@@ -40,6 +40,10 @@
#include <wtf/gobject/GRefPtr.h>
#include <wtf/gobject/GUniquePtr.h>

+#if OS(DARWIN)
+#include <sys/sysctl.h>
+#endif
+
using namespace WebCore;

namespace WebKit {
@@ -59,7 +63,14 @@
static uint64_t getMemorySize()
{
static uint64_t kDefaultMemorySize = 512;
-#if !OS(WINDOWS)
+#if OS(DARWIN)
+ int64_t memSize;
+ size_t len = sizeof(memSize);
+ int success = sysctlbyname("hw.memsize", &memSize, &len, NULL, 0);
+ if (success == -1)
+ return kDefaultMemorySize;
+ return memSize / 1024;
+#elif !OS(WINDOWS)
long pageSize = sysconf(_SC_PAGESIZE);
if (pageSize == -1)
return kDefaultMemorySize;
--- a/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp 2015-01-01 02:26:40.000000000 -0700
+++ b/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp 2015-01-01 02:27:30.000000000 -0700
@@ -31,6 +31,10 @@
#include "SeccompFiltersWebProcessEfl.h"
#endif

+#if OS(DARWIN)
+#include <sys/sysctl.h>
+#endif
+
#include "CertificateInfo.h"
#include "WebCookieManager.h"
#include "WebProcessCreationParameters.h"
@@ -65,7 +69,14 @@
static uint64_t getMemorySize()
{
static uint64_t kDefaultMemorySize = 512;
-#if !OS(WINDOWS)
+#if OS(DARWIN)
+ int64_t memSize;
+ size_t len = sizeof(memSize);
+ int success = sysctlbyname("hw.memsize", &memSize, &len, NULL, 0);
+ if (success == -1)
+ return kDefaultMemorySize;
+ return memSize / 1024LL;
+#elif !OS(WINDOWS)
long pageSize = sysconf(_SC_PAGESIZE);
if (pageSize == -1)
return kDefaultMemorySize;
13 changes: 13 additions & 0 deletions patches/webkit-2.6-disable-version-script.patch
@@ -0,0 +1,13 @@
--- a/Source/cmake/OptionsGTK.cmake 2015-01-01 02:35:46.000000000 -0700
+++ b/Source/cmake/OptionsGTK.cmake 2015-01-01 02:36:04.000000000 -0700
@@ -94,7 +94,9 @@
else ()
set(ENABLE_TOOLS OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS OFF)
- set(WebKit2_VERSION_SCRIPT "-Wl,--version-script,${CMAKE_MODULE_PATH}/gtksymbols.filter")
+ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+ set(WebKit2_VERSION_SCRIPT "-Wl,--version-script,${CMAKE_MODULE_PATH}/gtksymbols.filter")
+ endif ()
endif ()

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
13 changes: 13 additions & 0 deletions patches/webkit-2.6-disable-whole-archive.patch
@@ -0,0 +1,13 @@
--- a/Source/WebKit2/PlatformGTK.cmake 2015-01-01 02:49:53.000000000 -0700
+++ b/Source/WebKit2/PlatformGTK.cmake 2015-01-01 02:49:56.000000000 -0700
@@ -472,7 +472,9 @@
WebCorePlatformGTK
${GTK_UNIX_PRINT_LIBRARIES}
)
-ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
+if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+ ADD_WHOLE_ARCHIVE_TO_LIBRARIES(WebKit2_LIBRARIES)
+endif ()

set(WebKit2_MARSHAL_LIST ${WEBKIT2_DIR}/UIProcess/API/gtk/webkit2marshal.list)
add_custom_command(
10 changes: 10 additions & 0 deletions patches/webkit-2.6-link-injected-bundle.patch
@@ -0,0 +1,10 @@
--- a/Source/WebKit2/PlatformGTK.cmake 2014-12-31 16:43:32.000000000 -0700
+++ b/Source/WebKit2/PlatformGTK.cmake 2014-12-31 16:44:33.000000000 -0700
@@ -720,6 +720,7 @@
add_library(webkit2gtkinjectedbundle MODULE "${WEBKIT2_DIR}/WebProcess/gtk/WebGtkInjectedBundleMain.cpp")
add_dependencies(webkit2gtkinjectedbundle GObjectDOMBindings)
add_webkit2_prefix_header(webkit2gtkinjectedbundle)
+target_link_libraries(webkit2gtkinjectedbundle WebKit2)

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir

0 comments on commit e212119

Please sign in to comment.