1SUMMARY="Programmatically open an editor, capture the result"
2DESCRIPTION="python-editor is a library that provides the editor module \
3for programmatically interfacing with your system's editor."
4HOMEPAGE="https://github.com/fmoo/python-editor"
5COPYRIGHT="2015-2019 Peter Ruibal"
6LICENSE="Apache v2"
7REVISION="5"
8SOURCE_URI="https://files.pythonhosted.org/packages/0a/85/78f4a216d28343a67b7397c99825cff336330893f00601443f7c7b2f2234/python-editor-1.0.4.tar.gz"
9CHECKSUM_SHA256="51fda6bcc5ddbbb7063b2af7509e43bd84bfc32a4ff71349ec7847713882327b"
10SOURCE_DIR="python-editor-$portVersion"
11
12ARCHITECTURES="any"
13
14PROVIDES="
15	$portName = $portVersion
16	"
17REQUIRES="
18	haiku
19	"
20
21BUILD_REQUIRES="
22	haiku_devel
23	"
24
25PYTHON_PACKAGES=(python39 python310)
26PYTHON_VERSIONS=(3.9 3.10)
27for i in "${!PYTHON_PACKAGES[@]}"; do
28pythonPackage=${PYTHON_PACKAGES[i]}
29pythonVersion=${PYTHON_VERSIONS[$i]}
30eval "PROVIDES_${pythonPackage}=\"\
31	${portName}_$pythonPackage = $portVersion\
32	\"; \
33REQUIRES_$pythonPackage=\"\
34	haiku\n\
35	cmd:python$pythonVersion\
36	\""
37BUILD_REQUIRES="$BUILD_REQUIRES
38	setuptools_$pythonPackage"
39BUILD_PREREQUIRES="$BUILD_PREREQUIRES
40	cmd:python$pythonVersion"
41done
42
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
54		mkdir -p $installLocation
55		rm -rf build
56
57		$python setup.py build install \
58			--root=/ --prefix=$prefix
59
60		packageEntries  $pythonPackage \
61			$prefix/lib/python*
62	done
63}
64