git.iko.soy/typeable/nixpkgs
on master help sign in
webkitgtk: add darwin support
commit8605dab96431d5a790e99a3f5f86ab2625747c10 authorRyan Trinkle <ryan.trinkle@gmail.com> dateTue 29 Mar 2016, 12:04 (11 years ago) parente498a64
13 files changed+259−19
pkgs/development/libraries/cairo/default.nix+19−5 pkgs/development/libraries/gobject-introspection/darwin-fixups.patch+26 pkgs/development/libraries/gobject-introspection/default.nix+4 pkgs/development/libraries/gobject-introspection/separate-rpath-arg.patch+21 pkgs/development/libraries/gtk+/3.x.nix+12 pkgs/development/libraries/pango/default.nix+4 pkgs/development/libraries/webkitgtk/2.4.nix+34−6 pkgs/development/libraries/webkitgtk/adding-libintl.patch+10 pkgs/development/libraries/webkitgtk/default.nix+37−8 pkgs/development/libraries/webkitgtk/impure-icucore.patch+12 pkgs/development/libraries/webkitgtk/libc++.patch+20 pkgs/development/libraries/webkitgtk/plugin-none.patch+38 pkgs/development/libraries/webkitgtk/quartz-webcore.patch+22
pkgs/development/libraries/cairo/default.nix+19−5
@@ -4,6 +4,7 @@
44, xcbSupport ? true # no longer experimental since 1.12
55, glSupport ? true, mesa_noglu ? null # mesa is no longer a big dependency
66, pdfSupport ? true
7+, darwin
78}:
89
910assert glSupport -> mesa_noglu != null;
@@ -11,14 +12,21 @@ assert glSupport -> mesa_noglu != null;
1112with { inherit (stdenv.lib) optional optionals; };
1213
1314stdenv.mkDerivation rec {
14− name = "cairo-1.14.4";
15+ name = "cairo-1.14.6";
1516
1617 src = fetchurl {
1718 url = "http://cairographics.org/releases/${name}.tar.xz";
18− sha256 = "05p75r914d809711yg9rapgmmi4hymzbarhd3w0yrfadhiy9rv7n";
19+ sha256 = "0lmjlzmghmr27y615px9hkm552x7ap6pmq9mfbzr6smp8y2b6g31";
1920 };
2021
21− nativeBuildInputs = [ pkgconfig libiconv ] ++ libintlOrEmpty;
22+ nativeBuildInputs = [
23+ pkgconfig
24+ libiconv
25+ ] ++ libintlOrEmpty ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
26+ CoreGraphics
27+ ApplicationServices
28+ Carbon
29+ ]);
2230
2331 propagatedBuildInputs =
2432 with xorg; [ xorg.xlibsWrapper fontconfig expat freetype pixman zlib libpng ]
@@ -28,11 +36,17 @@ stdenv.mkDerivation rec {
2836 ++ optionals glSupport [ mesa_noglu ]
2937 ;
3038
31− configureFlags = [ "--enable-tee" ]
39+ configureFlags = if stdenv.isDarwin then [
40+ "--disable-dependency-tracking"
41+ "--enable-quartz"
42+ "--enable-quartz-font"
43+ "--enable-quartz-image"
44+ "--enable-ft"
45+ ] else ([ "--enable-tee" ]
3246 ++ optional xcbSupport "--enable-xcb"
3347 ++ optional glSupport "--enable-gl"
3448 ++ optional pdfSupport "--enable-pdf"
35− ;
49+ );
3650
3751 preConfigure =
3852 # On FreeBSD, `-ldl' doesn't exist.
pkgs/development/libraries/gobject-introspection/darwin-fixups.patchnew file+26
@@ -0,0 +1,26 @@
1+diff -ur gobject-introspection-1.46.0-orig/giscanner/ccompiler.py gobject-introspection-1.46.0/giscanner/ccompiler.py
2+--- gobject-introspection-1.46.0-orig/giscanner/ccompiler.py 2016-02-01 12:25:41.000000000 -0500
3++++ gobject-introspection-1.46.0/giscanner/ccompiler.py 2016-02-01 15:50:36.000000000 -0500
4+@@ -128,11 +128,7 @@
5+ self.compiler.add_runtime_library_dir('.')
6+
7+ # https://bugzilla.gnome.org/show_bug.cgi?id=625195
8+- args.append('-Wl,-rpath=.')
9+-
10+- # Ensure libraries are always linked as we are going to use ldd to work
11+- # out their names later
12+- args.append('-Wl,--no-as-needed')
13++ args.append('-Wl,-rpath,.')
14+
15+ for library in libraries:
16+ self.compiler.add_library(library)
17+@@ -140,7 +136,7 @@
18+ for library_path in libpaths:
19+ args.append('-L' + library_path)
20+ if os.path.isabs(library_path):
21+- args.append('-Wl,-rpath=' + library_path)
22++ args.append('-Wl,-rpath,' + library_path)
23+
24+ else:
25+ # libtool case: assemble linker command arguments, like we did before
26+Only in gobject-introspection-1.46.0/giscanner: ccompiler.py~
pkgs/development/libraries/gobject-introspection/default.nix+4
@@ -10,6 +10,7 @@ let
1010 ver_maj = "1.46";
1111 ver_min = "0";
1212in
13+with stdenv.lib;
1314stdenv.mkDerivation rec {
1415 name = "gobject-introspection-${ver_maj}.${ver_min}";
1516
@@ -38,6 +39,9 @@ stdenv.mkDerivation rec {
3839 patches = stdenv.lib.singleton (substituteAll {
3940 src = ./absolute_shlib_path.patch;
4041 inherit nixStoreDir;
42+ }) ++ optional stdenv.isDarwin (substituteAll {
43+ src = ./darwin-fixups.patch;
44+ inherit nixStoreDir;
4145 });
4246
4347 meta = with stdenv.lib; {
pkgs/development/libraries/gobject-introspection/separate-rpath-arg.patchnew file+21
@@ -0,0 +1,21 @@
1+diff -ur gobject-introspection-1.46.0-orig/giscanner/ccompiler.py gobject-introspection-1.46.0/giscanner/ccompiler.py
2+--- gobject-introspection-1.46.0-orig/giscanner/ccompiler.py 2016-02-01 12:25:41.000000000 -0500
3++++ gobject-introspection-1.46.0/giscanner/ccompiler.py 2016-02-01 12:26:52.000000000 -0500
4+@@ -128,7 +128,7 @@
5+ self.compiler.add_runtime_library_dir('.')
6+
7+ # https://bugzilla.gnome.org/show_bug.cgi?id=625195
8+- args.append('-Wl,-rpath=.')
9++ args.append('-Wl,-rpath,.')
10+
11+ # Ensure libraries are always linked as we are going to use ldd to work
12+ # out their names later
13+@@ -140,7 +140,7 @@
14+ for library_path in libpaths:
15+ args.append('-L' + library_path)
16+ if os.path.isabs(library_path):
17+- args.append('-Wl,-rpath=' + library_path)
18++ args.append('-Wl,-rpath,' + library_path)
19+
20+ else:
21+ # libtool case: assemble linker command arguments, like we did before
pkgs/development/libraries/gtk+/3.x.nix+12
@@ -3,11 +3,14 @@
33, xlibs, x11, wayland, libxkbcommon, epoxy
44, xineramaSupport ? stdenv.isLinux
55, cupsSupport ? stdenv.isLinux, cups ? null
6+, darwin
67}:
78
89assert xineramaSupport -> xlibs.libXinerama != null;
910assert cupsSupport -> cups != null;
1011
12+with stdenv.lib;
13+
1114let
1215 ver_maj = "3.18";
1316 ver_min = "5";
@@ -27,6 +30,7 @@ stdenv.mkDerivation rec {
2730 propagatedBuildInputs = with xlibs; with stdenv.lib;
2831 [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk libXrandr libXrender libXcomposite libXi libXcursor ]
2932 ++ optionals stdenv.isLinux [ wayland ]
33+ ++ optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa ])
3034 ++ optional xineramaSupport libXinerama
3135 ++ optional cupsSupport cups;
3236
@@ -37,6 +41,14 @@ stdenv.mkDerivation rec {
3741
3842 enableParallelBuilding = true;
3943
44+ configureFlags = optional stdenv.isDarwin [
45+ "--disable-debug"
46+ "--disable-dependency-tracking"
47+ "--disable-glibtest"
48+ "--with-gdktarget=quartz"
49+ "--enable-quartz-backend"
50+ ];
51+
4052 postInstall = "rm -rf $out/share/gtk-doc";
4153
4254 passthru = {
pkgs/development/libraries/pango/default.nix+4
@@ -2,6 +2,8 @@
22, fontconfig, freetype, libintlOrEmpty, gobjectIntrospection
33}:
44
5+with stdenv.lib;
6+
57let
68 ver_maj = "1.38";
79 ver_min = "1";
@@ -29,6 +31,8 @@ stdenv.mkDerivation rec {
2931 # .../bin/sh: line 5: 14823 Abort trap: 6 srcdir=. PANGO_RC_FILE=./pangorc ${dir}$tst
3032 # FAIL: testiter
3133
34+ configureFlags = optional stdenv.isDarwin "--without-x";
35+
3236 postInstall = "rm -rf $out/share/gtk-doc";
3337
3438 meta = with stdenv.lib; {
pkgs/development/libraries/webkitgtk/2.4.nix+34−6
@@ -4,9 +4,15 @@
44, libxml2, libsoup, libsecret, libxslt, harfbuzz
55, gst-plugins-base
66, withGtk2 ? false
7−, enableIntrospection ? true
7+, enableIntrospection ? !stdenv.isDarwin
8+, enableCredentialStorage ? !stdenv.isDarwin
9+, readline, libedit
810}:
911
12+assert stdenv.isDarwin -> !enableIntrospection;
13+assert stdenv.isDarwin -> !enableCredentialStorage;
14+
15+with stdenv.lib;
1016stdenv.mkDerivation rec {
1117 name = "webkitgtk-${version}";
1218 version = "2.4.9";
@@ -29,16 +35,32 @@ stdenv.mkDerivation rec {
2935 prePatch = ''
3036 patchShebangs Tools/gtk
3137 '';
32− patches = [ ./webcore-svg-libxml-cflags.patch ];
38+ patches = [
39+ ./webcore-svg-libxml-cflags.patch
40+ ] ++ optionals stdenv.isDarwin [
41+ ./impure-icucore.patch
42+ ./quartz-webcore.patch
43+ ./libc++.patch
44+ ./plugin-none.patch
45+ ];
3346
3447 configureFlags = with stdenv.lib; [
3548 "--disable-geolocation"
3649 (optionalString enableIntrospection "--enable-introspection")
37− ] ++ stdenv.lib.optional withGtk2 [
50+ ] ++ optional withGtk2 [
3851 "--with-gtk=2.0"
52+ ] ++ optionals (withGtk2 || stdenv.isDarwin) [
3953 "--disable-webkit2"
54+ ] ++ optionals stdenv.isDarwin [
55+ "--disable-x11-target"
56+ "--enable-quartz-target"
57+ "--disable-web-audio"
58+ ] ++ optionals (!enableCredentialStorage) [
59+ "--disable-credential-storage"
4060 ];
4161
62+ NIX_CFLAGS_COMPILE = "-DU_NOEXCEPT=";
63+
4264 dontAddDisableDepTrack = true;
4365
4466 nativeBuildInputs = [
@@ -47,10 +69,16 @@ stdenv.mkDerivation rec {
4769 ];
4870
4971 buildInputs = [
50− gtk2 wayland libwebp enchant
51− libxml2 libsecret libxslt
72+ gtk2 libwebp enchant
73+ libxml2 libxslt
5274 gst-plugins-base sqlite
53− ];
75+ ] ++ optionals enableCredentialStorage [
76+ libsecret
77+ ] ++ (if stdenv.isDarwin then [
78+ readline libedit
79+ ] else [
80+ wayland
81+ ]);
5482
5583 propagatedBuildInputs = [
5684 libsoup harfbuzz/*icu in *.la*/
pkgs/development/libraries/webkitgtk/adding-libintl.patchnew file+10
@@ -0,0 +1,10 @@
1+--- webkitgtk-2.10.4-orig/Source/WebKit2/CMakeLists.txt 2015-11-11 02:42:51.000000000 -0500
2++++ webkitgtk-2.10.4/Source/WebKit2/CMakeLists.txt 2016-01-31 18:27:49.000000000 -0500
3+@@ -738,6 +738,7 @@
4+ set(WebKit2_LIBRARIES
5+ JavaScriptCore
6+ WebCore
7++ intl
8+ )
9+
10+ set(PluginProcess_LIBRARIES
pkgs/development/libraries/webkitgtk/default.nix+37−8
@@ -2,11 +2,13 @@
22, pkgconfig, gettext, gobjectIntrospection, libnotify
33, gtk2, gtk3, wayland, libwebp, enchant
44, libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs
5−, enableGeoLocation ? true, geoclue2, sqlite
6−, gst-plugins-base
5+, enableGeoLocation ? false, geoclue2, sqlite
6+, enableCredentialStorage ? !stdenv.isDarwin
7+, gst-plugins-base, readline, libedit
78}:
89
910assert enableGeoLocation -> geoclue2 != null;
11+assert stdenv.isDarwin -> !enableCredentialStorage;
1012
1113with stdenv.lib;
1214stdenv.mkDerivation rec {
@@ -29,16 +31,37 @@ stdenv.mkDerivation rec {
2931 sha256 = "0mghsbfnmmf6nsf7cb3ah76s77aigkzf3k6kw96wgh6all6jdy6v";
3032 };
3133
32− patches = [ ./finding-harfbuzz-icu.patch
34+ patches = [
35+ ./finding-harfbuzz-icu.patch
3336 (fetchpatch {
3437 name = "glibc-isnan.patch";
3538 url = "http://trac.webkit.org/changeset/194518/trunk/Source/JavaScriptCore"
3639 + "/runtime/Options.cpp?format=diff&new=194518";
3740 sha256 = "0pzdv1zmlym751n9d310cx3yp752yzsc49cysbvgnrib4dh68nbm";
3841 })
39− ];
42+ ] ++ optional stdenv.isDarwin ./adding-libintl.patch;
4043
41− cmakeFlags = [ "-DPORT=GTK" "-DUSE_LIBHYPHEN=0" ];
44+ cmakeFlags = [
45+ "-DPORT=GTK"
46+ "-DUSE_LIBHYPHEN=OFF"
47+ ] ++ optionals (!enableCredentialStorage) [
48+ "-DENABLE_CREDENTIAL_STORAGE=OFF"
49+ ] ++ optionals (!enableGeoLocation) [
50+ "-DENABLE_GEOLOCATION=OFF"
51+ ] ++ optionals stdenv.isDarwin [
52+ "-DENABLE_WEBKIT=ON"
53+ "-DENABLE_X11_TARGET=OFF"
54+ "-DENABLE_QUARTZ_TARGET=ON"
55+ "-DENABLE_TOOLS=ON"
56+ "-DENABLE_MINIBROWSER=ON"
57+ "-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
58+ "-DENABLE_VIDEO=OFF"
59+ "-DENABLE_WEB_AUDIO=OFF"
60+ "-DENABLE_OPENGL=OFF"
61+ "-DENABLE_INTROSPECTION=OFF"
62+ "-DUSE_LIBNOTIFY=OFF"
63+ "-DCMAKE_SHARED_LINKER_FLAGS=-L/path/to/nonexistent/folder"
64+ ];
4265
4366 # XXX: WebKit2 missing include path for gst-plugins-base.
4467 # Filled: https://bugs.webkit.org/show_bug.cgi?id=148894
@@ -50,10 +73,16 @@ stdenv.mkDerivation rec {
5073 ];
5174
5275 buildInputs = [
53− gtk2 wayland libwebp enchant libnotify
54− libxml2 libsecret libxslt harfbuzz libpthreadstubs
76+ gtk2 libwebp enchant libnotify
77+ libxml2 libxslt harfbuzz libpthreadstubs
5578 gst-plugins-base
56− ] ++ optional enableGeoLocation geoclue2;
79+ ] ++ optionals enableCredentialStorage [
80+ libsecret
81+ ] ++ (if stdenv.isDarwin then [
82+ readline libedit
83+ ] else [
84+ wayland
85+ ]) ++ optional enableGeoLocation geoclue2;
5786
5887 propagatedBuildInputs = [
5988 libsoup gtk3
pkgs/development/libraries/webkitgtk/impure-icucore.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ru webkitgtk-2.4.9-orig/configure webkitgtk-2.4.9/configure
2+--- webkitgtk-2.4.9-orig/configure 2016-02-02 13:23:22.000000000 -0500
3++++ webkitgtk-2.4.9/configure 2016-02-02 13:24:13.000000000 -0500
4+@@ -17715,7 +17715,7 @@
5+ case "$host" in
6+ *-*-darwin*)
7+ UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
8+- UNICODE_LIBS="-licucore"
9++ UNICODE_LIBS="/usr/lib/libicucore.dylib"
10+ ;;
11+ *-*-mingw*)
12+
pkgs/development/libraries/webkitgtk/libc++.patchnew file+20
@@ -0,0 +1,20 @@
1+--- webkitgtk-2.4.9-orig/GNUmakefile.in 2016-02-02 13:23:23.000000000 -0500
2++++ webkitgtk-2.4.9/GNUmakefile.in 2016-02-02 22:10:23.000000000 -0500
3+@@ -23321,7 +23321,7 @@
4+ $(WINMM_LIBS) \
5+ -lm \
6+ -lpthread \
7+- -lstdc++
8++ -lc++
9+
10+ Programs_minidom_LDFLAGS = \
11+ -no-install
12+@@ -23344,7 +23344,7 @@
13+ $(WINMM_LIBS) \
14+ -lm \
15+ -lpthread \
16+- -lstdc++
17++ -lc++
18+
19+ Programs_LLIntOffsetsExtractor_LDFLAGS = \
20+ -no-install
pkgs/development/libraries/webkitgtk/plugin-none.patchnew file+38
@@ -0,0 +1,38 @@
1+--- webkitgtk-2.4.9-orig/GNUmakefile.in 2016-02-02 13:23:23.000000000 -0500
2++++ webkitgtk-2.4.9/GNUmakefile.in 2016-02-08 00:27:10.000000000 -0500
3+@@ -4799,6 +4799,8 @@
4+ Source/WebCore/plugins/PluginViewBase.h \
5+ Source/WebCore/plugins/PluginView.cpp \
6+ Source/WebCore/plugins/PluginView.h \
7++ Source/WebCore/plugins/PluginViewNone.cpp \
8++ Source/WebCore/plugins/PluginPackageNone.cpp \
9+ Source/WebCore/plugins/npapi.h \
10+ Source/WebCore/plugins/npfunctions.h \
11+ Source/WebCore/plugins/npruntime.h \
12+@@ -6375,6 +6377,8 @@
13+ Source/WebCore/plugins/libWebCore_la-PluginPackage.lo \
14+ Source/WebCore/plugins/libWebCore_la-PluginStream.lo \
15+ Source/WebCore/plugins/libWebCore_la-PluginView.lo \
16++ Source/WebCore/plugins/libWebCore_la-PluginViewNone.lo \
17++ Source/WebCore/plugins/libWebCore_la-PluginPackageNone.lo \
18+ Source/WebCore/rendering/libWebCore_la-AutoTableLayout.lo \
19+ Source/WebCore/rendering/libWebCore_la-BidiRun.lo \
20+ Source/WebCore/rendering/libWebCore_la-break_lines.lo \
21+@@ -10796,6 +10800,8 @@
22+ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProcessConnectionManager.lo \
23+ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProxy.lo \
24+ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginView.lo \
25++ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginViewNone.lo \
26++ Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginPackageNone.lo \
27+ Source/WebKit2/WebProcess/ResourceCache/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-WebResourceCacheManager.lo \
28+ Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaImpl.lo \
29+ Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaMap.lo \
30+@@ -19503,6 +19509,8 @@
31+ Source/WebCore/plugins/PluginViewBase.h \
32+ Source/WebCore/plugins/PluginView.cpp \
33+ Source/WebCore/plugins/PluginView.h \
34++ Source/WebCore/plugins/PluginViewNone.cpp \
35++ Source/WebCore/plugins/PluginPackageNone.cpp \
36+ Source/WebCore/plugins/npapi.h \
37+ Source/WebCore/plugins/npfunctions.h \
38+ Source/WebCore/plugins/npruntime.h \
pkgs/development/libraries/webkitgtk/quartz-webcore.patchnew file+22
@@ -0,0 +1,22 @@
1+--- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.cpp 2016-02-02 13:23:23.000000000 -0500
2++++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.cpp 2016-02-02 18:28:07.000000000 -0500
3+@@ -839,7 +839,7 @@
4+ #if defined(XP_MACOSX)
5+ , m_contextRef(0)
6+ #endif
7+-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
8++#if defined(X11) && ENABLE(NETSCAPE_PLUGIN_API)
9+ , m_hasPendingGeometryChange(true)
10+ , m_drawable(0)
11+ , m_visual(0)
12+--- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.h 2016-02-02 13:23:23.000000000 -0500
13++++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.h 2016-02-02 18:26:37.000000000 -0500
14+@@ -378,7 +378,7 @@
15+ void setNPWindowIfNeeded();
16+ #endif
17+
18+-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
19++#if PLATFORM(X11) && ENABLE(NETSCAPE_PLUGIN_API)
20+ bool m_hasPendingGeometryChange;
21+ Pixmap m_drawable;
22+ Visual* m_visual;