SUMMARY="Simple Direct Layer Mixer Library"
DESCRIPTION="
sdl_mixer is a simple multi-channel audio mixer library. It supports any \
number of simultaneously playing channels of 16 bit stereo audio, plus a \
single channel of music, mixed by the popular FLAC, MikMoD MOD, Timidity MIDI, \
Ogg Vorbis, and SMPEG MP3 libraries.
"
HOMEPAGE="http://www.libsdl.org/projects/SDL_mixer/" 
SOURCE_URI="http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12.tar.gz"
CHECKSUM_SHA256="1644308279a975799049e4826af2cfc787cad2abb11aa14562e402521f86992a"
LICENSE="Zlib"
COPYRIGHT="1997-2012 Sam Lantinga"
REVISION="6"

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	sdl_mixer$secondaryArchSuffix = $portVersion compat >= 1.2
	lib:libSDL_mixer$secondaryArchSuffix = 1.2_0.12.0 compat >= 1.2_0
	lib:libSDL_mixer_1.2$secondaryArchSuffix = 0.12.0 compat >= 0
	cmd:playwave$secondaryArchSuffix
	cmd:playmus$secondaryArchSuffix	
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libSDL$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libFLAC$secondaryArchSuffix
#	lib:libfluidsynth$secondaryArchSuffix
	lib:libmad$secondaryArchSuffix
	lib:libvorbis$secondaryArchSuffix
	lib:libogg$secondaryArchSuffix
	lib:libmikmod$secondaryArchSuffix
	lib:libsmpeg$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	"

BUILD_REQUIRES="
	devel:libsdl$secondaryArchSuffix
	devel:libogg$secondaryArchSuffix
	devel:libflac$secondaryArchSuffix
#	devel:libfluidsynth$secondaryArchSuffix
	devel:libmad$secondaryArchSuffix
	devel:libvorbis$secondaryArchSuffix
	devel:libogg$secondaryArchSuffix
	devel:libmikmod$secondaryArchSuffix
	devel:libsmpeg$secondaryArchSuffix	
	"
	
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtool
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:sdl_config$secondaryArchSuffix
	cmd:smpeg_config$secondaryArchSuffix
	cmd:libmikmod_config$secondaryArchSuffix
	"

SOURCE_DIR="SDL_mixer-$portVersion"

BUILD()
{
	libtoolize --force --copy --install
	aclocal --force --install -I acinclude
	autoconf
	runConfigure ./configure \ 
			SMPEG_CONFIG=smpeg_config$secondaryArchSuffix
	make $jobArgs
}

INSTALL()
{
	make install

	# remove libtool library file
	rm $libDir/libSDL_mixer.la

	prepareInstalledDevelLibs libSDL_mixer \
			libSDL_mixer-1.2	
	fixPkgconfig

	packageEntries devel \
			$developDir
}

PROVIDES_devel="
	sdl_mixer${secondaryArchSuffix}_devel = $portVersion
	devel:sdl_mixer$secondaryArchSuffix = 1.2.12 compat >= 1.2
	devel:libSDL_mixer$secondaryArchSuffix = 1.2_0.12.0 compat >= 0
	devel:libSDL_mixer_1.2$secondaryArchSuffix = 0.12.0 compat >= 0
	"

REQUIRES_devel="
	sdl_mixer$secondaryArchSuffix == $portVersion base
	"
