Skip to content

Instantly share code, notes, and snippets.

@nddrylliog
Last active January 7, 2022 04:40
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nddrylliog/8870134 to your computer and use it in GitHub Desktop.
Save nddrylliog/8870134 to your computer and use it in GitHub Desktop.
Minimal cairo build - for the humanoid who already has everything and just needs vector graphics

You need both pixman and cairo, which you can find here: http://cairographics.org/releases/

Pixman configure:

../pixman-0.32.4/configure --prefix=/root/prefix --disable-libpng --disable-gtk

Cairo configure:

PKG_CONFIG_PATH=/root/prefix/lib/pkgconfig ../cairo-1.12.16/configure --prefix=/root/prefix --enable-xlib=no --enable-xcb=no --enable-xcb-shm=no --enable-win32=no --enable-quartz=no --enable-script=no --enable-ft=no --enable-fc=no --enable-ps=no --enable-pdf=no --enable-svg=no --enable-gobject=no --enable-trace=no --enable-interpreter=no --enable-png=no

PKG_CONFIG_PATH is important because cairo's configure is too dumb to figure out where pixman is otherwise.

This disables pretty much everything cairo cares about btw, so it's going to cry about stuff it really really doesn't advise you to disable (such as the PNG functionality), but it's okay if you just want to draw to an image surface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment