# Template file for 'fluidsynth'
pkgname=fluidsynth
version=2.5.4
revision=1
_gcem_commit=012ae73c6d0a2cb09ffe86475f5c6fba3926e200
build_style=cmake
make_check_target=check
configure_args="-Denable-sdl3=ON -Denable-ladspa=ON -Denable-portaudio=ON"
hostmakedepends="pkg-config"
makedepends="SDL3-devel glib-devel jack-devel libsndfile-devel pipewire-devel pulseaudio-devel
 libinstpatch-devel readline-devel portaudio-devel ladspa-sdk"
short_desc="Real-time software synthesizer based on the SoundFont 2 specifications"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://www.fluidsynth.org/"
changelog="https://github.com/FluidSynth/fluidsynth/releases"
distfiles="https://github.com/FluidSynth/fluidsynth/archive/v${version}.tar.gz
 https://github.com/kthohr/gcem/archive/${_gcem_commit}.tar.gz"
checksum="72f5720328fe44e2e5c67813885f0a6b4b004d048bd2eeeb0c0064074ebff530
 34ab0ee87a9eb26d3087fa9b49c2572ea8ee03db0c9705b83648301a3a3fc172"
skip_extraction="${_gcem_commit}.tar.gz"

post_extract() {
	vsrcextract -C gcem ${_gcem_commit}.tar.gz
}

libfluidsynth_package() {
	short_desc+=" - runtime library"
	pkg_install() {
		vmove "usr/lib/*.so.*"
	}
}

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