# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=appstream-glib
pkgver=0.8.3
pkgrel=2.1
pkgdesc="Objects and methods for reading and writing AppStream metadata"
url="https://people.freedesktop.org/~hughsient/appstream-glib/"
arch=(x86_64 aarch64)
license=(LGPL-2.1-or-later)
depends=(
  cairo
  curl
  fontconfig
  freetype2
  gcc-libs
  gdk-pixbuf2
  glib2
  glibc
  gtk3
  json-glib
  libarchive
  libyaml
  pacman
  pango
  util-linux-libs
)
makedepends=(
  git
  gobject-introspection
  gperf
  gtk-doc
  meson
)
provides=(
  appdata-tools
  libappstream-glib.so
)
conflicts=(appdata-tools)
replaces=(appdata-tools)
source=("git+https://github.com/hughsie/appstream-glib?signed#tag=appstream_glib_${pkgver//./_}")
b2sums=('a356111d3daa1b62e8f0c67b4328c937f913b96fcc066d45a27a9bf0269db7aa3c71bfe5a4d11e0272aa7857c028766413adf293f8e8fdbc263162da6df4c6d1')
validpgpkeys=(
  163EB50119225DB3DF8F49EA17ACBA8DFA970E17 # Richard Hughes <richard@hughsie.com>
)

prepare() {
  cd $pkgname
}

build() {
  local meson_options=(
    -D alpm=true
    -D gtk-doc=true
    -D rpm=false
  )

  arch-meson $pkgname build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
  rm -r "$pkgdir/usr/share/installed-tests"
}

# vim:set sw=2 sts=-1 et:
