# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-reedsolo
pkgver=1.7.0
pkgrel=2
pkgdesc="Pure-Python implementation of a Reed–Solomon codec"
url="https://pypi.org/project/reedsolo/"
license="Unlicense OR MIT-0"
arch="all"
depends="python3"
makedepends="
	cython
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/tomerfiliba/reedsolomon/archive/v$pkgver/py3-reedsolo-$pkgver.tar.gz
	cythonize.patch
	"
builddir="$srcdir/reedsolomon-$pkgver"

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

check() {
	PYTHONPATH="$(echo $PWD/build/lib*)" pytest
}

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

sha512sums="
c7d2ae8444c9e3d6646587f85fe0085a7579cc58d2f4bca3fb89632df4873e2664c81f06ee2e75e928248bb558a7fd8d101a043187ce05e70a079b031981c374  py3-reedsolo-1.7.0.tar.gz
f8983f4b7f8cdf20d01bf5708ffe3cd7d8df737c9940c2d5348f4b60cc2930fbcb3c623a18bf5d7c2af0bf97adb2b3cb58fc3a155aed19b886cb441db1ce96c6  cythonize.patch
"
