SUMMARY="A very light software real-time synthesizer"
DESCRIPTION="FluidLite is a very light version of FluidSynth \
designed to be hardware, platform and external dependency independant.
It only uses standard C libraries.

It also adds support for SF3 files (SF2 files compressed with ogg vorbis) \
and an additional setting to remove the constraint of channel 9 (drums): \
fluid_settings_setstr(settings, "synth.drums-channel.active", "no"); \
you can still select bank 128 on any channel to use drum kits.

FluidLite keeps very minimal functionnalities (settings and synth), \
therefore MIDI file reading, realtime MIDI events and audio output must be \
implemented externally."
HOMEPAGE="https://github.com/divideconcept/FluidLite"
COPYRIGHT="2016 Robin Lobel"
LICENSE="GNU LGPL v2.1"
REVISION="1"
srcGitRev="e64b4b3161cab212fffe7d1d3fb1c05750c363cc"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="b6c4bff689bfd2b8e57b771640da019ee6cf3580a96ddced3954f9f84b66410f"
SOURCE_DIR="FluidLite-$srcGitRev"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	fluidlite$secondaryArchSuffix = $portVersion
	lib:libfluidlite$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libogg$secondaryArchSuffix
	lib:libvorbis$secondaryArchSuffix
	lib:libvorbisfile$secondaryArchSuffix
	"

PROVIDES_devel="
	fluidlite${secondaryArchSuffix}_devel = $portVersion
	devel:libfluidlite$secondaryArchSuffix = $portVersion compat >= 1
	"
REQUIRES_devel="
	fluidlite$secondaryArchSuffix == $portVersion base
	devel:libogg$secondaryArchSuffix
	devel:libvorbis$secondaryArchSuffix
	devel:libvorbisfile$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libogg$secondaryArchSuffix
	devel:libvorbis$secondaryArchSuffix
	devel:libvorbisfile$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	cmake -DCMAKE_BUILD_TYPE=Release \
		    $cmakeDirArgs \
		    -DENABLE_SF3=YES \
		    -DSTB_VORBIS=NO .
 
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLib libfluidlite
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
