SUMMARY="Python-powered, cross-platform, Unix-gazing shell"
DESCRIPTION="xonsh is a Python-powered, cross-platform, Unix-gazing shell \
language and command prompt. The language is a superset of Python 3.5+ with \
additional shell primitives. xonsh (pronounced conch) is meant for the daily \
use of experts and novices alike."
HOMEPAGE="https://xon.sh/"
COPYRIGHT="2015-2019 the xonsh developers"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/xonsh/xonsh/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="4ede94226b0cc5f429bc7605ace88137c685d24675228e9e94ec18341dd30be4"

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\n\
	cmd:xon.sh\n\
	cmd:xonsh\n\
	cmd:xonsh_cat\n\
	\"; \
REQUIRES_$pythonPackage=\"\
	haiku\n\
	cmd:python$pythonVersion\n\
	setuptools_$pythonPackage\n\
	\""
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* \
			$binDir
	done
}
