1SUMMARY="A fast and thorough lazy object proxy for Python"
2DESCRIPTION="lazy-object-proxy is based on the ObjectProxy from the wrapt \
3Python module with one big change: it calls a function the first time the \
4proxy object is used, while wrapt.ObjectProxy just forwards the method calls \
5to the target object"
6HOMEPAGE="https://github.com/ionelmc/python-lazy-object-proxy"
7COPYRIGHT="2014-2019, Ionel Cristian M��rie��"
8LICENSE="BSD (2-clause)"
9REVISION="4"
10SOURCE_URI="https://github.com/ionelmc/python-lazy-object-proxy/archive/v$portVersion.tar.gz"
11CHECKSUM_SHA256="b28708f92930b4e2c0ab39def12ebc6be466db5e91fad88bfc7ebf9aa9c9de16"
12SOURCE_DIR="python-lazy-object-proxy-$portVersion"
13
14ARCHITECTURES="all !x86_gcc2"
15SECONDARY_ARCHITECTURES="x86"
16
17PROVIDES="
18	$portName = $portVersion
19	"
20REQUIRES="
21	haiku$secondaryArchSuffix
22	"
23
24BUILD_REQUIRES="
25	haiku${secondaryArchSuffix}_devel
26	"
27
28PYTHON_PACKAGES=(python39 python310)
29PYTHON_VERSIONS=(3.9 3.10)
30for i in "${!PYTHON_PACKAGES[@]}"; do
31	pythonPackage=${PYTHON_PACKAGES[i]}
32	pythonVersion=${PYTHON_VERSIONS[$i]}
33
34	eval "PROVIDES_$pythonPackage=\"
35		${portName}_$pythonPackage = $portVersion
36		\""
37	if [ "$targetArchitecture" = x86_gcc2 ]; then
38		eval "PROVIDES_$pythonPackage+=\"
39			lazy_object_proxy_$pythonPackage = $portVersion
40			\""
41	fi
42	eval "REQUIRES_$pythonPackage=\"
43		haiku
44		cmd:python$pythonVersion\
45		\""
46	BUILD_REQUIRES+="
47		build_$pythonPackage
48		installer_$pythonPackage
49		setuptools_scm_$pythonPackage
50		wheel_$pythonPackage
51		"
52	BUILD_PREREQUIRES+="
53		cmd:gcc$secondaryArchSuffix
54		cmd:python$pythonVersion
55		"
56done
57
58INSTALL()
59{
60	for i in "${!PYTHON_PACKAGES[@]}"; do
61		pythonVersion=${PYTHON_VERSIONS[$i]}
62
63		python=python$pythonVersion
64
65		rm -rf dist
66
67		$python -m build --wheel --skip-dependency-check --no-isolation
68		$python -m installer --p $prefix dist/*.whl
69
70		packageEntries ${PYTHON_PACKAGES[i]} \
71			"$prefix"/lib/python*
72	done
73}
74