iso8601-0.1.12.recipe revision d5595b68
1SUMMARY="A simple Python module to parse ISO 8601 dates"
2DESCRIPTION="The \"iso8601\" module parses the most common forms of ISO 8601 \
3date strings (e.g. 2007-01-14T20:34:22+00:00) into datetime objects."
4HOMEPAGE="https://pyiso8601.readthedocs.io/
5	https://bitbucket.org/micktwomey/pyiso8601
6	https://pypi.org/project/iso8601/"
7COPYRIGHT="2007-2017 Michael Twomey"
8LICENSE="MIT"
9REVISION="2"
10SOURCE_URI="https://files.pythonhosted.org/packages/source/i/iso8601/iso8601-$portVersion.tar.gz"
11CHECKSUM_SHA256="49c4b20e1f38aa5cf109ddcd39647ac419f928512c869dc01d5c7098eddede82"
12
13ARCHITECTURES="any"
14
15PROVIDES="
16	iso8601 = $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\n\
33	cmd:pip$pythonVersion\n\
34	\"; \
35REQUIRES_$pythonPackage=\"\
36	haiku\n\
37	cmd:python$pythonVersion\n\
38	setuptools_$pythonPackage\n\
39	\""
40BUILD_REQUIRES="$BUILD_REQUIRES
41	setuptools_$pythonPackage"
42BUILD_PREREQUIRES="$BUILD_PREREQUIRES
43	cmd:python$pythonVersion"
44done
45
46BUILD()
47{
48	for i in "${!PYTHON_PACKAGES[@]}"; do
49		pythonPackage=${PYTHON_PACKAGES[i]}
50		pythonVersion=${PYTHON_VERSIONS[$i]}
51
52		rm -rf "$sourceDir"-$pythonPackage
53		cp -a "$sourceDir" "$sourceDir"-$pythonPackage
54		cd "$sourceDir"-$pythonPackage
55
56		python=python$pythonVersion
57		$python setup.py build
58	done
59}
60
61INSTALL()
62{
63	for i in "${!PYTHON_PACKAGES[@]}"; do
64		pythonPackage=${PYTHON_PACKAGES[i]}
65		pythonVersion=${PYTHON_VERSIONS[$i]}
66
67		cd "$sourceDir"-$pythonPackage
68
69		python=python$pythonVersion
70		installLocation=$prefix/lib/$python/vendor-packages/
71		export PYTHONPATH=$installLocation
72		mkdir -p "$installLocation"
73		$python setup.py install \
74			--root=/ --prefix="$prefix"
75
76		packageEntries $pythonPackage \
77			"$prefix"/lib/$python
78	done
79
80	install -m 755 -d "$docDir"
81	install -m 644 -t "$docDir" README.rst
82}
83
84TEST()
85{
86	for i in "${!PYTHON_PACKAGES[@]}"; do
87		pythonPackage=${PYTHON_PACKAGES[i]}
88		pythonVersion=${PYTHON_VERSIONS[$i]}
89
90		cd "$sourceDir"-$pythonPackage
91
92		python=python$pythonVersion
93		$python setup.py test
94	done
95}
96