After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781947 - Build fails on MacOS because glib doesn't have gdesktopinfo.
Build fails on MacOS because glib doesn't have gdesktopinfo.
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: build
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2017-04-29 17:34 UTC by John Ralls
Modified: 2017-08-15 16:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use the logic copied from glib/configure.ac to determine the presence of Cocoa and conditionally compile desktopappinfo.cpp based on the result. (1.87 KB, patch)
2017-04-29 17:41 UTC, John Ralls
committed Details | Review
Patch: Gio: Exclude DesktopAppInfo from wrap_init.cc on MacOS (2.99 KB, patch)
2017-07-03 11:38 UTC, Kjell Ahlstedt
committed Details | Review

Description John Ralls 2017-04-29 17:34:44 UTC
glib skips building and installing gdesktopinfo.c when it detects building for Cocoa.
Comment 1 John Ralls 2017-04-29 17:41:39 UTC
Created attachment 350741 [details] [review]
Use the logic copied from glib/configure.ac to determine the presence of Cocoa and conditionally compile desktopappinfo.cpp based on the result.

You may want to rework the configure test a bit to match the style of other tests.
Comment 2 Daniel Macks 2017-04-30 07:41:49 UTC
Bug #780309 is the glib item about loss of gdesktopinfo.c in recent glib on OS X.
Comment 3 Murray Cumming 2017-04-30 08:19:48 UTC
Thanks. Please push if you have git commit access.

If you late notice that the MacOS build of glib becomes simpler, please mention it here so we can improve this in glibmm too.
Comment 4 John Ralls 2017-04-30 16:34:30 UTC
Comment on attachment 350741 [details] [review]
Use the logic copied from glib/configure.ac to determine the presence of Cocoa and conditionally compile desktopappinfo.cpp based on the result.

Pushed to glibmm-2-50 and master.
Comment 5 John Ralls 2017-04-30 16:34:45 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Once that release is available, you may want to check for a software upgrade provided by your Linux distribution.
Comment 6 Daniel Macks 2017-04-30 18:27:27 UTC
Bug #781548 gives a ./configure flag to make gdesktopinfo.c optionally available on OS X (as well as several other platorm-specific vs linux/generic APIs). Can glibmm probe glib directly rather than use an indirect platform test?
Comment 7 John Ralls 2017-04-30 20:18:06 UTC
No, a patch attached to Bug 781548 will provide a configure option to do that *if a GLib developer accepts the patch and commits it*, at which point it will have a commit hash that you can cite to say that it's provided.

But yes, the test could check for the presence of gio/gdesktopappinfo.h and/or a library function check for g_desktop_app_info_get_type() instead, and such a test would be more robust that the current one.
Comment 8 Tom Schoonjans 2017-06-24 14:31:06 UTC
It seems that the necessary changes were not introduced into giomm/wrap_init.cc as desktopappinfo is excluded only on Win32, and not on macOS.

On my Mac I get the following compilation errors:

  CXX      wrap_init.lo
  CXX      contenttype.lo
  CXX      init.lo
  CXX      slot_async.lo
  CXX      socketsource.lo
  CXXLD    libgiomm-2.4.la
Undefined symbols for architecture x86_64:
  "Gio::DesktopAppInfo::get_type()", referenced from:
      Gio::wrap_init() in wrap_init.o
  "Gio::DesktopAppInfo_Class::wrap_new(_GObject*)", referenced from:
      Gio::wrap_init() in wrap_init.o
ld: symbol(s) not found for architecture x86_64
Comment 9 John Ralls 2017-06-30 01:34:01 UTC
wrap_init.cc is a generated file. It seems that the first patch wasn't sufficient to generate the correct exceptions in the tarball.

Were you building from a tarball (which one?) or from git?
Comment 10 Tom Schoonjans 2017-06-30 05:32:55 UTC
tarball: glibmm 2.52.0
Comment 11 Kjell Ahlstedt 2017-07-03 11:38:08 UTC
Created attachment 354832 [details] [review]
Patch: Gio: Exclude DesktopAppInfo from wrap_init.cc on MacOS

This patch shows how wrap_init.cc can be fixed. It's a quick and dirty patch.
I don't like it, for several reasons.

1. The result of the test in glib should be available outside glib. It's bad
   that other modules have to repeat the same configure test.
   See bug 780309 comment 24.
2. If we must have our own configure test, it should be an m4 macro in an m4
   file, invoked from configure.ac. Like several other configure tests.
3. AC_TRY_CPP is used in the test. AC_TRY_CPP is deprecated in favour of
   AC_PREPROC_IFELSE.
Comment 12 Kjell Ahlstedt 2017-08-15 16:58:16 UTC
It doesn't seem as if the result of glib's test for MacOS will be available
to glibmm any time soon. I have pushed a slightly modified version of the
patch in comment 11, where I've added some comments in configure.ac and replaced
AC_TRY_CPP with AC_PREPROC_IFELSE to avoid a warning from autogen.sh.

I have pushed the patch to both the master and glibmm-2-52 branches. Hope it's
OK. It affects only builds for MacOS, where glibmm could not be built at all
previously, unless I have misunderstood. If it's not ok to make such a change in
glibmm-2-52, feel free to revert the commit.