Yuce's Blog

Cognitive dissonance is yoga for the brain.*

ReportLab on OSX


It's easy to compile ReportLab on OSX (in my case, 10.8). The only problem is, you'll get the following warning:

# installing without freetype no ttf, sorry!
# You need to install a static library version of the freetype2 software

Don't try to brew it yet. OSX already has freetype2 installed on versions before 10.7. For 10.7 and later make sure you install XQuartz. Then we just need to help ReportLab installer to help find it.

Download ReportLab, and insert the following lines around after line 104 (after # attempt to make sure we pick freetype2 over other versions):

aDir(I, "/usr/X11/include") 
aDir(L, "/usr/X11/lib")

Remove the build continue.

python, reportlab, freetype2, osx, tricks

Compiling Python Extension Modules on Mac OSX 10.6


If you get the following error when you are compiling a Python C extension module in Mac OSX 10.6:

/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
spammodule.c:63: fatal error: error writing to -: Broken pipe compilation terminated.

Run setup.py as follows:

ARCHFLAGS="-arch i386 -arch x86_64" python setup.py build

python, osx, tricks