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

pkgname=gnome-autoar
pkgver=0.4.0
pkgrel=1
pkgdesc="Automatic archives creating and extracting library"
url="https://wiki.gnome.org/TingweiLan/GSoC2013Final"
arch=(x86_64)
license=(LGPL)
depends=(glib2 libarchive gtk3)
makedepends=(git gobject-introspection gtk-doc vala meson)
_commit=801ac0f565999697447628584e42d772b2b91fae  # tags/0.4.0^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-autoar.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build \
    -D gtk_doc=true \
    -D tests=true \
    -D vapi=true
  meson compile -C build
}

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

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