NAME="cairo"
DESC="2D graphics library with support for multiple output devices"
VERSION="1.17.6"
FILES=("https://download.gnome.org/sources/cairo/1.17/cairo-$VERSION.tar.xz")
HASHES=("c5a6f255af72a2e5faa8e6a53dd882e2")
DEPENDS=("libpng" "pixman" "glib" "fontconfig")

PACKAGE() {
  tar xf $NAME-$VERSION.tar.xz
  cd $NAME-$VERSION

  sed 's/PTR/void */' -i util/cairo-trace/lookup-symbol.c
  sed -e "/@prefix@/a exec_prefix=@exec_prefix@" \
    -i util/cairo-script/cairo-script-interpreter.pc.in

  ./configure --prefix=/usr     \
            --enable-gl         \
            --enable-xlib-xcb   \
            --disable-static    \
            --enable-tee
  make && make DESTDIR=${ROOTDIR} install

  cd .. && rm -rf $NAME-$VERSION
}
