SUMMARY="A Python package for creating beautiful command line interfaces"
DESCRIPTION="The \“Command Line Interface Creation Kit\”, or \"click\", aims \
to make the process of writing command line tools quick and fun."
HOMEPAGE="https://click.palletsprojects.com/
	https://pypi.org/project/click/
	https://github.com/pallets/click"
COPYRIGHT="2014-2018 Pallets Team
	2001-2006 Gregory P. Ward
	2002-2006 Python Software Foundation"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://pypi.org/packages/source/c/click8/click8-$portVersion.tar.gz"
CHECKSUM_SHA256="3412342408c03fbfd3b1826c8fd0fb2caace9b15a9d1c9375555122855449c86"
SOURCE_DIR="click8-$portVersion"

ARCHITECTURES="any"

PROVIDES="
	click = $portVersion
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"

PYTHON_PACKAGES=(python python3 python38 python39)
PYTHON_VERSIONS=(2.7 3.7 3.8 3.9)
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

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

		rm -rf "$sourceDir"-$pythonPackage
		cp -a "$sourceDir" "$sourceDir"-$pythonPackage
		cd "$sourceDir"-$pythonPackage

		python=python$pythonVersion
		$python setup.py build
	done
}

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

		cd "$sourceDir"-$pythonPackage

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

		packageEntries $pythonPackage \
			"$prefix"/lib/$python
	done

	install -m 755 -d "$docDir"
	install -m 644 -t "$docDir" README.rst
}
