# Maintainer:
pkgname=libaudec
pkgver=0.3.4
pkgrel=3
pkgdesc="lib audio decoder"
url="https://git.sr.ht/~alextee/libaudec"
arch="all"
license="GPL-3.0-or-later"
depends_dev="$pkgname"
makedepends="
	libsamplerate-dev
	libsndfile-dev
	meson
	"
subpackages="$pkgname-static $pkgname-dev $pkgname-tools"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~alextee/libaudec/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	abuild-meson \
		-Dtests="$(want_check && echo true || echo false)" \
		. output
	meson compile -C output
}

check() {
	meson test --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

tools() {
	pkgdesc="$pkgdesc (tools)"

	amove usr/bin
}

sha512sums="
9c50b866e2f0d1897d7a55a83263e74c3a1cf77772a52bd446632c9a92f2ccbbb3e2e1ecfde8b05fc41e59e4d60a57935a656ec8f40b6680fc4bbe201ea045ef  libaudec-0.3.4.tar.gz
"
