pkgname=gdk-pixbuf
pkgver=2.42.12
pkgdesc="An image loading library"
url="https://wiki.gnome.org/Projects/GdkPixbuf"
arch=(x86_64)
license=(LGPL-2.0-or-later)
depends=(
  glib
  glibc
  shared-mime-info
)
makedepends=(
  gobject-introspection
  meson
  python-docutils
)
sources=("${pkgname}-${pkgver}.tar.xz"
  "gdk-pixbuf-query-loaders.HOOK"
)
urls=("https://download.gnome.org/sources/gdk-pixbuf/${pkgver%.*}/${sources[0]}"
  "gdk-pixbuf-query-loaders.HOOK"
)
md5sums=("f986fdbba5ec6233c96f8b6535811780"
  "3fd88df393b0c4f0a016b7485cbfc320"
)

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

src_build() {
  local meson_args=(
    --prefix=/usr
    --buildtype=release
    --wrap-mode=nofallback
    -D png=enabled
    -D gif=enabled
    -D others=enabled
    -D tiff=disabled
    -D jpeg=enabled
    -D builtin_loaders=png,jpeg
    -D relocatable=false
    -D tests=false
    -D installed_tests=false
    -D gio_sniffing=true
    -D gtk_doc=false
    -D introspection=enabled
    -D man=true
  )
  meson setup build "${meson_args[@]}"
  meson compile -C build
}

src_install() {
  meson install -C build --destdir "$pkgdir"
  leaf_install_hook ${filedir}/${sources[1]}
}

src_preremove() {
  rm -vf /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
}

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