SUMMARY="The OpenGL Extension Wrangler Library"
DESCRIPTION="
The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source \
C/C++ extension loading library. GLEW provides efficient run-time mechanisms \
for determining which OpenGL extensions are supported on the target platform.
"
LICENSE="BSD (3-clause)"
COPYRIGHT="2007 The Kronos Group Inc. 
	2002-2007 Milan Ikits 
	2002-2007 Marcelo E. Magallon 
	2002 Lev Povalahev"
HOMEPAGE="http://glew.sourceforge.net" 
SRC_URI="http://downloads.sourceforge.net/project/glew/glew/${portVersion}/glew-${portVersion}.tgz"
REVISION="1"
CHECKSUM_MD5="2f09e5e6cb1b9f3611bcac79bc9c2d5d"

ARCHITECTURES="x86 ?x86_gcc2 ?x86_64"

PATCHES="glew-1.10.0.patch"

PROVIDES="
	glew$secondaryArchSuffix = $portVersion
	lib:libGLEW
	"

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

BUILD_REQUIRES="
	devel:libGL
        "

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

SOURCE_DIR="glew-${portVersion}"

BUILD()
{
	make GLEW_DEST=$prefix BINDIR=$binDir LIBDIR=$libDir INCDIR=$includeDir
}

INSTALL()
{
	make install GLEW_DEST=$prefix BINDIR=$binDir LIBDIR=$libDir INCDIR=$includeDir

	fixPkgconfig

	packageEntries devel \
		$developDir
}

# ----- devel package -------------------------------------
PROVIDES_devel="
        libGLEW${secondaryArchSuffix}_devel = $portVersion
        "

REQUIRES_devel="
        libGLEW$secondaryArchSuffix == $portVersion base
        "
