Install MySQL Support for GnuCash 2.6.7 on MacOS 10.10

ok, here is a not so easy one to figure out. Here are the two important files for straight download: libdbdmysql.so and libdbi.18.dylib

Create a new user and do all the building using this new user. This will keep your home directory clean.

Most information was obtained from this link: http://wiki.gnucash.org/wiki/MacOSX/Quartz

Install

Download the file .jhbuildrc-custom from the link above and save it to your home directory.
Download the file gtk-osx-build-setup.sh from https://wiki.gnome.org/Projects/GTK%2B/OSX/Building and save it to your home directory
Edit the file .jhbuildrc-custom:

  • change setup_sdk("10.5", "10.5", ["i386"]) to setup_sdk("10.10", "10.10", ["i386"])
  • Add this line BEFORE all the other libdbi-drivers references (and MySQL Section). Also make sure to update the highlighted folders below to the correct path:
    module_autogenargs['libdbi-drivers']='--with-mysql --disable-docs --with-mysql-incdir="/usr/local/mysql-xxx" --with-mysql-libdir="/usr/local/mysql-xxx"'
  • Uncomment all the MySQL lines (5, I believe)

sh gtk-osx-build-setup.sh
~/.local/bin/jhbuild bootstrap
~/.local/bin/jhbuild build libdbi-drivers
ln -s /usr/local/mysql-xxx /usr/local/mysql # update the source to your mysql install
cp ~/gnucash-stable/lib/dbd/mysql/libdbdmysql.so /Applications/Gnucash.app/Contents/Resources/lib/dbd
# Run Gnucash from the command line to see if there is an error message regarding libdbdmysql
/Applications/Gnucash.app/Contents/MacOS/Gnucash

# The GnuCash Website also suggests to update the mysql driver location although I have managed to run without it:
There's one last task:

install_name_tool -change /prefix/path/lib/libdbi.0.dylib @executable_path/../Resources/lib/libdbi.18.dylib Gnucash.app/Contents/Resources/lib/dbd/libdbdmysql.so

putting in the actual path (which you can see with otool -L for /prefix/path.

# This guide is written from memory. Path names are likely to be wrong. Once I repeat the procedure, I will update this guide.

TODO:
Instructions to install the mysql C connector from source so it is OS 10.10 specific instead of 10.8