# Maintainer:  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Patrick Griffis <tingping@tingping.se>

pkgname=xdg-desktop-portal-gtk
pkgver=1.4.0
pkgrel=1
pkgdesc="A GTK+ backend for xdg-desktop-portal"
url="https://github.com/flatpak/xdg-desktop-portal-gtk"
arch=(x86_64)
license=(LGPL2.1)
depends=(gtk3)
makedepends=(xdg-desktop-portal python git evince)
optdepends=("evince: Print preview")
provides=(xdg-desktop-portal-impl)
_commit=7bea12533934abdd603982a39065477e8944df02  # tags/1.4.0^0
source=("git+https://github.com/flatpak/xdg-desktop-portal-gtk#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --libexecdir=/usr/lib
  make 
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  DESTDIR="$pkgdir" make install
}
