[gtk/wip/jtojnar/gdk-x11-darwin] osx: Fix building gdk-x11



commit b366d6c5ffecbc1e786fc4722ca6049e28178f50
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sat Jan 26 12:44:18 2019 +0100

    osx: Fix building gdk-x11
    
    Glib linked against Apple libraries does not provide <gio/gdesktopappinfo.h>
    header. When building X11 GTK backend on MacOS against such Glib, it fails
    because it cannot find the header. X11 backend is still required by programs
    like vim or Emacs.
    
    Let’s use the same trick gtk-launch.c uses to solve this issue.
    
    https://github.com/NixOS/nixpkgs/issues/54424

 gdk/x11/gdkapplaunchcontext-x11.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index 8051229ba5..bdf192887c 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -27,7 +27,9 @@
 #include "gdkprivate-x11.h"
 
 #include <glib.h>
+#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
 #include <gio/gdesktopappinfo.h>
+#endif
 
 #include <string.h>
 #include <unistd.h>
@@ -352,10 +354,15 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
   else
     workspace_str = NULL;
 
+#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
   if (G_IS_DESKTOP_APP_INFO (info))
     application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
   else
     application_id = NULL;
+#else
+  application_id = NULL;
+#warning Please add support for creating AppInfo from id for your OS
+#endif
 
   startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
                                 g_get_prgname (),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]