Difference between revisions of "MacOS/Quartz"

From GnuCash
Jump to: navigation, search
(Making a Bundle: Updated to reflect better bundle file, give advice about troubleshooting)
(Preliminaries: Added fix for 10.4/PPC python installation problem)
Line 29: Line 29:
 
</tt>
 
</tt>
  
If you have set <tt>$MACOSX_DEPLOYMENT_TARGET</tt> to something other than your running version of OSX, you may get an error during jhbuld bootstrap or later when building targets.  
+
Note: Mike Evans has reported that he encountered a python installation problem using Tiger on a PPC, where python distutils was unable to find the directory
 +
<tt>~/gtk/inst/include/multiarch-Power Macintosh-linux/python2.5/pyconfig.h</tt>
 +
which he fixed by
 +
<code>
 +
cd ~/gtk/inst/include/
 +
ln -s . multiarch-Power\ Macintosh-linux
 +
</code>
 +
He did it in the shell after building libxml-py errored out on him, but it should be possible to do after <tt>jhbuild bootstrap</tt> and before <tt>jhbuild buildone libxml-py</tt>.
 +
 
 +
If you have set <tt>$MACOSX_DEPLOYMENT_TARGET</tt> to something other than your running version of OSX, you may get an error during jhbuld bootstrap or later when building targets.
  
 
==Building==
 
==Building==

Revision as of 22:50, 30 March 2009

Overview

GnuCash can be built to run more or less natively on OSX -- meaning without X11. Better yet, the build is almost automatic.

You can do this also with MacPorts: The details are described at [MacOSX/MacPortsDetail]. If you already have MacPorts installed, you should use that procedure, as gtk-osx doesn't work well with a MacPorts installation.

If you want to have a clickable GnuCash.app to put in your Applications folder, this is the solution to use. If you want to be able to easily customize your installation, this is also the solution for you. Don't want all of the extra stuff that MacPorts drags in? Well, this might be a bit better... but GnuCash is notorious for its huge list of dependencies. Want to keep up with the latest work from the Gnome developers? This solution gets many of its packages directly from source-code-control... That's a double-edged sword, of course, because if a build gets broken, you're pretty well stuck until the developers for that package fix it.


I've succeeded in building this under various incarnations of Leopard while perfecting the modulesets, always on a Mac Pro... but it ought to work on any Mac running Tiger or Leopard.

The default configuration builds in your home folder. On my system, I build in /usr/local/src/gnome and install to /usr/local/gtk. If you want to do that, uncomment the checkoutroot and prefix lines in .jhbuildrc-custom, then create the folders up front and give yourself ownership. If you don't know how to do that, then you should probably leave it the way it is.

Preliminaries

Tiger or newer is required for gtk-osx.

You need Python 2.5 to run jhbuild. This is already part of Leopard (OSX 10.5), but Tiger (10.4) provided Python 2.3, so the gtk-osx maintainer has included logic to make a new python for Tiger users.

Download http://github.com/jralls/gnucash-on-osx/raw/master/.jhbuildrc-custom into your home directory.

Note that by default, jhbuild will put everything into your home directory. I prefer to build and install into /usr/local, so you'll find commented out settings to do it that way at the top of .jhbuildrc-custom. You can uncomment these and change them to whatever you like -- or leave them as they are.

Go to http://live.gnome.org/GTK%2B/OSX/BuildInstructions and follow the instructions. Don't run jhbuild build yet!

At the moment, in order to build gtk-doc (which is required by a bunch of packages), you need python bindings for libxml2. For Leopard users, if you don't have this installed somewhere on your $PYTHONPATH, and for all Tiger users, run

$> jhbuild buildone libxml-py

Note: Mike Evans has reported that he encountered a python installation problem using Tiger on a PPC, where python distutils was unable to find the directory ~/gtk/inst/include/multiarch-Power Macintosh-linux/python2.5/pyconfig.h which he fixed by cd ~/gtk/inst/include/ ln -s . multiarch-Power\ Macintosh-linux He did it in the shell after building libxml-py errored out on him, but it should be possible to do after jhbuild bootstrap and before jhbuild buildone libxml-py.

If you have set $MACOSX_DEPLOYMENT_TARGET to something other than your running version of OSX, you may get an error during jhbuld bootstrap or later when building targets.

Building

Once all of the preliminaries are complete, run:

$> jhbuild build


Running from the commandline

Now you're ready to try it out:

$> $PREFIX/bin/gnucash

Making a Bundle

So far so good, but you don't really want to have to open a Terminal window every time you want to use GnuCash, now do you? Of course not. You want a nice icon in your Applications folder (and maybe in the Dock) to click on when you run GnuCash. Here's how to do this:

Download the bundler from http://github.com/jralls/gnucash-on-osx/raw/master/ige-mac-bundler.tar.gz, unpack it, cd into the ige-mac-bundler directory, and make install
Download http://github.com/jralls/gnucash-on-osx/raw/master/gnucash-bundler.tar.gz and unpack it.
cd gnucash-bundler
Look through gnucash-launcher and gnucash.bundle and adjust the paths to match your installation.
make gnucash-launcher executable (chmod +x gnucash-launcher)
execute jhbuild shell to set up the environment for the bundler
export PATH=$PREFIX/bin:$PATH because jhbuild shell doesn't do this for some reason
ige-mac-bundler gnucash.bundle
exit

And your bundle should be ready to go. Try GnuCash.app/Contents/MacOSX/GnuCash from the command-line so that you can see any error messages. If that works, try open GnuCash.app. If that works, then you can move GnuCash.app to your Applications folder and it's ready to use. (If it doesn't, error messages are written to the console log. You can run IGE_DEBUG_LAUNCHER=1 open Gnucash.app to see what the launcher script is doing wrong.) Don't move or remove the installation directory (~/gtk/inst by default): Both dbus and GnuCash have links pointing into it which can't at present be changed.