pkgname=cairo
pkgver=1.18.4
pkgdesc="2D graphics library with support for multiple output devices"
homepage="https://cairographics.org/"
arch=(x86_64)
license=('LGPL-2.1-only OR MPL-1.1')
depends=(
  bash
  fontconfig
  freetype
  glib
  glibc
  libpng
  pixman
  zlib
)
makedepends=(
  meson
)
sources=("${pkgname}-${pkgver}.tar.bz2")
urls=("https://gitlab.freedesktop.org/cairo/cairo/-/archive/${pkgver}/${sources[0]}")
md5sums=("bfe8e342fc263858c58a9c83f9ae3e58")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  local meson_args=(
    --prefix=/usr
    --buildtype=release
    -D dwrite=disabled
    -D fontconfig=enabled
    -D freetype=enabled
    -D png=enabled
    -D quartz=disabled
    -D tee=disabled
    -D xcb=disabled
    -D xlib=disabled
    -D xlib-xcb=disabled
    -D zlib=enabled
    -D tests=disabled
    -D lzo=disabled
    -D gtk2-utils=disabled
    -D glib=enabled
    -D spectre=disabled
    -D symbol-lookup=disabled
    -D gtk_doc=false
  )
  meson setup build "${meson_args[@]}"
  meson compile -C build
}

src_install() {
  meson install -C build --destdir "$pkgdir"
}

# vim:ft=sh syn=sh et sw=2:
