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 661264 - Plugins not find when using in bundle
Plugins not find when using in bundle
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: Graphing / Charting
0.8.x
Other Mac OS
: Normal major
: ---
Assigned To: Jean Bréfort
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2011-10-08 14:51 UTC by Gérald Niel
Modified: 2011-10-09 07:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for use gtkmacintegration lib (3.71 KB, patch)
2011-10-08 15:56 UTC, Gérald Niel
committed Details | Review

Description Gérald Niel 2011-10-08 14:51:49 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 */
Comment 1 Jean Bréfort 2011-10-08 15:35:09 UTC
A full patch would be welcome. Thanks.
Comment 2 Gérald Niel 2011-10-08 15:56:52 UTC
Created attachment 198607 [details] [review]
Patch for use gtkmacintegration lib
Comment 3 Gérald Niel 2011-10-08 15:58:29 UTC
I've submitted the patch.
Rerun autogen.sh is needed to rebuild configure script.
Comment 4 Jean Bréfort 2011-10-08 16:07:26 UTC
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?
Comment 5 Gérald Niel 2011-10-09 06:21:06 UTC
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.
Comment 6 Jean Bréfort 2011-10-09 06:23:28 UTC
OK, I'll commit your patch and it will be included in next major release.
Comment 7 Gérald Niel 2011-10-09 06:47:26 UTC
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...
Comment 8 Jean Bréfort 2011-10-09 07:26:11 UTC
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.