SUMMARY="A free, cross-platform, audio I/O library"
DESCRIPTION="
Port Audio is a free, cross-platform, audio I/O library.
"
HOMEPAGE="http://portaudio.com"
SOURCE_URI="http://portaudio.com/archives/pa_stable_v19_20111121.tgz"
CHECKSUM_SHA256="9c26d1330d506496789edafe55b0386f20d83c4aa2c0e3f81fbeb0f114ab1b99"
LICENSE="MIT"
COPYRIGHT="1999-2011 Ross Bencina and Phil Burk"

REVISION="1"

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

PROVIDES="
	portaudio$secondaryArchSuffix = $portVersion
	lib:libportaudio$secondaryArchSuffix = 19
	"

REQUIRES="
	haiku
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:cmake
	cmd:gcc${secondaryArchSuffix}
	cmd:ld${secondaryArchSuffix}
	cmd:make
	"

BUILD_REQUIRES="
	cmd:gcc${secondaryArchSuffix}
	cmd:cmake
	cmd:make
	"

SOURCE_DIR="portaudio"

BUILD()
{
	cmake .
	make
}

INSTALL()
{
	mkdir -p $libDir
	cp bin/Win32/libportaudio.so $libDir
	mkdir -p $developDir/lib
	#cp bin/Win32/libportaudio.so $developDir/lib/
	cp bin/Win32/libportaudio_static.a $developDir/lib/
	mkdir -p $includeDir
	cp include/* $includeDir

	prepareInstalledDevelLibs \
		libportaudio

	fixPkgconfig
	
	packageEntries devel \
		$developDir
}

PROVIDES_devel="
	devel:libportaudio = 19
	devel:libportaudio_static = 19
	"

REQUIRES_devel="
	libportaudio == $portVersion base
	"
