# Maintainer: Dylan Van Assche <me@dylanvanassche.be>
# Contributor: Dylan Van Assche <me@dylanvanassche.be>

pkgname=obex-capabilities
pkgver=0.2.1
pkgrel=6
pkgdesc="Script to generate Bluetooth OBEX capabilities XML files at runtime"
url="https://gitlab.com/postmarketOS/obex-capabilities"
arch="noarch"
license="GPL-3.0-or-later"
depends="py3-dbus"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://gitlab.com/postmarketos/obex-capabilities/-/archive/$pkgver/obex-capabilities-$pkgver.tar.gz"

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
}

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

sha512sums="
a6a63ce4dd3c4d129f1ccdabe3e2eb03b8d9a43f71b8afa29a0f46d6ccbc2685cb33d895ad0146b9c021d8f68730bc21f8b804d89db6660980eae8a7ec3a1ce2  obex-capabilities-0.2.1.tar.gz
"
