SUMMARY="Bauer stereophonic-to-binaural DSP library"
DESCRIPTION="The Bauer stereophonic-to-binaural DSP (bs2b) library and \
plugins is designed to improve headphone listening of stereo audio records. \
Recommended for headphone prolonged listening to disable superstereo \
fatigue without essential distortions."
HOMEPAGE="http://bs2b.sourceforge.net/"
COPYRIGHT="2009 Boris Mikhaylov"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://downloads.sourceforge.net/bs2b/libbs2b-$portVersion.tar.bz2"
CHECKSUM_SHA256="4799974becdeeedf0db00115bc63f60ea3fe4b25f1dfdb6903505839a720e46f"
PATCHES="libbs2b-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libbs2b$secondaryArchSuffix = $portVersion
	cmd:bs2bconvert$secondaryArchSuffix
	cmd:bs2bstream$secondaryArchSuffix
	lib:libbs2b$secondaryArchSuffix = 0.0.0 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libsndfile$secondaryArchSuffix
	"

PROVIDES_devel="
	libbs2b${secondaryArchSuffix}_devel = $portVersion
	devel:libbs2b$secondaryArchSuffix = 0.0.0 compat >= 0
	"
REQUIRES_devel="
	libbs2b$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsndfile$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:g++$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage libbs2b$secondaryArchSuffix \
	"$libDir"/libbs2b.so.0.0.0 \
	"$binDir"/bs2bconvert \
	"$binDir"/bs2bstream

BUILD()
{
	autoreconf -vfi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm "$libDir"/*.la

	prepareInstalledDevelLib libbs2b
	fixPkgconfig

	packageEntries devel \
		$developDir
}
