SUMMARY="Simple Direct Media Layer Net Library"
DESCRIPTION="
This is a small simple cross-platform networking library for SDL.
"
HOMEPAGE="http://www.libsdl.org/projects/SDL_net" 
SRC_URI="http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8.tar.gz"
CHECKSUM_SHA256="5f4a7a8bb884f793c278ac3f3713be41980c5eedccecff0260411347714facb4"
LICENSE="Zlib"
COPYRIGHT="1997-2012 Sam Lantinga"
REVISION="4"
ARCHITECTURES="x86 x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	sdl_net$secondaryArchSuffix = $portVersion
	lib:libSDL_net$secondaryArchSuffix = 1.2_0.8.0 compat >= 1.2_0
	lib:libSDL_net_1.2$secondaryArchSuffix = 0.8.0 compat >= 1.2	
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libsdl$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	"

BUILD_REQUIRES="
	devel:libsdl$secondaryArchSuffix
	"
	
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtool
	cmd:make
	cmd:pkg_config
	cmd:sdl_config
	"
	
PATCHES="sdl_net-1.2.8.patch"

SOURCE_DIR="SDL_net-$portVersion"

BUILD()
{
	libtoolize --force --copy --install
	aclocal --force --install -I acinclude
	autoconf
	runConfigure ./configure
	make
}

INSTALL()
{
	make install

	prepareInstalledDevelLib libSDL_net
	prepareInstalledDevelLib libSDL_net-1.2
	fixPkgconfig

	packageEntries devel \
			$developDir
}

PROVIDES_devel="
	devel:sdl_net${secondaryArchSuffix} = $portVersion compat >= 1.2
	devel:libSDL_net$secondaryArchSuffix = 1.2_0.8.0 compat >= 0
	devel:libSDL_net_1.2$secondaryArchSuffix = 0.8.0 compat >= 0
	"

REQUIRES_devel="
	sdl_net$secondaryArchSuffix == $portVersion base
	"
