# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mutagen
pkgver=1.40.0
pkgrel=1
pkgdesc="Audio tagger implemented in Python"
url="https://github.com/quodlibet/mutagen"
arch="noarch"
license="GPL-2.0-or-later"
depends="python3 py-mutagen"
makedepends="python3-dev"
checkdepends="py3-pytest py3-setuptools py3-hypothesis"
subpackages="$pkgname-doc py-$pkgname:py"
source="$pkgname-$pkgver.tar.gz::https://github.com/quodlibet/$pkgname/archive/release-$pkgver.tar.gz"

# we dont have all the needed deps for running the test suite yet
options="!check"

builddir="$srcdir/$pkgname-release-$pkgver"

build() {
	cd "$builddir"
	python3 setup.py build
}

package() {
	cd "$builddir"
	python3 setup.py install --root="$pkgdir"
}

check() {
	cd "$builddir"
	python3 setup.py test
}

py() {
	pkgdesc="Python library for mutagen"
	depends="python3"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

sha512sums="f167eabf8885d822f8e11c34720e24ad49b696d7c479ab957a4c6e84a6feb025c69175352cea610da6b119d11b66fe0fd225b95ce522d7c73f000d6bfffef77c  mutagen-1.40.0.tar.gz"
