Mono.Cairo in Unity 3.5 on OS X

I can’t figure out how to use Cairo in an editor script on OS X Lion. I’ve tried adding the assembly in MonoDevelop but Unity overwrites that immediately. I can copy the assembly to the Unity assets, but then it fails to find “libcairo-2.dll”. I’ve tried adding mappings to various config files to point it at libcairo.2.dylib, but nothing seems to work. I set MONO_LOG_LEVEL to debug and watch it try to load the library and it fails while looking for various libcairo-2.dll/so/dll.so/dylib/dll.dylib, etc.

I am using .Net 2.0 in the player settings. Any pointers?

I’m trying to generate textures. If not Cairo, is there another graphics API that does work?

My, somewhat hacky implementation, was to re-compile Mono.Cairo with a reference to /Library/Frameworks/Mono.framework/Libraries/libcairo.2.dylib and then reference this managed assembly by adding it to Assets/Plugins.

For use in editor you also need to replace any instances of the Mono.Cairo.dll assembly located in the Unity Editor app bundle.

This worked for me at least.