automat, new python recipe (#7204)

This commit is contained in:
Schrijvers Luc
2022-09-15 09:12:33 +02:00
committed by GitHub
parent b4bc6e2116
commit bfb5bd5608

View File

@@ -0,0 +1,75 @@
SUMMARY="Self-service finite-state machines for the programmer on the go"
DESCRIPTION="Automat is a library for concise, idiomatic Python expression of finite-state
automata (particularly deterministic finite-state transducers)"
HOMEPAGE="https://github.com/glyph/automat"
COPYRIGHT="2014 Rackspace"
LICENSE="MIT"
REVISION="1"
srcGitRev="4260ebbc3347b12566f219fe0e887c18bf972cb9"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="580c8d9eaeb7c6eb29c6d34a2b169474b461ebec158da2e266d5edf621db1dbd"
SOURCE_FILENAME="automat-v$portVersion-$srcGitRev.tar.gz"
SOURCE_DIR="automat-$srcGitRev"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_PACKAGES=(python3 python38 python39 python310)
PYTHON_VERSIONS=(3.7 3.8 3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\n\
cmd:automat_visualize$pythonVersion\n\
\"; \
REQUIRES_$pythonPackage=\"\
haiku\n\
cmd:python$pythonVersion\n\
python_graphviz_$pythonPackage\n\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage
setuptools_scm_$pythonPackage
wheel_$pythonPackage
cmd:git"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation="$prefix"/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p "$installLocation"
rm -rf build
$python setup.py build install \
--root=/ --prefix="$prefix"
mv "$prefix"/bin/automat-visualize \
"$prefix"/bin/automat-visualize$pythonVersion
install -m 755 -d "$docDir"
install -m 644 -t "$docDir" README.md
packageEntries $pythonPackage \
"$prefix"/lib/$python \
"$prefix"/bin \
"$docDir"
done
}