This page provides further detail on compiling and installing GnuCash using MacPorts. For the overview of Mac installation options, see MacOSXInstallation.
- 1 MacPorts installation in detail
- 2 Using MacPorts to install a recent stable release of GnuCash
- 3 Current developer version
- 4 Compiling on your own
MacPorts installation in detail
Install the latest Developer Tools from Apple - a.k.a. XCode
- Download the latest version from [developer.apple.com] (free registration is required).
- You don't need to install all of the packages - use the 'Customize' button in the installer and only select:
- Developer Tools Software
- gcc 4.0
- gcc 3.3
- Software Development Kits
- Download and install the latest version of [MacPorts]
- Make sure you update all the package descriptions so you can get the latest GnuCash:
sudo port selfupdate
Using MacPorts to install a recent stable release of GnuCash
Once that's done, you can issue the following command to install GnuCash - this will take you quite a while, as the software will be downloaded, then compiled and installed. It took a good 6 hours on my iBook. On my fresh install of MacPorts, the installation did stall with the 'scrollkeeper' package, but you can just run the same install command again. The whole installation of MacPorts with GnuCash adds up to about 1GB.
$ sudo port install gnucash
As of March 2008, this was up-to-date with the latest stable release GnuCash-2.2.4. If this works for you, you can skip the rest of this section. Congratulations!
As of August 2008, Leopard 10.5.4, and GnuCash-2.2.5 the above still works. But the fonts are too small to be useful on my 15" intel powerbook.
There may be an easier way to change fonts in a default install, but this worked--
Install the X11-2.3.0.pkg from Xquartz.
Log out and back in for the new X11 to take effect.
Change the startx script to use bigger fonts by default.
sudo pico /usr/X11/bin/startx
In the startx script, change defaultserverargs=" " --to-- defaultserverargs="-dpi 96"
Close any X11 that is running.
At the OS X Terminal.app window enter the command "gnucash"
Potential Problems and their Solutions
The default installation of GnuCash using MacPorts enables everything, including things you might not need, or things that might even cause trouble. In particular, a few people have reported problems installing libraries required for OFX.
The following command tries to install a minimalistic version of GnuCash:
$ sudo port install gnucash +without_hbci +without_ofx +without_quotes
The current MacPort version does not install on Leopard, due to a bug in the avahi port, which gnucash depends on. (See Ticket #13212.) This problem can be sidestepped by disabling python in the avahi Portfile, as explained in the ticket.
Update (2008-03-21): Avahi is no longer required to build gnucash via macports, so macports builds fine on Leopard systems.
Update (2008-11-17): GnuCash does *not* compile on MacPorts at this moment, some dependencies do not work anymore, and there is a perl problem (it tries installing perl 2 times, once as perl5.8 and then once as perl5 on a clean MacPorts system)
---> Activating perl5 5.8.8_0+darwin_9 Error: Target org.macports.activate returned: Image error: /opt/local/bin/a2p is being used by the active perl5.8 port. Please deactivate this port first, or use the -f flag to force the activation.
Note (2006-11-15): If you receive an error about activating XFree86 that reads something like: "Target com.apple.activate returned: Image /usr/X11R6/lib/libXpm.4.11.dylib already exists and does not belong to a registered port. Unable to activate port XFree86." this means that you have MacOS-X X11User.pkg installed but noProxy-Connection: keep-alive Cache-Control: max-age=0
the X11SDK.pkg. You should install the X11SDK.pkg from the XCode Packages directory and then you can re-issue the "port" command.
Note (2007-03-21): When I used the above command it got part way through and then failed with the error message: *** LibOFX>=0.8.0 is required for backend "aqofxconnect". To get around this problem I simply installed libofx manually first with:
$ sudo port install libofx
and then retyped sudo port install gnucash and things proceeded smoothly.
MacPorts has updated its guile port to 1.8.1. While this is certainly nice, guile 1.8.1 does not work with GnuCash out-of-the box. :-(
If you have installed GnuCash using MacPorts before March 29, 2007, and want to upgrade to a more recent version, you will have to do the following:
sudo port uninstall gnucash sudo port -f uninstall g-wrap sudo port -f uninstall slib-guile sudo port -f uninstall guile sudo port clean g-wrap16 slib-guile16 guile16 # if you've already tried things on your own sudo port selfupdate sudo port install gnucash
These commands will remove those guile-related ports that now refer to guile 1.8.1 from your system. sudo port selfupdate retrieves current building instructions from the MacPorts server. sudo port install gnucash will then pull in guile16, slib-guile16 and so on, thus referring to known-good software versions.
If your original install of GnuCash using MacPorts was sometime after March 28, 2007, things should Just Work (tm), and you can ignore this section. :-)
Current developer version
MacPorts has a port to install a somewhat current developer version from the source code repository.
If you've already installed the regular gnucash port, you will have to deactivate it:
sudo port deactivate gnucash
Then use the following command:
sudo port install gnucash-devel
For the 2.1.5 release (July 2, 2007), one needs to do the following after installing gnucash-devel:
sudo port uninstall gnucash-devel sudo port -f uninstall slib-guile sudo port -f uninstall guile sudo port clean slib-guile guile # for good measure sudo port -f install guile16 sudo port -f install slib-guile16 sudo port -f install gnucash-devel
Compiling on your own
If you want to run a more recent version of GnuCash 2 than that found in either of the above options, you can use the following instructions. Note however that at least in the spring of 2007, the gnucash-devel port has been tracking GnuCash unstable releases (and sometimes Subversion head versions) quite closely, so be sure that gnucash-devel is not recent enough for your needs. As before, make sure you have the latest version of XCode from Apple before you start.
According to the gnucash website "to install GnuCash, users will need Gnome 2, guile, slib and g-wrap" so the first steps (assuming DarwinPorts is installed) are simply:
$ sudo port install gnome $ sudo port install slib-guile16 $ sudo port install g-wrap16
Note that as of GnuCash-2.1.0, swig is used instead of g-wrap, so installing the g-wrap16 port is no longer necessary for this version and later.
Expect gnome to take a long time, the other two should be done relatively quickly. After installing you should see the dependencies listed as active by using this command:
$ port installed
Libraries and Includes
Now, this author didn't find the following in the DarwinPorts documentation, if it is there please update this information. Make sure the DarwinPorts libraries are available to your compiler, change these appropriately for your shell
$ export CPPFLAGS="-I/opt/local/include" $ export LDFLAGS="-L/opt/local/lib" $ export DYLD_LIBRARY_PATH="/opt/local/lib"
Download the gnucash-2.x.x source, extract it, read the INSTALL file. You may want to adjust the configure line to suite your preferences. This author uses the following:
$ ./configure -C --prefix=/opt/local $ make $ sudo make install
If configure fails due to missing libraries then first make sure you properly set the CFLAGS, CPPFLAGS and LDFLAGS variables, and then verify that you actually installed the libraries.
Problems on Panther
libgnomecups is broken on Panther which precludes gnome from building (Panther has an older version of CUPS which doesn't have cupsGetFd). Fink (which has a different tree for Panther) takes care of this by using a older version of libgnomecups.