cinder/Cinder — pull request #363 by pizthewiz (2013-08-04 20:37:15+00:00)
Title: Cairo block libs i386/x86_64 fat for OS X, #361

My build notes are below in case newer releases are needed at some point, they are re-crafted from the [end to end build for mac os x](http://www.cairographics.org/end_to_end_build_for_mac_os_x/) document.

--

Built on `OS X 10.8.4` with _Command Line Tools_ of `Xcode 4.6.3 (4H1503)`. I was unable to build with the tools provided by `Xcode 5 DP4` or build on `OS X 10.9 DP4`, even with the `Xcode 4.6.3` tools, likely the result of building really old releases.

Grab and untar/gzip `libpng-1.4.3`, `libpixman-0.19.2` and `cairo-1.10.0`. You'll need `pkg-config` as well, I simply installed it via [Homebrew](http://brew.sh/).

```
export BuildDir=/tmp/NILE
mkdir -p ${BuildDir}
```

```
export MACOSX_DEPLOYMENT_TARGET=10.7
export LDFLAGS="-arch i386 -arch x86_64"
export CFLAGS="-Os -arch i386 -arch x86_64"
```

#### libpng
```
cd libpng-1.4.3
./configure --prefix=${BuildDir} --disable-dependency-tracking
make && make install
```

#### pixman
```
cd pixman-0.19.2
./configure --prefix=${BuildDir} --disable-dependency-tracking
make && make install
```

#### cairo
given how old a release we are using,, we need to patch a super old ATSUI API use issue, see [bug 394930](https://bugs.freedesktop.org/show_bug.cgi?id=39493)
```
cd cairo-1.10.0
curl "http://cgit.freedesktop.org/cairo/patch/?id=8664df767cb9dbe48647f9853e3dcf551701d3ca" -o cairo-quartz-font.patch
patch -p1 < cairo-quartz-font.patch
```

```
./configure --prefix=${BuildDir} --disable-dependency-tracking --disable-xlib --without-x \
pixman_CFLAGS=-I${BuildDir}/include/pixman-1 pixman_LIBS="-L${BuildDir}/lib -lpixman-1" \
png_REQUIRES=libpng png_CFLAGS=-I${BuildDir}/include png_LIBS="-L${BuildDir}/lib -lpng"
make && make install
```