py2cairo HEAD at 2f1f378 (Update waf to check for xpyb) miscompiles on OSX 10.7 or 10.8 using waf because it always links to the System Python library even though a newer python-2.7.3 is being used and found with python-config. I am reporting this for Homebrew, a package installer for Macs. We have many users affected by this. The result of this issue is that we can't import cairo into python. I'll paste all my logs into a gist so you can easily see them. When we have installed python-2.7.3 into /usr/local, py2cairo finds this as evidenced from the config summary. Waf then builds everything but links to a different python. This can be seen from the output of otool. In the end, cairo will not import into /usr/local/bin/python. Here is the build output, otool output, and config.log: https://gist.github.com/3015993 As you can see from the config.log, it finds the python library by trying -lpython2.7 rather than inspecting python-config --libs. I think the is the main problem, but I'm not certain. I would offer a patch, but I can't figure one out. As a workaround, Homebrew is using configure to build py2cairo on Lion & Mt Lion. Because earlier OSX 10.6 Snow Leopard only has python2.6, the test you run that uses -lpython2.7 fails. So it tries another way that works. So waf does work on Snow Leopard. Please let us know if there's anything more we can offer to help get this fixed. 2bits @ github
I should also note that /usr/local/bin comes before /usr/bin in my PATH, and that I have my PYTHONPATH=/usr/local/lib/python2.7/site-packages set just in case.
I just thought I'd put a link to the Homebrew issue: https://github.com/mxcl/homebrew/issues/12893
I noticed your docs ask for some more info. I have python-2.7.3 cairo-1.12.2 py2cairo head @ 2f1f378 or previous stable versions.
We found we could export LINKFLAGS="-L/some/path/to/current/python/lib" and waf will work again building with clang on OSX Lion. Waf gets a different error with llvm-4.2.1, which doesn't understand -march=native. But it's good now at least we can stick with waf for Snow Leopard, Lion, and Mt. Lion because we can use clang and LINKFLAGS. I'll leave this open in case you want to reply.
I used to think that waf was an improvement over using autotools configure and distutils/setup.py. But I've had problems using waf too, and it's very difficult to work out what is going on. So for the Python 3 version of pycairo I'm going back to using distutils / setup.py as the main install method, with waf as the second option.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.