summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2019-01-26 09:17:49 +0100
committerJan Tojnar <jtojnar@gmail.com>2019-01-27 15:38:18 +0100
commit10a60af7e0867b9b551fa238dc59177276dc3304 (patch)
tree9b50a08835f978541eb43e86028af071813d88e5
parentbc41317e24317b0f506287f2d5bab00140b9b50e (diff)
downloadnixpkgs-10a60af7e0867b9b551fa238dc59177276dc3304.tar
nixpkgs-10a60af7e0867b9b551fa238dc59177276dc3304.tar.gz
nixpkgs-10a60af7e0867b9b551fa238dc59177276dc3304.tar.bz2
nixpkgs-10a60af7e0867b9b551fa238dc59177276dc3304.tar.lz
nixpkgs-10a60af7e0867b9b551fa238dc59177276dc3304.tar.xz
nixpkgs-10a60af7e0867b9b551fa238dc59177276dc3304.tar.zst
nixpkgs-10a60af7e0867b9b551fa238dc59177276dc3304.zip
gtk3-x11: fix darwin build
-rw-r--r--pkgs/development/libraries/gtk+/3.0-darwin-x11.patch28
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix5
2 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/libraries/gtk+/3.0-darwin-x11.patch b/pkgs/development/libraries/gtk+/3.0-darwin-x11.patch
new file mode 100644
index 00000000000..86631634b5b
--- /dev/null
+++ b/pkgs/development/libraries/gtk+/3.0-darwin-x11.patch
@@ -0,0 +1,28 @@
+--- 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 @@
+   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 (),
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index 01133b92ee1..b131acf5f5e 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -45,6 +45,11 @@ stdenv.mkDerivation rec {
       url = https://gitlab.gnome.org/GNOME/gtk/commit/e3a1593a0984cc0156ec1892a46af8f256a64878.patch;
       sha256 = "0akvp1r8xlzf5amk9gmk7b5sabr1wbmg3ak15rppsid7nf9f5dqf";
     })
+  ] ++ optionals stdenv.isDarwin [
+    # X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
+    # let’s drop that dependency in similar way to how other parts of the library do it
+    # e.g. https://gitlab.gnome.org/GNOME/gtk/blob/3.24.4/gtk/gtk-launch.c#L31-33
+    ./3.0-darwin-x11.patch
   ];
 
   buildInputs = [ libxkbcommon epoxy json-glib isocodes ]