Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtk3-x11: fix build #54615

Merged
merged 3 commits into from
Jan 27, 2019
Merged

gtk3-x11: fix build #54615

merged 3 commits into from
Jan 27, 2019

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Jan 26, 2019

Motivation for this change

Closes: #54424, #54642

cc @matthewbauer @LnL7 @hedning

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 101-500 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 26, 2019
@jtojnar
Copy link
Member Author

jtojnar commented Jan 26, 2019

I opened a PR upstream https://gitlab.gnome.org/GNOME/gtk/merge_requests/536

I also came up with a more proper fix but cannot really test it:

--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -26,10 +26,13 @@
 #include "gdkintl.h"
 #include "gdkprivate-x11.h"
 
-#include <glib.h>
-#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
+#if defined(HAVE_GIO_UNIX)
+if defined(__APPLE__)
+#include <gio/gosxappinfo.h>
+#else
 #include <gio/gdesktopappinfo.h>
 #endif
+#endif
 
 #include <string.h>
 #include <unistd.h>
@@ -354,13 +357,19 @@
   else
     workspace_str = NULL;
 
-#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
+#if defined(HAVE_GIO_UNIX)
+#if defined(__APPLE__)
+  if (G_IS_OSX_APP_INFO (info))
+    application_id = g_osx_app_info_get_id (G_OSX_APP_INFO (info));
+  else
+    application_id = NULL;
+#else
   if (G_IS_DESKTOP_APP_INFO (info))
     application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
   else
     application_id = NULL;
+#endif
 #else
-  application_id = NULL;
 #warning Please add support for creating AppInfo from id for your OS
 #endif
 

@jtojnar
Copy link
Member Author

jtojnar commented Jan 27, 2019

@jtojnar jtojnar requested a review from FRidh as a code owner January 27, 2019 13:56
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-linux: 501+ and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 27, 2019
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 6.topic: python and removed 10.rebuild-linux: 501+ labels Jan 27, 2019
@jtojnar jtojnar merged commit d06efd2 into NixOS:master Jan 27, 2019
@jtojnar jtojnar deleted the gtk3-x11 branch January 27, 2019 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 10.rebuild-darwin: 101-500 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants