Files
haikuports/dev-python/rst2pdf/rst2pdf-0.102.recipe
Oscar Lesta 70f5008d14 rst2pdf: fix dependencies.
rst2pdf was broken before, as it requires "smartypants".
Newer versions (>= 0.103) drop that requirement in favor of
"docutils.smartquotes", but also introduce more dendencies,
so leave it as this for now.

(we should retire the smartypants recipe once this package no longer
requires it)

Switched to re-packaging the .whl instead of installing from the tarball,
as end .hpkg is the same, and the tarball is 12 MB, vs 173 KB for the wheel.
2025-09-28 04:24:59 -03:00

81 lines
1.9 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/${portName:0:1}/$portName/$portName-$portVersion-py3-none-any.whl#noarchive"
CHECKSUM_SHA256="ae8e76aa85f95cef1ffcee30b3a53cbe15ffea185c274d093581b9be79b0ec10"
ARCHITECTURES="any"
PROVIDES="
$portName = $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=\"
${portName}_$pythonPackage = $portVersion
cmd:rst2pdf_$pythonVersion = $portVersion
\""
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:rst2pdf = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
$REQUIRES
cmd:python$pythonVersion
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 $portName-$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
}