# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=pdfposter
pkgver=0.8.1
pkgrel=7
pkgdesc="Tool for scaling and tiling PDFs to multiple pages for printing"
url="https://gitlab.com/pdftools/pdfposter"
arch="noarch"
license="GPL-3.0-only"
depends="py3-pypdf"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://gitlab.com/pdftools/pdfposter/-/archive/v$pkgver/pdfposter-v$pkgver.tar.gz
	pypdf.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"

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 pytest test/unit
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a457b966ccc1239ed4a1aa06ef7d11d40e2499321e1ad51269f7bb00ff51ed8db3fd27a79fbb3051450044a81aa44c793606fb431664eef707fd0d4251de3ac9  pdfposter-v0.8.1.tar.gz
c7802b13acce93c9e8a32ade230884d55ef06982fa13fc041eabe10d96aa4314968c439776cc703ba17641fd5c380613a87433586334313a82858e79ad8ae13f  pypdf.patch
"
