SUMMARY="Asynchronous Python HTTP for Humans"
DESCRIPTION="Small add-on for the python requests http library.

The additional API and changes are minimal and strives to avoid surprises."
HOMEPAGE="https://pypi.org/project/requests-futures/"
COPYRIGHT="2013-2016 Ross McFarland"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://pypi.io/packages/source/r/requests-futures/requests-futures-$portVersion.tar.gz"
SOURCE_DIR="requests-futures-$portVersion"
CHECKSUM_SHA256="35547502bf1958044716a03a2f47092a89efe8f9789ab0c4c528d9c9c30bc148"
ARCHITECTURES="any"

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

BUILD_REQUIRES="
	haiku_devel
	"

PYTHON_PACKAGES=(python python3)
PYTHON_VERSIONS=(2.7 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
}

