Thursday, November 29, 2007

Python 25 & MySQL on Leopard

There was a bit of trouble when I tried to use macports to install the excellent Trac project management and issue tracking application. Specifically, the py25-mysql port did not compile correctly.

Trolling through the InterWeb, I found this post about a fix to compile the python module from scratch. The post, however, has more instructions than are necessary, so here is my revised procedure:

  1. Download the source from here.
  2. Unpack the archive and edit the _mysql.c file to comment out lines 37-39:

    // #ifndef uint
    // #define uint unsigned int
    // #endif

  3. Edit the site.cfg file to set the mysql_config path. For me this was:

    mysql_config = /usr/local/mysql/bin/mysql_config

  4. Compile as normal

    python setup.cfg config
    python setup.cfg build
    sudo python setup.cfg install

Now if only someone would make these changes in the port file, then trac installs would be super easy, instead of just easy-ish.