# Template file for 'mpg123'
# Sync with mpg123-extras
pkgname=mpg123
version=1.33.5
revision=2
build_style=gnu-configure
# --with-cpu not necessary, upstream detects features correctly
# --with-optimization=0 makes the configure script respect xbps-src's defaults.
configure_args="--with-optimization=0 --with-default-audio=alsa"
hostmakedepends="pkg-config"
makedepends="alsa-lib-devel"
short_desc="Fast console MPEG audio decoder/player"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-only"
homepage="https://www.mpg123.org/"
changelog="https://www.mpg123.de/trunk/NEWS"
distfiles="${SOURCEFORGE_SITE}/mpg123/mpg123-${version}.tar.bz2"
checksum=0d7ebc8da0aff3ca383c8c6b5a6adbe402ee5bb256685b8c5499f3a739f9d6dd

if [ "$XBPS_TARGET_LIBC" = musl ]; then
	# No LFS required with musl
	configure_args+=" --disable-lfs-alias"
fi

libmpg123_package() {
	short_desc+=" - Runtime library"
	pkg_install() {
		vmove "usr/lib/*.so.*"
		vmove usr/lib/mpg123/output_dummy.so
		vmove usr/lib/mpg123/output_oss.so
		vmove usr/lib/mpg123/output_alsa.so
	}
}
mpg123-devel_package() {
	depends="libmpg123-${version}_${revision}"
	short_desc+=" - Development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
