# Contributor: Joshua Murphy <joshuamurphy@posteo.net>
# Maintainer: Joshua Murphy <joshuamurphy@posteo.net>
pkgname=sc-controller
pkgver=0.4.8.13
pkgrel=1
pkgdesc="User-mode driver and GTK3 based GUI for the Steam Controller"
url="https://github.com/Ryochan7/sc-controller"
# s390x: py3-vdf
arch="all !s390x"
license="GPL-2.0-only"
depends="
	gtk+3.0
	gtk-layer-shell
	librsvg
	libusb
	py3-cairo
	py3-evdev
	py3-gobject3
	py3-libacl
	py3-vdf
	"
makedepends="
	linux-headers
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	zlib-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Ryochan7/sc-controller/archive/v$pkgver.tar.gz
	fix-tests.patch"

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="
f0220a409b3b312d73bbebec8128d8a5871f4a97a53d5d98034a9d2e31ce9f93c3b5d01e87c6d4bf8dea6ad96ffb53bddacfe490dc5068159275cfe6b8313e80  sc-controller-0.4.8.13.tar.gz
3791d2f3dbf1d59427e76765196d12f39f763dc2ac57b71ad200e44dc9c5d9e01e9f1893ac2f36f5899048dc5443ade1a75ad4dd825bc965c69f719a1185cc25  fix-tests.patch
"
