1SUMMARY="Tool and library for manipulating LilyPond files"
2DESCRIPTION="This package provides a Python library ly containing various Python modules to \
3parse, manipulate or create documents in LilyPond format. A command line program ly is also \
4provided that can be used to do various manipulations with LilyPond files.
5The LilyPond format is a plain text input format that is used by the GNU music typesetter \
6LilyPond (www.lilypond.org).
7The python-ly package is Free Software, licensed under the GPL. This package is written by the \
8Frescobaldi developers and is used extensively by the Frescobaldi project. The main author is \
9Wilbert Berendsen."
10HOMEPAGE="https://github.com/frescobaldi/python-ly/"
11COPYRIGHT="2008-2015 Wilbert Berendsen"
12LICENSE="GNU GPL v2"
13REVISION="4"
14SOURCE_URI="https://pypi.io/packages/source/p/python-ly/python-ly-$portVersion.tar.gz"
15CHECKSUM_SHA256="d4d2b68eb0ef8073200154247cc9bd91ed7fb2671ac966ef3d2853281c15d7a8"
16SOURCE_FILENAME="python-ly-$portVersion.tar.gz"
17SOURCE_DIR="python-ly-$portVersion"
18
19ARCHITECTURES="any"
20
21PROVIDES="
22	$portName = $portVersion
23	"
24REQUIRES="
25	haiku
26	"
27
28BUILD_REQUIRES="
29	haiku_devel
30	"
31PYTHON_PACKAGES=(python39 python310)
32PYTHON_VERSIONS=(3.9 3.10)
33commandSuffixes=(38 "" 310)
34for i in "${!PYTHON_PACKAGES[@]}"; do
35pythonPackage=${PYTHON_PACKAGES[i]}
36pythonVersion=${PYTHON_VERSIONS[$i]}
37commandSuffix=${commandSuffixes[$i]}
38eval "PROVIDES_${pythonPackage}=\"\n\
39	${portName}_$pythonPackage = $portVersion\n\
40	cmd:ly$commandSuffix = $portVersion\n\
41	cmd:ly_server$commandSuffix = $portVersion\n\
42	\"; \
43REQUIRES_$pythonPackage=\"\n\
44	haiku\n\
45	cmd:python$pythonVersion\n\
46	\""
47BUILD_REQUIRES="$BUILD_REQUIRES
48	setuptools_$pythonPackage"
49BUILD_PREREQUIRES="$BUILD_PREREQUIRES
50	cmd:python$pythonVersion"
51done
52
53INSTALL()
54{
55	for i in "${!PYTHON_PACKAGES[@]}"; do
56		pythonPackage=${PYTHON_PACKAGES[i]}
57		pythonVersion=${PYTHON_VERSIONS[$i]}
58		commandSuffix=${commandSuffixes[$i]}
59		pythonPackageName=${portName}_$pythonPackage-$portFullVersion
60		pythonLinksDir=$(dirname $portPackageLinksDir)/$pythonPackageName
61		python=python$pythonVersion
62		installLocation=$prefix/lib/$python/vendor-packages/
63		export PYTHONPATH=$installLocation:$PYTHONPATH
64		mkdir -p $installLocation
65		rm -rf build
66		$python setup.py build install \
67			--root=/ --prefix=$prefix
68
69		if [ $pythonPackage = python$commandSuffix ]; then
70			for f in $binDir/*; do
71				mv $f ${f}$commandSuffix
72			done
73		fi
74
75		packageEntries $pythonPackage \
76			$prefix/lib/python* \
77			$binDir
78	done
79}
80