SUMMARY="A modern CSS selector implementation for BeautifulSoup"
DESCRIPTION="Soup Sieve is a CSS selector library designed to be used with \
Beautiful Soup 4. It aims to provide selecting, matching, and filtering \
using modern CSS selectors. Soup Sieve currently provides selectors from \
the CSS level 1 specifications up through the latest CSS level 4 drafts \
and beyond (though some are not yet implemented)."
HOMEPAGE="https://github.com/facelessuser/soupsieve"
COPYRIGHT="2018 Isaac Muse"
LICENSE="MIT"
REVISION="2"
SOURCE_URI="https://github.com/facelessuser/soupsieve/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="ba6a129e3e0e8ea5928684fd720f548eec65bc53947d9ac2b264dd2412d5cf55"
SOURCE_FILENAME="$portName-v$portVersion.tar.gz"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	"

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

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
}
