SUMMARY="Common cross platform Python binding to OpenGL"
DESCRIPTION="PyOpenGL is the most common cross platform Python binding to \
OpenGL and related APIs.
The binding is created using the standard ctypes library, and is provided \
under an extremely liberal BSD-style Open-Source license."
HOMEPAGE="https://pypi.org/project/PyOpenGL/"
COPYRIGHT="1997-1998, 2004-2020 Mike C. Fletcher"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://files.pythonhosted.org/packages/b8/73/31c8177f3d236e9a5424f7267659c70ccea604dab0585bfcd55828397746/PyOpenGL-$portVersion.tar.gz"
CHECKSUM_SHA256="4107ba0d0390da5766a08c242cf0cf3404c377ed293c5f6d701e457c57ba3424"
SOURCE_DIR="PyOpenGL-$portVersion"

ARCHITECTURES="any"

PROVIDES="
	$portName = $portVersion
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"

PYTHON_PACKAGES=(python3)
PYTHON_VERSIONS=(3.7)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
	${portName}_$pythonPackage = $portVersion\
	\"; \
REQUIRES_$pythonPackage=\"\
	haiku\n\
	cmd:python$pythonVersion\
	\""
BUILD_REQUIRES="$BUILD_REQUIRES
	setuptools_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
	cmd:python$pythonVersion"
done

INSTALL()
{
	for i in "${!PYTHON_PACKAGES[@]}"; do
		pythonPackage=${PYTHON_PACKAGES[i]}
		pythonVersion=${PYTHON_VERSIONS[$i]}

		python=python$pythonVersion
		installLocation=$prefix/lib/$python/vendor-packages/
		export PYTHONPATH=$installLocation:$PYTHONPATH
		mkdir -p $installLocation
		rm -rf build
		$python setup.py build install \
			--root=/ --prefix=$prefix

		packageEntries  $pythonPackage \
			$prefix/lib/python*
	done
}
