OSX/Quartz build: how to enable mysql support ?

Geert Janssens janssens-geert at telenet.be
Thu Apr 22 12:14:14 EDT 2010


On Thursday 22 April 2010, John Ralls wrote:
> On Apr 22, 2010, at 6:26 AM, Geert Janssens wrote:
> > I am playing around with John's OS X/Quartz build, working from svn
> > trunk.
> >
> > I have managed to build it thanks to the helpful OSX/Quartz wiki page and
> > this list.
> >
> > I noticed though that while dbi is enabled, only the sqlite3 dbi driver
> > is installed.
> >
> > I am interested in playing with the mysql/postgres drivers as well, but
> > couldn't easily tweak the jhbuild configuration to build those.
> >
> > Before I waste my time on this, has anybody else tried this ? Are there
> > some blocking problems with this ?
> 
> Geert,
> 
> Add the following line to your .jhbuildrc-custom and run `jhbuild buildone
>  libdbi-drivers`: append_autogenargs("libdbi-drivers", "--enable-mysql
>  --with-mysql-incdir='/path/to/mysqlheaders'
>  --with-mysql-libdir='/path/to/libmysql'")
> 
> Obviously, edit the paths. Since I wrote that from memory, you might want
>  to run `configure --help` in the libdbi-drivers source directory and make
>  sure that I got the option names right.
> 
> Regards,
> John Ralls
> 
Thanks,

That worked with some minor tweaking. I'll report my actions here for future 
reference:

* First I added these two lines to .jhbuildrc-custom:
mysql_dir = os.path.join(os.environ["HOME"], "Library/mysql")
append_autogenargs("libdbi-drivers", "--with-mysql --with-mysql-incdir=" + 
mysql_dir + "/include --with-mysql-libdir=" + mysql_dir + "/lib")
(the second line is split up by my mail client, it should be on one line)
* Then it took me a while to figure out where to get the mysql headers and  
libraries. Turns out mysql publishes them as the "MySQL C connector". (look 
for mysql-connector-c in the download section on the mysql website)
* Next I had to modify the directory layout of this download: the dbi driver 
expects to find the headers in include/mysql, while they come in include/ by 
default. A simple move of the headers to this subdirectory fixed it
* Finally before running gnucash, the path the myql-connector lib directory 
has to be added to DYLD_LIBRARY_PATH. For simplicity, I chose to export it on 
the command line:
export DYLD_LIBARY_PATH=~/Library/mysql/lib
<run gnucash>

I may add a cleaned up version of this info to the wiki, so others that wish 
to experiment with gnucash/mysql on OS X can repeat the steps.

Just out of curiosity, are there any plans to include mysql/postgres 
integration in the jhbuild system (as an optional module perhaps) ?

Geert


More information about the gnucash-devel mailing list