Files
haikuports/dev-python/rst2pdf/rst2pdf-0.103.1.recipe
2025-10-01 12:34:42 +00:00

87 lines
2.1 KiB
Bash

SUMMARY="Use a text editor, make a PDF"
DESCRIPTION="The rst2pdf tool creates PDF documents from your ReStructured Text markup. It is an \
Open Source, free-to-use tool that will help you create documents, slide decks and other PDF \
output very quickly and easily."
HOMEPAGE="http://rst2pdf.github.io/"
COPYRIGHT="2007-2020 Roberto Alsina and the contributors to the rst2pdf project"
LICENSE="MIT"
REVISION="2"
SOURCE_URI="https://files.pythonhosted.org/packages/py3/${portBaseName:0:1}/$portBaseName/$portBaseName-$portVersion-py3-none-any.whl#noarchive"
CHECKSUM_SHA256="10baf9ca1638a228500635369ecf9850270c62b8608f49788556636aeb5c65b8"
ARCHITECTURES="any"
PROVIDES="
$portBaseName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portBaseName}_$pythonPackage = $portVersion
cmd:rst2pdf_$pythonVersion = $portVersion
\""
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:rst2pdf = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
$REQUIRES
cmd:python$pythonVersion
docutils_$pythonPackage
importlib_metadata_$pythonPackage
jinja2_$pythonPackage
packaging_$pythonPackage
pygments_$pythonPackage
pyyaml_$pythonPackage
reportlab_$pythonPackage
smartypants_$pythonPackage
\""
BUILD_REQUIRES+="
installer_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
$python -m installer -p $prefix $portBaseName-$portVersion-py3-none-any.whl
# Version suffix all the scripts
for f in $binDir/*; do
mv $f $f-$pythonVersion
done
# And provide suffix-less symlinks for the default version
if [ $pythonVersion = $defaultVersion ]; then
for f in $binDir/*; do
ln -sr $f ${f%-$pythonVersion}
done
fi
packageEntries $pythonPackage \
$prefix/lib/python* \
$binDir
done
}