I've had a number of people ask me how I use Cairo on my Mac. There is of course the method of using git to upload the source tree and autoconfig/make it yourself. This is not generally how most want to use it from a consumer point of view. And in fact I rarely do. I usually the method described below.
1. Get Macports
Macports is the newly named version of Darwinports. It is like Gentoo for Linux. I have a number of very handy command line tools and XWindows tools which I get from the ports project. You should just be able to
download the latest macports binary and be set to go.
There's a wiki site there with additional help. And the irc channel (irc.freenode.net#macports) is pretty helpful too.
2. Update Macports
From a command line execute the following:
sudo port selfupdate
This will make sure that a) your ports system is up to date b) your snapshot of available packages is up to date. You can do this from time to time.
3. Install Cairo
From a command line execute the following:
sudo port install cairo +quartz +atsui
This will download cairo and any other dependent packages. It will take some time to install, since it compiles them locally. If you only want to use cairo under X11 apps, you can skip the +quartz/+atsui options.
4. Update Environment
By default, macports puts things in /opt/local directories. The install may or may not update your $PATH so that you can run programs installed via ports. But it doesn't seem to update the library path. To effect this, edit your local .profile file to include these three lines:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DYLD_LIBRARY_PATH=/opt/local/lib:$DYLD_LIBRARY_PATH
export LIBRARY_PATH=/opt/local/lib:$LIBRARY_PATH
5. Load Cairographics Package
Fire up VisualWorks (you need to restart it after making the change above if its running already). And then load Cairographics package from the OpenRepository. If you run under X11, then it should just work. If you run under aqua, there's issues with drawing to a window, but drawing to Pixmaps seems to work fine. I'm working out these drawing to a window issues currently (issues are two: 1) resizing the window tanks VW, 2) ever cairo drawing optiion must be followed by a notification to the VM to cast the changes up to the window).