20seven

Devigner blog about development and design

A Quick Way to Build Graphviz and Pygraphviz

Eric Holscher put up a nice screencast Saturday on using the excellent . I’ve used it before but wasn’t aware of all the nice features the guys had built into it so I needed to get my Mac up to speed with graphviz. Fine and dandy but pygraphviz didn’t play nicely with the graphviz images available, so I needed to build it.
I am providing my shell script that will download and build all dependencies including graphviz and pygraphviz for use with django command extensions.

Instructions

ZIP DOWNLOAD: gv-pygv.sh

Once you have the download, extracted the zip file. Add the following to your bash_profile.

export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

Then in terminal simply run:

sh gv-pygv.sh

The script will download and build the following dependencies along with Graphviz and pygraphviz.

  • cairo
  • freetype
  • gd
  • fontconfig
  • urw-fonts
  • glib
  • libpng
  • pango
  • zlib

In addition, I ran into dependency issues with Cairo so i have included those in the shell script but commented them out. If you run into issues with pkg-config and/or pixman, simply uncomment them and re-run the shell script.

NOTE: I take no responsibilities if your mac grows hair and implodes because of this shell script. You are however required to share any and all lottery winnings with me.