# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ttaenc
pkgver=3.4.1
pkgrel=2
pkgdesc="TrueAudio lossless compressor"
url="https://sourceforge.net/projects/tta/"
arch="all"
license="GPL-2.0-only"
options="!check" # no tests
source="https://downloads.sourceforge.net/tta/tta/ttaenc-src/ttaenc-$pkgver-src.tgz
	fix-musl.patch"
builddir="$srcdir/ttaenc-$pkgver-src"

prepare() {
	default_prepare

	# sse is only available on x86*
	case "$CARCH" in
		x86*) ;;
		*) sed 's|-msse||' -i Makefile ;;
	esac
}

build() {
	make
}

package() {
	# mediocre makefile
	mkdir -p "$pkgdir"/usr/bin
	mv ttaenc "$pkgdir"/usr/bin
}

sha512sums="489f9a2e0f94a82f12302f076e33062104e58688ffde97e742ad3c8c226bd0000133c539e9111e10f2d24c176e0b7ddd0a76e60bd3baafa53c29b3cd89ada06d  ttaenc-3.4.1-src.tgz
db49910a45cc4ac6559bb58554cb78daca722bbe273bf9fbf8f86479efe9f4cb8ecb1101e53a7bcdd07b7143a5aa90a62af7cef52654c8d77981148b42ef294c  fix-musl.patch"
