From da1d13bc0791e9effccd697792e745346ba00a45 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Mon, 10 Apr 2017 23:11:16 -0700 Subject: [PATCH 1/3] webkgitgtk: fix 2.14 on macOS Includes the patches from macports and fixes an issue with the `otool -L` output that was causing g-ir-scanner to fail. The paths in the macports patches have been modified so that they will work with `patches` in nix (an extra directory level was added). --- .../absolute_shlib_path.patch | 9 +-- pkgs/development/libraries/webkitgtk/2.14.nix | 58 ++++++++++++++--- .../libraries/webkitgtk/PR-152650-2.patch | 62 +++++++++++++++++++ .../libraries/webkitgtk/PR-153138.patch | 26 ++++++++ .../libraries/webkitgtk/PR-157554.patch | 33 ++++++++++ .../libraries/webkitgtk/PR-157574.patch | 62 +++++++++++++++++++ 6 files changed, 237 insertions(+), 13 deletions(-) create mode 100644 pkgs/development/libraries/webkitgtk/PR-152650-2.patch create mode 100644 pkgs/development/libraries/webkitgtk/PR-153138.patch create mode 100644 pkgs/development/libraries/webkitgtk/PR-157554.patch create mode 100644 pkgs/development/libraries/webkitgtk/PR-157574.patch diff --git a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch index 49e059befdb..75d9281dfb0 100644 --- a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch +++ b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch @@ -57,15 +57,16 @@ diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py index 838d343..ca7fc0d 100644 --- a/giscanner/shlibs.py +++ b/giscanner/shlibs.py -@@ -53,10 +53,24 @@ def _resolve_libtool(options, binary, libraries): +@@ -53,10 +53,27 @@ def _resolve_libtool(options, binary, libraries): # Match absolute paths on OS X to conform to how libraries are usually # referenced on OS X systems. def _ldd_library_pattern(library_name): + nix_store_dir = re.escape('@nixStoreDir@'.rstrip('/')) pattern = "(? +Date: Tue, 8 Mar 2016 17:26:23 -0800 +Subject: [PATCH 2/2] [GTK][Mac] Enable support for gtk-doc on Mac + +https://bugs.webkit.org/show_bug.cgi?id=152650 + +Signed-off-by: Jeremy Huddleston Sequoia +--- + ChangeLog | 10 ++++++++++ + Source/PlatformGTK.cmake | 2 +- + Source/cmake/OptionsGTK.cmake | 5 ----- + 3 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/Source/PlatformGTK.cmake b/Source/PlatformGTK.cmake +index af4d2e3..0b11b56 100644 +--- a/Source/PlatformGTK.cmake ++++ b/Source/PlatformGTK.cmake +@@ -34,7 +34,7 @@ endmacro() + add_gtkdoc_generator("docs-build.stamp" "") + if (ENABLE_GTKDOC) + add_custom_target(gtkdoc ALL DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp") +-elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING AND NOT APPLE) ++elseif (NOT ENABLED_COMPILER_SANITIZERS AND NOT CMAKE_CROSSCOMPILING) + add_custom_target(gtkdoc DEPENDS "${CMAKE_BINARY_DIR}/docs-build.stamp") + + # Add a default build step which check that documentation does not have any warnings +diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake +index 6b01f1a..b443d10 100644 +--- a/Source/cmake/OptionsGTK.cmake ++++ b/Source/cmake/OptionsGTK.cmake +@@ -424,11 +424,6 @@ if (CMAKE_CROSSCOMPILING) + set(ENABLE_INTROSPECTION OFF) + endif () + +-# Override the cached variable, gtk-doc does not really work when building on Mac. +-if (APPLE) +- set(ENABLE_GTKDOC OFF) +-endif () +- + set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom) + set(DERIVED_SOURCES_WEBKITGTK_DIR ${DERIVED_SOURCES_DIR}/webkitgtk) + set(DERIVED_SOURCES_WEBKITGTK_API_DIR ${DERIVED_SOURCES_WEBKITGTK_DIR}/webkit) +diff --git a/Tools/gtk/gtkdoc.py b/Tools/gtk/gtkdoc.py +index 4c8237b..a628ae0 100644 +--- a/Tools/gtk/gtkdoc.py ++++ b/Tools/gtk/gtkdoc.py +@@ -322,6 +322,11 @@ class GTKDoc(object): + env['RUN'] = 'LD_LIBRARY_PATH="%s:%s" ' % (self.library_path, current_ld_library_path) + else: + env['RUN'] = 'LD_LIBRARY_PATH="%s" ' % self.library_path ++ current_dyld_library_path = env.get('DYLD_LIBRARY_PATH') ++ if current_ld_library_path: ++ env['RUN'] = 'DYLD_LIBRARY_PATH="%s:%s" ' % (self.library_path, current_dyld_library_path) ++ else: ++ env['RUN'] = 'DYLD_LIBRARY_PATH="%s" ' % self.library_path + + if ldflags: + env['LDFLAGS'] = '%s %s' % (ldflags, env.get('LDFLAGS', '')) +-- +2.7.2 + diff --git a/pkgs/development/libraries/webkitgtk/PR-153138.patch b/pkgs/development/libraries/webkitgtk/PR-153138.patch new file mode 100644 index 00000000000..833921f6806 --- /dev/null +++ b/pkgs/development/libraries/webkitgtk/PR-153138.patch @@ -0,0 +1,26 @@ +From 07886d9eacb7587dd52a9bcae10c1fc8ab56a910 Mon Sep 17 00:00:00 2001 +From: Jeremy Huddleston Sequoia +Date: Fri, 15 Jan 2016 11:53:07 -0800 +Subject: [PATCH] https://bugs.webkit.org/show_bug.cgi?id=153138 + +Signed-off-by: Jeremy Huddleston Sequoia +--- + Source/JavaScriptCore/bytecode/StructureStubInfo.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp b/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp +index 1e4b4f5..9b27aed 100644 +--- a/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp ++++ b/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp +@@ -26,6 +26,8 @@ + #include "config.h" + #include "StructureStubInfo.h" + ++#include "JSCellInlines.h" ++ + #include "JSObject.h" + #include "PolymorphicAccess.h" + #include "Repatch.h" +-- +2.7.0 + diff --git a/pkgs/development/libraries/webkitgtk/PR-157554.patch b/pkgs/development/libraries/webkitgtk/PR-157554.patch new file mode 100644 index 00000000000..615e805c92c --- /dev/null +++ b/pkgs/development/libraries/webkitgtk/PR-157554.patch @@ -0,0 +1,33 @@ +https://bugs.webkit.org/show_bug.cgi?id=157554 + +--- a/Source/WTF/wtf/OSRandomSource.cpp ++++ b/Source/WTF/wtf/OSRandomSource.cpp +@@ -29,7 +29,7 @@ + #include + #include + +-#if !OS(DARWIN) && OS(UNIX) ++#if OS(UNIX) && !(OS(DARWIN) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) + #include + #include + #include +@@ -46,7 +46,7 @@ + + namespace WTF { + +-#if !OS(DARWIN) && OS(UNIX) ++#if OS(UNIX) && !(OS(DARWIN) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) + NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToOpenURandom() + { + CRASH(); +@@ -60,8 +56,8 @@ NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToReadFromURandom() + + void cryptographicallyRandomValuesFromOS(unsigned char* buffer, size_t length) + { +-#if OS(DARWIN) +- RELEASE_ASSERT(!CCRandomCopyBytes(kCCRandomDefault, buffer, length)); ++#if OS(DARWIN) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 ++ return arc4random_buf(buffer, length); + #elif OS(UNIX) + int fd = open("/dev/urandom", O_RDONLY, 0); + if (fd < 0) diff --git a/pkgs/development/libraries/webkitgtk/PR-157574.patch b/pkgs/development/libraries/webkitgtk/PR-157574.patch new file mode 100644 index 00000000000..d9b0795afa5 --- /dev/null +++ b/pkgs/development/libraries/webkitgtk/PR-157574.patch @@ -0,0 +1,62 @@ +diff --git a/Source/JavaScriptCore/API/WebKitAvailability.h b/Source/JavaScriptCore/API/WebKitAvailability.h +index ab53183..1310dec 100644 +--- a/Source/JavaScriptCore/API/WebKitAvailability.h ++++ b/Source/JavaScriptCore/API/WebKitAvailability.h +@@ -27,57 +27,12 @@ + #define __WebKitAvailability__ + + #if defined(__APPLE__) +- +-#include + #include +- +-#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED < 101100 +-/* To support availability macros that mention newer OS X versions when building on older OS X versions, +- we provide our own definitions of the underlying macros that the availability macros expand to. We're +- free to expand the macros as no-ops since frameworks built on older OS X versions only ship bundled with +- an application rather than as part of the system. +-*/ +- +-#ifndef __NSi_10_10 // Building from trunk rather than SDK. +-#define __NSi_10_10 introduced=10.0 // Use 10.0 to indicate that everything is available. +-#endif +- +-#ifndef __NSi_10_11 // Building from trunk rather than SDK. +-#define __NSi_10_11 introduced=10.0 // Use 10.0 to indicate that everything is available. +-#endif +- +-#ifndef __NSi_10_12 // Building from trunk rather than SDK. +-#define __NSi_10_12 introduced=10.0 // Use 10.0 to indicate that everything is available. +-#endif +- +-#ifndef __AVAILABILITY_INTERNAL__MAC_10_9 +-#define __AVAILABILITY_INTERNAL__MAC_10_9 +-#endif +- +-#ifndef __AVAILABILITY_INTERNAL__MAC_10_10 +-#define __AVAILABILITY_INTERNAL__MAC_10_10 + #endif + +-#ifndef AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER +-#define AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER +-#endif +- +-#ifndef AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER +-#define AVAILABLE_MAC_OS_X_VERSION_10_10_AND_LATER +-#endif +- +-#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED <= 101100 */ +- +-#if defined(BUILDING_GTK__) + #undef CF_AVAILABLE + #define CF_AVAILABLE(_mac, _ios) + #undef CF_ENUM_AVAILABLE + #define CF_ENUM_AVAILABLE(_mac, _ios) +-#endif +- +-#else +-#define CF_AVAILABLE(_mac, _ios) +-#define CF_ENUM_AVAILABLE(_mac, _ios) +-#endif + + #endif /* __WebKitAvailability__ */ From 5dfe0f7ee624389debc63772b7e110826ba384ba Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Mon, 10 Apr 2017 23:17:16 -0700 Subject: [PATCH 2/3] gtksourceview: fix version 3 on macOS Add darwin to the list of supported platforms for gtksourceview. --- pkgs/desktops/gnome-3/3.22/core/gtksourceview/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome-3/3.22/core/gtksourceview/default.nix b/pkgs/desktops/gnome-3/3.22/core/gtksourceview/default.nix index aac1739a6e9..3dfbe6fbf0b 100644 --- a/pkgs/desktops/gnome-3/3.22/core/gtksourceview/default.nix +++ b/pkgs/desktops/gnome-3/3.22/core/gtksourceview/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { patches = [ ./nix_share_path.patch ]; meta = with stdenv.lib; { - platforms = platforms.linux; + platforms = with platforms; linux ++ darwin; maintainers = gnome3.maintainers; }; } From 4d5ed187d3a645028e3d18ccc519a153633be113 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Mon, 10 Apr 2017 23:26:42 -0700 Subject: [PATCH 3/3] gtk-mac-integration: fix gtk3 version Include a Gtk3 version of gtk-mac-integration. Add gobjectIntrospection to gtk-mac-integration. Use propagatedBuildInputs for gtk. --- pkgs/development/libraries/gtk-mac-integration/default.nix | 7 ++++--- pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/gtk-mac-integration/default.nix b/pkgs/development/libraries/gtk-mac-integration/default.nix index 30ac8f2fe28..f9ce0aa4b81 100644 --- a/pkgs/development/libraries/gtk-mac-integration/default.nix +++ b/pkgs/development/libraries/gtk-mac-integration/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig, glib, gtk_doc, gtk }: +{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig, glib, gtk_doc, gtk, gobjectIntrospection }: stdenv.mkDerivation rec { name = "gtk-mac-integration-2.0.8"; @@ -10,8 +10,9 @@ stdenv.mkDerivation rec { sha256 = "1fbhnvj0rqc3089ypvgnpkp6ad2rr37v5qk38008dgamb9h7f3qs"; }; - nativeBuildInputs = [ autoreconfHook pkgconfig gtk_doc ]; - buildInputs = [ glib gtk ]; + nativeBuildInputs = [ autoreconfHook pkgconfig gtk_doc gobjectIntrospection ]; + buildInputs = [ glib ]; + propagatedBuildInputs = [ gtk ]; preAutoreconf = '' gtkdocize diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 29caabbda57..0f39b647637 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7846,6 +7846,10 @@ with pkgs; gtk = gtk2; }; + gtk-mac-integration-gtk3 = callPackage ../development/libraries/gtk-mac-integration { + gtk = gtk3; + }; + gtk-mac-bundler = callPackage ../development/tools/gtk-mac-bundler {}; gtkspell2 = callPackage ../development/libraries/gtkspell { };