GNOME Bugzilla – Bug 661264
Plugins not find when using in bundle
Last modified: 2011-10-09 07:26:11 UTC
When using libgoffice in a Mac OS X bundle, plugins are not find and app using libgoffice crash. That's because the paths are fixed at the compile time. In Mac OSX bundle datas must be look relatively from the bundle path, with fixing environment variable before launching the app. For exemple : GOFFICE_LIBDIR. For Grisbi's app on Mac OSX we've patch the code for use gtkmacintegration lib and use quartz_application_get_resource_path function in libgoffice_init in goffice.c : #ifdef GTKOSXAPPLICATION if ( quartz_application_get_bundle_id ( ) ) { gchar *dir; dir = quartz_application_get_resource_path (); libgoffice_data_dir = g_build_filename (dir, "share", "goffice", GOFFICE_VERSION, NULL); libgoffice_icon_dir = g_build_filename (dir, "share", "pixmaps", "goffice", GOFFICE_VERSION, NULL); libgoffice_locale_dir = g_build_filename (dir, "share", "locale", NULL); libgoffice_lib_dir = g_build_filename (dir, "lib", "goffice", GOFFICE_VERSION, NULL); g_free (dir); } #endif /* GTKOSXAPPLICATION */
A full patch would be welcome. Thanks.
Created attachment 198607 [details] [review] Patch for use gtkmacintegration lib
I've submitted the patch. Rerun autogen.sh is needed to rebuild configure script.
Nice, thanks. Just a question: do all mac apps need to be bundled or does it make sense to allow for an usual installation? May be the "if ( quartz_application_get_bundle_id ( ) )" is for that?
Yes "if ( quartz_application_get_bundle_id ( ) )" is for that. Bundle is the best way to distribute binary apps on Mac OSX, but they can be installed like under *n*x systems with tools like MacPorts or Fink. John Ralls who is the dev of gtk-osx say me that he haven't problem with using libgoffice for Gnucash and bundling it. I'have try to fix GOFFICE_LIBS relatively to bundle in the start script. LD_LIBRARY_PATH and DYLD_LIBRARY_PATH are already fixed in start script but it dosen't work. I had a similar bug with the DTD path of libofx, They have fix the bug and now i use the environment variable OFX_DTD_PATH in the launching script. I don't know what they've change because I'm not really a dev, just the binary maintainer for Mac OS X.
OK, I'll commit your patch and it will be included in next major release.
OK thanks. Perhaps you can look at http://libofx.git.sourceforge.net/git/gitweb.cgi?p=libofx/libofx;a=commit;h=05488d759153c49677b9fb806f587e724095fe9b to see how they do to fix the same issue with OFX_DTD_PATH. I think it will probably be better than use the gtkosxapplication lib. If i understand how it works, i'll try to use this way...
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. Thanks for the patch.