1SUMMARY="Better dates & times for Python"
2DESCRIPTION="Arrow is a Python library that offers a sensible and human-friendly approach to \
3creating, manipulating, formatting and converting dates, times and timestamps. It implements and \
4updates the datetime type, plugging gaps in functionality and providing an intelligent module API \
5that supports many common creation scenarios. Simply put, it helps you work with dates and times \
6with fewer imports and a lot less code.
7
8Arrow is named after the arrow of time and is heavily inspired by moment.js and requests."
9HOMEPAGE="https://github.com/arrow-py/arrow/"
10COPYRIGHT="2023 Chris Smith"
11LICENSE="Apache v2"
12REVISION="1"
13SOURCE_URI="https://github.com/arrow-py/arrow/archive/$portVersion.tar.gz"
14CHECKSUM_SHA256="dc77c3f46354a2d7fd840422befdacff1e60ed74538c6eed4796e6e58883983c"
15
16ARCHITECTURES="any"
17
18PROVIDES="
19	$portName = $portVersion
20	"
21REQUIRES="
22	haiku
23	"
24
25BUILD_REQUIRES="
26	haiku_devel
27	"
28
29PYTHON_PACKAGES=(python39 python310)
30PYTHON_VERSIONS=(3.9 3.10)
31for i in "${!PYTHON_PACKAGES[@]}"; do
32	pythonPackage=${PYTHON_PACKAGES[i]}
33	pythonVersion=${PYTHON_VERSIONS[$i]}
34
35	eval "PROVIDES_${pythonPackage}=\"
36		${portName}_$pythonPackage = $portVersion
37		\""
38	eval "REQUIRES_$pythonPackage=\"
39		haiku
40		dateutil_$pythonPackage
41		typing_extensions_$pythonPackage
42		cmd:python$pythonVersion
43		\""
44
45	BUILD_REQUIRES="$BUILD_REQUIRES
46		setuptools_$pythonPackage
47		"
48	BUILD_PREREQUIRES="$BUILD_PREREQUIRES
49		cmd:python$pythonVersion
50		"
51done
52
53
54INSTALL()
55{
56	for i in "${!PYTHON_PACKAGES[@]}"; do
57		pythonPackage=${PYTHON_PACKAGES[i]}
58		pythonVersion=${PYTHON_VERSIONS[$i]}
59
60		python=python$pythonVersion
61		installLocation=$prefix/lib/$python/vendor-packages/
62		export PYTHONPATH=$installLocation:$PYTHONPATH
63
64		mkdir -p $installLocation
65		rm -rf build
66
67		$python setup.py build install \
68			--root=/ --prefix=$prefix
69
70		packageEntries  $pythonPackage \
71			$prefix/lib/python*
72	done
73}
74