cssselect-1.1.0.recipe revision 0f526ce2
1SUMMARY="Parses CSS3 Selectors and translates them to XPath 1.0"
2DESCRIPTION="cssselect parses CSS3 Selectors and translate them to XPath 1.0 \
3expressions. Such expressions can be used in lxml or another XPath \
4engine to find the matching elements in an XML or HTML document."
5HOMEPAGE="https://pythonhosted.org/cssselect/
6	https://pypi.python.org/pypi/cssselect"
7COPYRIGHT="2007-2019 Ian Bicking and contributors"
8LICENSE="BSD (3-clause)"
9REVISION="1"
10SOURCE_URI="https://github.com/scrapy/cssselect/archive/v$portVersion.tar.gz"
11CHECKSUM_SHA256="dde8c1d4a2c82de6889a3af1c1adbce1a6f3ec08b07a854d873f3f3da92960af"
12
13ARCHITECTURES="any"
14
15PROVIDES="
16	$portName = $portVersion
17	"
18REQUIRES="
19	haiku
20	"
21
22BUILD_REQUIRES="
23	haiku_devel
24	"
25
26PYTHON_PACKAGES=(python python36 python3)
27PYTHON_VERSIONS=(2.7 3.6 3.7)
28for i in "${!PYTHON_PACKAGES[@]}"; do
29pythonPackage=${PYTHON_PACKAGES[i]}
30pythonVersion=${PYTHON_VERSIONS[$i]}
31eval "PROVIDES_${pythonPackage}=\"\
32	${portName}_$pythonPackage = $portVersion\
33	\"; \
34REQUIRES_$pythonPackage=\"\
35	haiku\n\
36	cmd:python$pythonVersion\
37	\""
38BUILD_REQUIRES="$BUILD_REQUIRES
39	setuptools_$pythonPackage"
40BUILD_PREREQUIRES="$BUILD_PREREQUIRES
41	cmd:python$pythonVersion"
42done
43
44INSTALL()
45{
46	for i in "${!PYTHON_PACKAGES[@]}"; do
47		pythonPackage=${PYTHON_PACKAGES[i]}
48		pythonVersion=${PYTHON_VERSIONS[$i]}
49
50		python=python$pythonVersion
51		installLocation=$prefix/lib/$python/vendor-packages/
52		export PYTHONPATH=$installLocation:$PYTHONPATH
53		mkdir -p $installLocation
54		rm -rf build
55		$python setup.py build install \
56			--root=/ --prefix=$prefix
57
58		packageEntries  $pythonPackage \
59			$prefix/lib/python*
60	done
61}
62