# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=faudio
pkgver=24.09
pkgrel=0
pkgdesc="Accuracy-focused XAudio reimplementation for open platforms"
url="https://fna-xna.github.io/"
arch="all"
license="Zlib"
makedepends="cmake samurai sdl2-dev"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/FNA-XNA/FAudio/archive/$pkgver.tar.gz"
builddir="$srcdir/FAudio-$pkgver"

build() {
	cmake -G Ninja -B build \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=1 \
		-DBUILD_TESTS=1
	cmake --build build
}

check() {
	cd build
	./faudio_tests
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f74282a7df749f50026bb07309ca20fb12b098cc24b003f8b93f4f6868a3d6f4343d4bd06b947b17d9ec6c1d08f88e477da259397d745f9cc41321f7c5722448  faudio-24.09.tar.gz
"
