SUMMARY="libmikmod is a lib for playing mod files"
DESCRIPTION="
libmikmod is a library supporting many formats, including mod, s3m, it, and xm.
"
HOMEPAGE="http://mikmod.sourceforge.net" 
SRC_URI="http://sourceforge.net/projects/mikmod/files/libmikmod/3.3.3/libmikmod-3.3.3.tar.gz"
CHECKSUM_SHA256="79f02478c5abd8b2af73df4cc5f9d52625aa044327c01563168e270cf79b2437"
LICENSE="GNU LGPL v2.1"
COPYRIGHT="1998-2004 Jean-Paul Mikkers, Jake Stine, Frank Loemker, Steve McIntyre, Peter Amstutz, and Miodrag Vallat."
REVISION="2"

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

PROVIDES="
	libmikmod$secondaryArchSuffix = $portVersion compat >= 3.3
	lib:libmikmod$secondaryArchSuffix = 3.2.0 compat >= 3
	"

REQUIRES="
	haiku${secondaryArchSuffix}
	lib:libsdl$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	"

BUILD_REQUIRES="
	devel:libsdl$secondaryArchSuffix
	"
	
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:gcc$secondaryArchSuffix
	cmd:libtool
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:make
	"

PATCHES="libmikmod-3.3.3.patch"

BUILD()
{
	libtoolize --force --copy --install
	aclocal --install -I m4
	autoconf
	automake --add-missing
	runConfigure ./configure --enable-sdl 
	make
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libmikmod
	fixPkgconfig
	fixDevelopLibDirReferences $binDir/libmikmod-config
	
	# devel package
	packageEntries devel \
		$developDir $binDir/libmikmod-config \
		$dataDir
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	libmikmod${secondaryArchSuffix}_devel = $portVersion
	cmd:libmikmod_config$secondaryArchSuffix
	devel:libmikmod$secondaryArchSuffix = 3.2.0 compat >= 3
	"

REQUIRES_devel="
	libmikmod$secondaryArchSuffix == $portVersion base
	"
