Problem with X11 version of GnuCash on MacOSX

Mike Alexander mta at
Sat Oct 19 15:42:10 EDT 2013

--On October 19, 2013 7:27:20 AM -0700 John Ralls <jralls at> 

> On Oct 19, 2013, at 1:03 AM, Geert Janssens
> <janssens-geert at> wrote:
>> Hi Mike,
>> I don't know much about the internals of Gtk/Gdk either.
>> You refer to a missing system schema. Perhaps this is because
>> GnuCash  now overwrites the XDG_DATA_DIRS environment variable in
>> some cases.  This is done in order to find the GnuCash specific
>> schemas if GnuCash is  not installed in /usr.
>> Can you perhaps run a git bisect to pinpoint the exact commit that
>> first  shows this error ? That would help to eliminate some
>> speculation.
> I dug through the code a bit and discovered that
> gdk_pixbuf_new_from_file does depend upon a function called
> xdg_run_command_on_dirs (located in glib/gio/xdgmime/xdgmime.c if you
> want to go look at it) which tries to find the mime files in the
> following directories (in order): $XDG_DATA_HOME, $HOME/.local/share,
> $XDG_DATA_DIRS. If it gets to $XDG_DATA_DIRS and it's not defined, it
> set it to /usr/local/share:/usr/share.
> That last bit is probably the problem. It makes sense that in some
> cases users might want to override the default data directories and
> prevent them being searched, but perhaps glib should warn that that's
> not the case.
> Mike, do you have XDG_DATA_DIRS set in your environment? Where are
> the mime and mime-info directories installed on your system? If
> you're not using it for something else, you could try pointing
> XDG_DATA_HOME at that directory.

Thanks for the hints.  They made the problem easy to find.  The change 
in r23225 on October 7 is causing the problem.  It made GnuCash set 
XDG_DATA_DIRS if it is being installed in a non-standard location. 
Unfortunately it sets it to something that won't work on my machine.

I use MacPorts to install GnuCash's dependencies, but not GnuCash 
itself.  This is much easier than trying to install all the 
dependencies by hand.  MacPorts installs to /opt/local and its version 
of xdg_run_command_on_dirs knows to look in /opt/local/share so 
everything works fine if XDG_DATA_DIRS is not set.  Unfortunately the 
GnuCash Makefile doesn't know about this and assumes the normal default 
location of /usr/local/share.

Ideally I'd like to fix this by changing the Makefile to use the 
default location that will be used by glib, but I can't figure out how 
to get glib to tell me the default in the Makefile.  Instead I changed 
it to use the compile time value of XDG_DATA_DIRS as a default if it is 
set.  If it is not set, the path will have a double colon in it, but 
that shouldn't hurt.  I'll check this in if no one sees any reason not 

I noticed, by the way, that uses semi-colons for path 
separaters, even on Unix.  Will this work?  For example it sets PATH to


Is used on Windows?  If so perhaps we need to use the 
correct path separator depending on the platform.


More information about the gnucash-devel mailing list