# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=py3-audioread
_pkgname=audioread
pkgver=3.0.1
pkgrel=1
pkgdesc="Multi-library, cross-platform audio decoding"
url="https://github.com/beetbox/audioread"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-flit-core py3-gpep517"
checkdepends="ffmpeg py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-audioread" # Backwards compatibility
provides="py-audioread=$pkgver-r$pkgrel" # Backwards compatibility

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="
b362bf85372fa64a3ed54258e344787db4f15d19a9d959522339fc441eb7ae0d1394707e8c3aa6bc77a42cc790650670d84800f1f3885efe932f718ed0a35bc1  audioread-3.0.1.tar.gz
"
