1SUMMARY="Pure git implementation of a sliding window memory map manager"
2DESCRIPTION="When reading from many possibly large files in a fashion similar \
3to random access, it is usually the fastest and most efficient to use memory \
4maps.
5
6Although memory maps have many advantages, they represent a very limited \
7system resource as every map uses one file descriptor, whose amount is \
8limited per process. On 32 bit systems, the amount of memory you can have \
9mapped at a time is naturally limited to theoretical 4GB of memory, which may \
10not be enough for some applications."
11HOMEPAGE="https://pypi.org/project/smmap/"
12COPYRIGHT="2011-2015 Sebastian Thiel and contributors"
13LICENSE="BSD (3-clause)"
14REVISION="1"
15SOURCE_URI="https://pypi.io/packages/source/s/smmap/smmap-$portVersion.tar.gz"
16CHECKSUM_SHA256="dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62"
17
18ARCHITECTURES="any"
19
20PROVIDES="
21	$portName = $portVersion
22	"
23REQUIRES="
24	haiku
25	"
26
27BUILD_REQUIRES="
28	haiku_devel
29	"
30
31PYTHON_PACKAGES=(python39 python310 python312)
32PYTHON_VERSIONS=(3.9 3.10 3.12)
33for i in "${!PYTHON_PACKAGES[@]}"; do
34pythonPackage=${PYTHON_PACKAGES[i]}
35pythonVersion=${PYTHON_VERSIONS[$i]}
36	pythonPackage=${PYTHON_PACKAGES[i]}
37	pythonVersion=${PYTHON_VERSIONS[$i]}
38	eval "PROVIDES_${pythonPackage}=\"
39		${portName}_$pythonPackage = $portVersion
40		\""
41	eval "REQUIRES_$pythonPackage=\"
42		haiku
43		cmd:python$pythonVersion
44		\""
45	BUILD_REQUIRES="$BUILD_REQUIRES
46		setuptools_$pythonPackage
47		"
48	BUILD_PREREQUIRES="$BUILD_PREREQUIRES
49		cmd:python$pythonVersion
50		"
51done
52
53TEST_REQUIRES="
54	cmd:pytest
55	"
56
57INSTALL()
58{
59	for i in "${!PYTHON_PACKAGES[@]}"; do
60		pythonPackage=${PYTHON_PACKAGES[i]}
61		pythonVersion=${PYTHON_VERSIONS[$i]}
62
63		python=python$pythonVersion
64		installLocation=$prefix/lib/$python/vendor-packages/
65		export PYTHONPATH=$installLocation:$PYTHONPATH
66		mkdir -p $installLocation
67		rm -rf build
68		$python setup.py build install \
69			--root=/ --prefix=$prefix
70
71		packageEntries  $pythonPackage \
72			$prefix/lib/python*
73	done
74}
75
76TEST()
77{
78	pytest -v
79}
80