dbus-launch in MacOSX build

Geert Janssens janssens-geert at telenet.be
Mon Apr 5 13:56:09 EDT 2010


On Monday 5 April 2010, John Ralls wrote:
> On Apr 5, 2010, at 9:34 AM, Geert Janssens wrote:
> > On Monday 5 April 2010, Mike Alexander wrote:
> >> --On April 5, 2010 4:14:41 PM +0200 Geert Janssens
> >>
> >>> According to the dbus-launch man page, a process that tries to use
> >>> dbus when  there's no dbus session will call dbus-launch
> >>> automatically. So what is the  motivation for this explicit call ?
> >>
> >> This is for the Quartz version of GnuCash, right?
> >
> > Indeed. I forgot to mention this.
> >
> >> What version of dbus is used with that version of GnuCash?
> >
> > I can't find this. John's build scripts don't set a version explicitly
> > and I can't build the Mac OS X/Quartz port myself, my OSX version is too
> > old. But I would presume it to be a fairly recent version.
> >
> >> One should never call
> >> dbus-launch with the MacPorts version of dbus, and probably not with
> >> the Fink version although I don't use that version.  I don't think
> >> there is any recent version that requires an explicit call to it, and
> >> in most versions it is wrong to do so.
> >
> > I don't have experience with MacPorts, nor Fink. How do these build
> > environments deal with set gnucash-setup-env file ? Do they just use it
> > as provided for the linux build ? Or do they add/modify/delete things ?
> > I'm asking because the gnucash-setup-env file has been eliminated and
> > replaced with a configuration file (called "environment"). It is parsed
> > early by the gnucash binary (before any of the environment is required).
> >
> > This config file however is no longer a shell script, so if MacPorts or
> > Fink did additional manipulation, this may no longer work.
> >
> >> I diffed the two versions of setup-env and it looks like there is
> >> another problem with the osx version.  It sets, but doesn't export,
> >> GNC_DBD_DIR.
> >
> > As said the gnucash-setup-env file will go away (in fact it already has
> > since r18994). The replacement config file deals with it correctly.
> >
> >
> > But on to my original question: looking at the Quartz build environment,
> > I notice that it provides its own launcher script that completely ignores
> > the gnucash startup scripts (gnucash, gnucash-gdb,...). Does that mean
> > that the quartz build doesn't use these at all ? In that case I could
> > just as well eliminate those from the source as well.
> 
> Nice guy. I'm doing an SVN build now, I'll tell you if it works or not.
> 
> Gtk-OSX stable is building dbus-1.2.16. (You didn't look very hard, it's at
>  http://github.com/jralls/gtk-osx-build/blob/master/modulesets-stable/gtk-o
> sx-random.modules. Everything is on Github, and jhbuild is configured by
>  default to use the modulesets from there so that other users don't need to
>  explicitly fetch them every time there's a change.)
> 
Heh, I didn't know where to look... I was looking at the contents of 
git://github.com/jralls/gnucash-on-osx.git. I didn't realize there was also a 
gtk-on-osk-build git repository. I know now.

> MacPorts and Fink attempt to duplicate a Linux environment, so
>  gnucash-setup-env-osx.in was protected in the Makefile to only be used
>  with a Gtk-OSX environment.
> 
I realised that in the meantime and have just fixed configure.in for this 
(18995).

> There are two ways to run Gnucash on OSX: In the original build environment
>  (which used gnucash-setup-env) and the relocatable bundle (which has its
>  own launcher script tailored to running inside the bundle). Both handle
>  launching dbus because there were problems with letting GConf start its
>  own instance. I don't remember what they were, but I guess I'll find out
>  in a bit when the build finishes.
> 
The current svn head should still handle the run-from-original-build-
environment fine. The launcher may need a little tweaking.
Basically, whatever environment variable that was set via gnucash-setup-env is 
now defined in the environment config file. Gnucash will read this file at 
early startup. So as things are now, the environment is setup twice when using 
the launcher script, and the ones coming from the environment file will take 
precedence. So if the paths in the environment file still happen to exist, 
objects will be fetched there first which could cause all kinds of funky 
results.

**Pondering** The nicest thing would be if the launcher script could use the 
environment file as well. Many of the environment variables are required in 
both situations, but they use different values. I suppose the tricky part is 
that the paths setup in the launcher script are relative to the bundle, while 
the environment file uses absolute paths.

The environment config file is stored in ${prefix}/etc/gnucash at install 
time, so I suppose it will end up in $bundle_etc/gnucash when GnuCash is 
bundled.
Are you allowed to write to files in the bundle from your launcher script ? If 
so, you could rewrite the environment file to your likings from within the 
launcher. Perhaps that's not done, I'm not familiar enough with Quartz.

Geert


More information about the gnucash-devel mailing list