forked from rhult/gtk-osx-build
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump core libraries to latest releases.
- Loading branch information
Showing
2 changed files
with
118 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
patches/0001-Bug747146-Build-cocoanotification-only-if-supported.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
From 8003b800f63590d52b9b436f62337bc709c0f951 Mon Sep 17 00:00:00 2001 | ||
From: John Ralls <jralls@ceridwen.us> | ||
Date: Fri, 26 Feb 2016 14:16:46 -0800 | ||
Subject: [PATCH] Enable building gcocoanotification only if OS X min version | ||
>= 10.9. | ||
|
||
--- | ||
configure.ac | 19 ++++++++----------- | ||
gio/Makefile.am | 2 ++ | ||
gio/giomodule.c | 8 ++++++-- | ||
3 files changed, 16 insertions(+), 13 deletions(-) | ||
|
||
diff --git a/configure.ac b/configure.ac | ||
index 603f621..20c640b 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -221,22 +221,19 @@ AS_IF([test "x$glib_have_carbon" = "xyes"], [ | ||
], [CARBON_LIBS=""]) | ||
|
||
AC_SUBST([CARBON_LIBS]) | ||
- | ||
+ac_cv_have_os_x_9_or_later="no" | ||
AS_IF([test "x$glib_have_cocoa" = "xyes"], [ | ||
AC_DEFINE(HAVE_COCOA, 1, [define to 1 if Cocoa is available]) | ||
COCOA_LIBS="-Wl,-framework,Foundation" | ||
LDFLAGS="$LDFLAGS $COCOA_LIBS" | ||
- | ||
- osx_version=`sw_vers -productVersion` | ||
- osx_min_version="10.9.0" | ||
- AC_MSG_CHECKING([OSX version >= $osx_min_version]) | ||
- AS_VERSION_COMPARE([$osx_version], [$osx_min_version], [ | ||
- AC_MSG_RESULT([no]) | ||
- AC_MSG_ERROR([OSX version is too old!]) | ||
- ]) | ||
- AC_MSG_RESULT([yes]) | ||
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||
+#include <AvailabilityMacros.h> | ||
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 | ||
+#error Compiling for minimum OS X version before 10.9 | ||
+#endif | ||
+ ]])],[ac_cv_have_os_x_9_or_later="yes"]) | ||
], [COCOA_LIBS=""]) | ||
- | ||
+AM_CONDITIONAL([MAC_OS_X_9], [test "x$ac_cv_have_os_x_9_or_later" = xyes]) | ||
AC_SUBST([COCOA_LIBS]) | ||
|
||
dnl declare --enable-* args and collect ac_help strings | ||
diff --git a/gio/Makefile.am b/gio/Makefile.am | ||
index e911d91..01d3711 100644 | ||
--- a/gio/Makefile.am | ||
+++ b/gio/Makefile.am | ||
@@ -266,8 +266,10 @@ unix_sources = \ | ||
$(NULL) | ||
|
||
if OS_COCOA | ||
+if MAC_OS_X_9 | ||
unix_sources += gcocoanotificationbackend.c | ||
endif | ||
+endif | ||
|
||
giounixincludedir=$(includedir)/gio-unix-2.0/gio | ||
giounixinclude_HEADERS = \ | ||
diff --git a/gio/giomodule.c b/gio/giomodule.c | ||
index da7c167..fec84ba 100644 | ||
--- a/gio/giomodule.c | ||
+++ b/gio/giomodule.c | ||
@@ -47,6 +47,10 @@ | ||
#include "gdesktopappinfo.h" | ||
#endif | ||
|
||
+#ifdef HAVE_COCOA | ||
+#include <AvailabilityMacros.h> | ||
+#endif | ||
+ | ||
/** | ||
* SECTION:giomodule | ||
* @short_description: Loadable GIO Modules | ||
@@ -911,7 +915,7 @@ extern GType g_fdo_notification_backend_get_type (void); | ||
extern GType g_gtk_notification_backend_get_type (void); | ||
#endif | ||
|
||
-#ifdef HAVE_COCOA | ||
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
extern GType g_cocoa_notification_backend_get_type (void); | ||
#endif | ||
|
||
@@ -1111,7 +1115,7 @@ _g_io_modules_ensure_loaded (void) | ||
g_type_ensure (g_fdo_notification_backend_get_type ()); | ||
g_type_ensure (g_gtk_notification_backend_get_type ()); | ||
#endif | ||
-#ifdef HAVE_COCOA | ||
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_9_AND_LATER | ||
g_type_ensure (g_cocoa_notification_backend_get_type ()); | ||
#endif | ||
#ifdef G_OS_WIN32 | ||
-- | ||
2.2.2 | ||
|