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

pkgname=evince
pkgver=40.4
pkgrel=1
pkgdesc="Document viewer (PDF, PostScript, XPS, djvu, dvi, tiff, cbr, cbz, cb7, cbt)"
url="https://wiki.gnome.org/Apps/Evince"
arch=(x86_64)
license=(GPL)
depends=(gtk3 libgxps libspectre gsfonts poppler-glib djvulibre t1lib dconf libsecret libsynctex
         gsettings-desktop-schemas gnome-desktop libarchive gst-plugins-base-libs gspell libhandy
         gvfs)
makedepends=(libnautilus-extension texlive-bin gobject-introspection docbook-xsl python gtk-doc git
             meson appstream-glib yelp-tools)
optdepends=('texlive-bin: DVI support')
provides=(libev{document,view}3.so)
groups=(gnome)
_commit=d5639b30081f8ded08aa6be64ca0d1954f8daa52  # tags/40.4^0
source=("git+https://gitlab.gnome.org/GNOME/evince.git#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
}
  
build() {
  arch-meson $pkgname build -D ps=enabled
  meson compile -C build
}

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

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