1SUMMARY="Atomic file writes"
2DESCRIPTION="It uses a temporary file in the same directory as the given path.\
3 This ensures that the temporary file resides on the same filesystem.
4The temporary file will then be atomically moved to the target location: On \
5POSIX, it will use 'rename' if files should be overwritten, otherwise a \
6combination of 'link' and 'unlink'."
7HOMEPAGE="https://pypi.python.org/pypi/atomicwrites"
8COPYRIGHT="2015-2020 Markus Unterwaditzer"
9LICENSE="MIT"
10REVISION="3"
11SOURCE_URI="https://pypi.io/packages/source/a/atomicwrites/atomicwrites-$portVersion.tar.gz"
12CHECKSUM_SHA256="81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11"
13
14ARCHITECTURES="any"
15
16PROVIDES="
17	$portName = $portVersion
18	"
19REQUIRES="
20	haiku
21	"
22
23BUILD_REQUIRES="
24	haiku_devel
25	"
26
27PYTHON_PACKAGES=(python39 python310)
28PYTHON_VERSIONS=(3.9 3.10)
29for i in "${!PYTHON_PACKAGES[@]}"; do
30pythonPackage=${PYTHON_PACKAGES[i]}
31pythonVersion=${PYTHON_VERSIONS[$i]}
32eval "PROVIDES_${pythonPackage}=\"\
33	${portName}_$pythonPackage = $portVersion\
34	\"; \
35REQUIRES_$pythonPackage=\"\
36	haiku\n\
37	cmd:python$pythonVersion\
38	\""
39BUILD_REQUIRES="$BUILD_REQUIRES
40	setuptools_$pythonPackage"
41BUILD_PREREQUIRES="$BUILD_PREREQUIRES
42	cmd:python$pythonVersion"
43done
44
45INSTALL()
46{
47	for i in "${!PYTHON_PACKAGES[@]}"; do
48		pythonPackage=${PYTHON_PACKAGES[i]}
49		pythonVersion=${PYTHON_VERSIONS[$i]}
50
51		python=python$pythonVersion
52		installLocation=$prefix/lib/$python/vendor-packages/
53		export PYTHONPATH=$installLocation:$PYTHONPATH
54		mkdir -p $installLocation
55		rm -rf build
56		$python setup.py build install \
57			--root=/ --prefix=$prefix
58
59		packageEntries  $pythonPackage \
60			$prefix/lib/python*
61	done
62}
63