# Contributor: David Demelier <markand@malikania.fr>
# Maintainer: David Demelier <markand@malikania.fr>
pkgname=vimiv
pkgver=0.9.1
pkgrel=9
pkgdesc="an image viewer with vim-like keybindings"
url="https://github.com/karlch/vimiv"
arch="all"
license="GPL-3.0-only"
depends="python3 py3-gobject3 gtk+3.0 py3-pillow"
makedepends="python3-dev py3-setuptools py3-gpep517 py3-wheel"
subpackages="$pkgname-doc $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/karlch/vimiv/archive/v$pkgver.tar.gz
	fix-appdata.patch::https://github.com/karlch/vimiv/pull/87.patch
	use-gpep517.patch
	"
options="!check" # needs xvfb

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest
}

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

sha512sums="
b500e5b54450238b6471c1ea0c0831dc6b16238a99b9fcb531bc93bd0aa0b92fa192cbf2dd29f1679856f840dd6f6e4d27971403c85b71b6f333c525b77d9e69  vimiv-0.9.1.tar.gz
faa13ca3dcb0ad0258369bdd32d094cf72f6b26d46d2605fae9931688b2fa9307e942565eb9be317f6ee6faf693aabf9e0ec4c4f1bdf6672e231c7a02ddb50d7  fix-appdata.patch
9262c89a2234760e656ee85495a169fa5b482bc80d6f52ed583874b1bc5ae37cdd697bbd950997d78ebaadf4eb596a08b9ca3a871ad0775ec26df32e45f9cded  use-gpep517.patch
"
