# Template file for 'libmt32emu'
pkgname=libmt32emu
version=2.7.0
revision=1
_version_string=${version//./_}
build_wrksrc=mt32emu
build_style=cmake
makedepends="$(vopt_if libsoxr libsoxr-devel)
 $(vopt_if libsamplerate libsamplerate-devel)"
short_desc="Emulate Roland MT-32, CM-32L and LAPC-I synthesizer modules"
maintainer="Joshua Krämer <joshua@kraemer.link>"
license="LGPL-2.1-or-later"
homepage="http://munt.sourceforge.net"
changelog="https://raw.githubusercontent.com/munt/munt/libmt32emu_2_7_0/mt32emu/NEWS.txt"
distfiles="https://github.com/munt/munt/archive/libmt32emu_${_version_string}.tar.gz"
checksum=5ede7c3d28a3bb0d9e637935b8b96484fadb409c9e5952a9e5432b3e05e5dbc1

build_options="libsoxr libsamplerate"
desc_option_libsoxr="Use libsoxr for sample rate conversion"
desc_option_libsamplerate="Use libsamplerate for sample rate conversion"
build_options_default="libsoxr"
vopt_conflict libsoxr libsamplerate

if [ "$build_option_libsoxr" -o "$build_option_libsamplerate" ]; then
	configure_args+=" -Dlibmt32emu_WITH_INTERNAL_RESAMPLER=off"
fi

post_install() {
	rm -r ${DESTDIR}/usr/share/doc
}

libmt32emu-devel_package() {
	short_desc+=" - development files"
	depends="${sourcepkg}>=${version}_${revision} ${makedepends}"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.so"
		vmove usr/lib/pkgconfig
	}
}
