pkgname=libxmlb
pkgver=0.3.24
pkgdesc="Library to help create and query binary XML blobs"
homepage="https://github.com/hughsie/libxmlb"
license=("LGPL-2.1+")
depends=(glib:2 xz-utils zstd)
bdepends=(meson)
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/hughsie/libxmlb/archive/${pkgver}.tar.gz")
sha512sums=("534e5fe01727b9427137c51984c9ddced91b842c712d4f34f582193c838429b396be6e444246b324d39f6732fdf582a7d89570049f4f48d4a161aff82e33aa49")

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

src_build() {
  local meson_args=(
    --prefix=/usr
    --buildtype=release
    --wrap-mode=nodownload
    -D python.bytecompile=1
    -D lzma=enabled
    -D zstd=enabled
    -D gtkdoc=false
    -D introspection=false
    -D stemmer=false
    -D tests=true
  )
  meson setup build "${meson_args[@]}"
  meson compile -C build
}

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

src_install() {
  meson install -C build --destdir "$pkgdir"
  rm -rf "${pkgdir}"/usr/{libexec,share}/installed-tests
}

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