One of the packages I wanted to install is ReportLab. Unfortunately, it kept building without Freetype support, so TrueType support was unavailable. This wasn't acceptable, so I started looking for ways to build it with FreeType support in.
According to this, I would have to download and build FreeType separately. That would not do (because I was being lazy, plus, I already had FreeType installed by Apple — I'd already tried to run brew install freetype, and Homebrew warned me that FreeType already comes with Lion in
Initially, I tried adding the respective include and library paths in
setup.cfg. Didn't work. Eventually, after trying seriously to grok the evil that is distutils code, I found that there is a class called
inc_lib_dirs, and in its implementation of
__call__(), it checks the platform, and makes a lot of calls to
aDir(), setting either an include path (first argument uppercase 'I', no quotes) or a library path (first argument uppercase 'L'; again, without the quotes). I simply added new lines for the appropriate include/library, saved and ran python setup.py build. This worked, so I ran
Update: This post talks about building PIL on Snow Leopard with FreeType2 support, but the instructions also work for ReportLab. The tl;dr version is:
- download PIL (or ReportLab) source package
- unpack it
- change directory into the package folder
- create a new file called setup_site.py with the contents: FREETYPE_ROOT = "<freetype library path>", "<freetype header path>"
- run python setup.py build (or install)