Skip to main content
Inspiring
December 17, 2020
Answered

stand alone cairo lib for macos

  • December 17, 2020
  • 1 reply
  • 1718 views

Dear AE fellows,

I wrote a plugin for AE for windows which used cairo library.

I simply used the standalone cairo binary for windows which was easily downloaded from thr web. 

Now I'd like to rewrite my plugin for MacOs.

Do you know if there is standalone cairo library for macos?

 

Yaroslav.

 

Correct answer James Whiffin

Hi Yaro

I'm not sure if it will work, but here's the cairo libraries I use (statically compiled). 

lib archive 

1 reply

James Whiffin
James WhiffinCorrect answer
Legend
December 21, 2020

Hi Yaro

I'm not sure if it will work, but here's the cairo libraries I use (statically compiled). 

lib archive 

Inspiring
January 8, 2025

Hi James, I'm having issues compiling cairo for macos (working in windows, statically). I did try your statically compiled libraries (and other from web), but I'm not sure for settings in xcode. Tried pretty much everything I could think of. First of all, in xcode, mach-O type should be Bundle or  Static library? If I bundle it, it reads dylib from my drive (but then user cannot run this). If I compile it "Static Library" I get error in AE couldnt find entry point. (Also I signed/notarised/stepled my plugin). Do I need to type a certian directive in header file (like for windows CAIRO_WIN32_STATIC_BUILD). Any help is much appreciated!

James Whiffin
Legend
January 20, 2025

So, I finally made it work, after a lot of pain 😄 

First, when getting cairo library (for example macports), it should be for both architecture's and static, so for example cairo for macports would be 

 

 

sudo port cairo +universal +static

 

 

but dependencies should also be static. And see attached image for which dependencies you need:

Some libraries I couldn't get static (like libpixman), and then I had to get tar.gz file, and use make to compile static library. (This was a bit more complicated, I used claude for help). Then, everything else in xcode is pretty straightforward, in other linker flags I left empty, library search path can be working directory (when you add libs to xcode, make sure to copy to working dir), and then you can just use macro: $(PROJECT_DIR) in Library Search Paths. in header search paths you add /opt/local/include and in build phases all libs have to link with binary (although this is done automatically if you drag them to xcode).

 

If someone needs these static libs, contact me at info@mirzakadic.com and I will send them.


Nice work! The newer versions of cairo have a lot more dependencies as seen in your screenshot. The older versions just required libpng and libpixman.