webkitgtk: add darwin support

This commit is contained in:
Ryan Trinkle 2016-03-29 12:04:46 -04:00 committed by Vladimír Čunát
parent e498a645c1
commit 8605dab964
13 changed files with 259 additions and 19 deletions

View File

@ -4,6 +4,7 @@
, xcbSupport ? true # no longer experimental since 1.12
, glSupport ? true, mesa_noglu ? null # mesa is no longer a big dependency
, pdfSupport ? true
, darwin
}:
assert glSupport -> mesa_noglu != null;
@ -11,14 +12,21 @@ assert glSupport -> mesa_noglu != null;
with { inherit (stdenv.lib) optional optionals; };
stdenv.mkDerivation rec {
name = "cairo-1.14.4";
name = "cairo-1.14.6";
src = fetchurl {
url = "http://cairographics.org/releases/${name}.tar.xz";
sha256 = "05p75r914d809711yg9rapgmmi4hymzbarhd3w0yrfadhiy9rv7n";
sha256 = "0lmjlzmghmr27y615px9hkm552x7ap6pmq9mfbzr6smp8y2b6g31";
};
nativeBuildInputs = [ pkgconfig libiconv ] ++ libintlOrEmpty;
nativeBuildInputs = [
pkgconfig
libiconv
] ++ libintlOrEmpty ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
CoreGraphics
ApplicationServices
Carbon
]);
propagatedBuildInputs =
with xorg; [ xorg.xlibsWrapper fontconfig expat freetype pixman zlib libpng ]
@ -28,11 +36,17 @@ stdenv.mkDerivation rec {
++ optionals glSupport [ mesa_noglu ]
;
configureFlags = [ "--enable-tee" ]
configureFlags = if stdenv.isDarwin then [
"--disable-dependency-tracking"
"--enable-quartz"
"--enable-quartz-font"
"--enable-quartz-image"
"--enable-ft"
] else ([ "--enable-tee" ]
++ optional xcbSupport "--enable-xcb"
++ optional glSupport "--enable-gl"
++ optional pdfSupport "--enable-pdf"
;
);
preConfigure =
# On FreeBSD, `-ldl' doesn't exist.

View File

@ -0,0 +1,26 @@
diff -ur gobject-introspection-1.46.0-orig/giscanner/ccompiler.py gobject-introspection-1.46.0/giscanner/ccompiler.py
--- gobject-introspection-1.46.0-orig/giscanner/ccompiler.py 2016-02-01 12:25:41.000000000 -0500
+++ gobject-introspection-1.46.0/giscanner/ccompiler.py 2016-02-01 15:50:36.000000000 -0500
@@ -128,11 +128,7 @@
self.compiler.add_runtime_library_dir('.')
# https://bugzilla.gnome.org/show_bug.cgi?id=625195
- args.append('-Wl,-rpath=.')
-
- # Ensure libraries are always linked as we are going to use ldd to work
- # out their names later
- args.append('-Wl,--no-as-needed')
+ args.append('-Wl,-rpath,.')
for library in libraries:
self.compiler.add_library(library)
@@ -140,7 +136,7 @@
for library_path in libpaths:
args.append('-L' + library_path)
if os.path.isabs(library_path):
- args.append('-Wl,-rpath=' + library_path)
+ args.append('-Wl,-rpath,' + library_path)
else:
# libtool case: assemble linker command arguments, like we did before
Only in gobject-introspection-1.46.0/giscanner: ccompiler.py~

View File

@ -10,6 +10,7 @@ let
ver_maj = "1.46";
ver_min = "0";
in
with stdenv.lib;
stdenv.mkDerivation rec {
name = "gobject-introspection-${ver_maj}.${ver_min}";
@ -38,6 +39,9 @@ stdenv.mkDerivation rec {
patches = stdenv.lib.singleton (substituteAll {
src = ./absolute_shlib_path.patch;
inherit nixStoreDir;
}) ++ optional stdenv.isDarwin (substituteAll {
src = ./darwin-fixups.patch;
inherit nixStoreDir;
});
meta = with stdenv.lib; {

View File

@ -0,0 +1,21 @@
diff -ur gobject-introspection-1.46.0-orig/giscanner/ccompiler.py gobject-introspection-1.46.0/giscanner/ccompiler.py
--- gobject-introspection-1.46.0-orig/giscanner/ccompiler.py 2016-02-01 12:25:41.000000000 -0500
+++ gobject-introspection-1.46.0/giscanner/ccompiler.py 2016-02-01 12:26:52.000000000 -0500
@@ -128,7 +128,7 @@
self.compiler.add_runtime_library_dir('.')
# https://bugzilla.gnome.org/show_bug.cgi?id=625195
- args.append('-Wl,-rpath=.')
+ args.append('-Wl,-rpath,.')
# Ensure libraries are always linked as we are going to use ldd to work
# out their names later
@@ -140,7 +140,7 @@
for library_path in libpaths:
args.append('-L' + library_path)
if os.path.isabs(library_path):
- args.append('-Wl,-rpath=' + library_path)
+ args.append('-Wl,-rpath,' + library_path)
else:
# libtool case: assemble linker command arguments, like we did before

View File

@ -3,11 +3,14 @@
, xlibs, x11, wayland, libxkbcommon, epoxy
, xineramaSupport ? stdenv.isLinux
, cupsSupport ? stdenv.isLinux, cups ? null
, darwin
}:
assert xineramaSupport -> xlibs.libXinerama != null;
assert cupsSupport -> cups != null;
with stdenv.lib;
let
ver_maj = "3.18";
ver_min = "5";
@ -27,6 +30,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = with xlibs; with stdenv.lib;
[ expat glib cairo pango gdk_pixbuf atk at_spi2_atk libXrandr libXrender libXcomposite libXi libXcursor ]
++ optionals stdenv.isLinux [ wayland ]
++ optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa ])
++ optional xineramaSupport libXinerama
++ optional cupsSupport cups;
@ -37,6 +41,14 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
configureFlags = optional stdenv.isDarwin [
"--disable-debug"
"--disable-dependency-tracking"
"--disable-glibtest"
"--with-gdktarget=quartz"
"--enable-quartz-backend"
];
postInstall = "rm -rf $out/share/gtk-doc";
passthru = {

View File

@ -2,6 +2,8 @@
, fontconfig, freetype, libintlOrEmpty, gobjectIntrospection
}:
with stdenv.lib;
let
ver_maj = "1.38";
ver_min = "1";
@ -29,6 +31,8 @@ stdenv.mkDerivation rec {
# .../bin/sh: line 5: 14823 Abort trap: 6 srcdir=. PANGO_RC_FILE=./pangorc ${dir}$tst
# FAIL: testiter
configureFlags = optional stdenv.isDarwin "--without-x";
postInstall = "rm -rf $out/share/gtk-doc";
meta = with stdenv.lib; {

View File

@ -4,9 +4,15 @@
, libxml2, libsoup, libsecret, libxslt, harfbuzz
, gst-plugins-base
, withGtk2 ? false
, enableIntrospection ? true
, enableIntrospection ? !stdenv.isDarwin
, enableCredentialStorage ? !stdenv.isDarwin
, readline, libedit
}:
assert stdenv.isDarwin -> !enableIntrospection;
assert stdenv.isDarwin -> !enableCredentialStorage;
with stdenv.lib;
stdenv.mkDerivation rec {
name = "webkitgtk-${version}";
version = "2.4.9";
@ -29,16 +35,32 @@ stdenv.mkDerivation rec {
prePatch = ''
patchShebangs Tools/gtk
'';
patches = [ ./webcore-svg-libxml-cflags.patch ];
patches = [
./webcore-svg-libxml-cflags.patch
] ++ optionals stdenv.isDarwin [
./impure-icucore.patch
./quartz-webcore.patch
./libc++.patch
./plugin-none.patch
];
configureFlags = with stdenv.lib; [
"--disable-geolocation"
(optionalString enableIntrospection "--enable-introspection")
] ++ stdenv.lib.optional withGtk2 [
] ++ optional withGtk2 [
"--with-gtk=2.0"
] ++ optionals (withGtk2 || stdenv.isDarwin) [
"--disable-webkit2"
] ++ optionals stdenv.isDarwin [
"--disable-x11-target"
"--enable-quartz-target"
"--disable-web-audio"
] ++ optionals (!enableCredentialStorage) [
"--disable-credential-storage"
];
NIX_CFLAGS_COMPILE = "-DU_NOEXCEPT=";
dontAddDisableDepTrack = true;
nativeBuildInputs = [
@ -47,10 +69,16 @@ stdenv.mkDerivation rec {
];
buildInputs = [
gtk2 wayland libwebp enchant
libxml2 libsecret libxslt
gtk2 libwebp enchant
libxml2 libxslt
gst-plugins-base sqlite
];
] ++ optionals enableCredentialStorage [
libsecret
] ++ (if stdenv.isDarwin then [
readline libedit
] else [
wayland
]);
propagatedBuildInputs = [
libsoup harfbuzz/*icu in *.la*/

View File

@ -0,0 +1,10 @@
--- webkitgtk-2.10.4-orig/Source/WebKit2/CMakeLists.txt 2015-11-11 02:42:51.000000000 -0500
+++ webkitgtk-2.10.4/Source/WebKit2/CMakeLists.txt 2016-01-31 18:27:49.000000000 -0500
@@ -738,6 +738,7 @@
set(WebKit2_LIBRARIES
JavaScriptCore
WebCore
+ intl
)
set(PluginProcess_LIBRARIES

View File

@ -2,11 +2,13 @@
, pkgconfig, gettext, gobjectIntrospection, libnotify
, gtk2, gtk3, wayland, libwebp, enchant
, libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs
, enableGeoLocation ? true, geoclue2, sqlite
, gst-plugins-base
, enableGeoLocation ? false, geoclue2, sqlite
, enableCredentialStorage ? !stdenv.isDarwin
, gst-plugins-base, readline, libedit
}:
assert enableGeoLocation -> geoclue2 != null;
assert stdenv.isDarwin -> !enableCredentialStorage;
with stdenv.lib;
stdenv.mkDerivation rec {
@ -29,16 +31,37 @@ stdenv.mkDerivation rec {
sha256 = "0mghsbfnmmf6nsf7cb3ah76s77aigkzf3k6kw96wgh6all6jdy6v";
};
patches = [ ./finding-harfbuzz-icu.patch
patches = [
./finding-harfbuzz-icu.patch
(fetchpatch {
name = "glibc-isnan.patch";
url = "http://trac.webkit.org/changeset/194518/trunk/Source/JavaScriptCore"
+ "/runtime/Options.cpp?format=diff&new=194518";
sha256 = "0pzdv1zmlym751n9d310cx3yp752yzsc49cysbvgnrib4dh68nbm";
})
];
] ++ optional stdenv.isDarwin ./adding-libintl.patch;
cmakeFlags = [ "-DPORT=GTK" "-DUSE_LIBHYPHEN=0" ];
cmakeFlags = [
"-DPORT=GTK"
"-DUSE_LIBHYPHEN=OFF"
] ++ optionals (!enableCredentialStorage) [
"-DENABLE_CREDENTIAL_STORAGE=OFF"
] ++ optionals (!enableGeoLocation) [
"-DENABLE_GEOLOCATION=OFF"
] ++ optionals stdenv.isDarwin [
"-DENABLE_WEBKIT=ON"
"-DENABLE_X11_TARGET=OFF"
"-DENABLE_QUARTZ_TARGET=ON"
"-DENABLE_TOOLS=ON"
"-DENABLE_MINIBROWSER=ON"
"-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
"-DENABLE_VIDEO=OFF"
"-DENABLE_WEB_AUDIO=OFF"
"-DENABLE_OPENGL=OFF"
"-DENABLE_INTROSPECTION=OFF"
"-DUSE_LIBNOTIFY=OFF"
"-DCMAKE_SHARED_LINKER_FLAGS=-L/path/to/nonexistent/folder"
];
# XXX: WebKit2 missing include path for gst-plugins-base.
# Filled: https://bugs.webkit.org/show_bug.cgi?id=148894
@ -50,10 +73,16 @@ stdenv.mkDerivation rec {
];
buildInputs = [
gtk2 wayland libwebp enchant libnotify
libxml2 libsecret libxslt harfbuzz libpthreadstubs
gtk2 libwebp enchant libnotify
libxml2 libxslt harfbuzz libpthreadstubs
gst-plugins-base
] ++ optional enableGeoLocation geoclue2;
] ++ optionals enableCredentialStorage [
libsecret
] ++ (if stdenv.isDarwin then [
readline libedit
] else [
wayland
]) ++ optional enableGeoLocation geoclue2;
propagatedBuildInputs = [
libsoup gtk3

View File

@ -0,0 +1,12 @@
diff -ru webkitgtk-2.4.9-orig/configure webkitgtk-2.4.9/configure
--- webkitgtk-2.4.9-orig/configure 2016-02-02 13:23:22.000000000 -0500
+++ webkitgtk-2.4.9/configure 2016-02-02 13:24:13.000000000 -0500
@@ -17715,7 +17715,7 @@
case "$host" in
*-*-darwin*)
UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
- UNICODE_LIBS="-licucore"
+ UNICODE_LIBS="/usr/lib/libicucore.dylib"
;;
*-*-mingw*)

View File

@ -0,0 +1,20 @@
--- webkitgtk-2.4.9-orig/GNUmakefile.in 2016-02-02 13:23:23.000000000 -0500
+++ webkitgtk-2.4.9/GNUmakefile.in 2016-02-02 22:10:23.000000000 -0500
@@ -23321,7 +23321,7 @@
$(WINMM_LIBS) \
-lm \
-lpthread \
- -lstdc++
+ -lc++
Programs_minidom_LDFLAGS = \
-no-install
@@ -23344,7 +23344,7 @@
$(WINMM_LIBS) \
-lm \
-lpthread \
- -lstdc++
+ -lc++
Programs_LLIntOffsetsExtractor_LDFLAGS = \
-no-install

View File

@ -0,0 +1,38 @@
--- webkitgtk-2.4.9-orig/GNUmakefile.in 2016-02-02 13:23:23.000000000 -0500
+++ webkitgtk-2.4.9/GNUmakefile.in 2016-02-08 00:27:10.000000000 -0500
@@ -4799,6 +4799,8 @@
Source/WebCore/plugins/PluginViewBase.h \
Source/WebCore/plugins/PluginView.cpp \
Source/WebCore/plugins/PluginView.h \
+ Source/WebCore/plugins/PluginViewNone.cpp \
+ Source/WebCore/plugins/PluginPackageNone.cpp \
Source/WebCore/plugins/npapi.h \
Source/WebCore/plugins/npfunctions.h \
Source/WebCore/plugins/npruntime.h \
@@ -6375,6 +6377,8 @@
Source/WebCore/plugins/libWebCore_la-PluginPackage.lo \
Source/WebCore/plugins/libWebCore_la-PluginStream.lo \
Source/WebCore/plugins/libWebCore_la-PluginView.lo \
+ Source/WebCore/plugins/libWebCore_la-PluginViewNone.lo \
+ Source/WebCore/plugins/libWebCore_la-PluginPackageNone.lo \
Source/WebCore/rendering/libWebCore_la-AutoTableLayout.lo \
Source/WebCore/rendering/libWebCore_la-BidiRun.lo \
Source/WebCore/rendering/libWebCore_la-break_lines.lo \
@@ -10796,6 +10800,8 @@
Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProcessConnectionManager.lo \
Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProxy.lo \
Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginView.lo \
+ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginViewNone.lo \
+ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginPackageNone.lo \
Source/WebKit2/WebProcess/ResourceCache/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-WebResourceCacheManager.lo \
Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaImpl.lo \
Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaMap.lo \
@@ -19503,6 +19509,8 @@
Source/WebCore/plugins/PluginViewBase.h \
Source/WebCore/plugins/PluginView.cpp \
Source/WebCore/plugins/PluginView.h \
+ Source/WebCore/plugins/PluginViewNone.cpp \
+ Source/WebCore/plugins/PluginPackageNone.cpp \
Source/WebCore/plugins/npapi.h \
Source/WebCore/plugins/npfunctions.h \
Source/WebCore/plugins/npruntime.h \

View File

@ -0,0 +1,22 @@
--- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.cpp 2016-02-02 13:23:23.000000000 -0500
+++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.cpp 2016-02-02 18:28:07.000000000 -0500
@@ -839,7 +839,7 @@
#if defined(XP_MACOSX)
, m_contextRef(0)
#endif
-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+#if defined(X11) && ENABLE(NETSCAPE_PLUGIN_API)
, m_hasPendingGeometryChange(true)
, m_drawable(0)
, m_visual(0)
--- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.h 2016-02-02 13:23:23.000000000 -0500
+++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.h 2016-02-02 18:26:37.000000000 -0500
@@ -378,7 +378,7 @@
void setNPWindowIfNeeded();
#endif
-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+#if PLATFORM(X11) && ENABLE(NETSCAPE_PLUGIN_API)
bool m_hasPendingGeometryChange;
Pixmap m_drawable;
Visual* m_visual;