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.
This commit is contained in:
Oscar Lesta
2025-09-28 04:05:44 -03:00
committed by OscarL
parent 57af47e7cd
commit 70f5008d14

View File

@@ -1,14 +1,13 @@
SUMMARY="Use a text editor. Make a PDF"
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="1"
SOURCE_URI="https://github.com/rst2pdf/rst2pdf/archive/refs/tags/$portVersion.tar.gz"
CHECKSUM_SHA256="45d7d1e074793762d9aa9799cfbaa15495377456fd88ed63fa941c562cd165eb"
SOURCE_FILENAME="rst2pdf-$portVersion.tar.gz"
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"
@@ -24,23 +23,30 @@ BUILD_REQUIRES="
"
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
cmd:rst2pdf = $portVersion
cmd:rst2pdf_$pythonVersion = $portVersion
\""
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:rst2pdf = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
$REQUIRES
cmd:python$pythonVersion
reportlab_$pythonPackage
smartypants_$pythonPackage
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
installer_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
@@ -49,19 +55,23 @@ done
INSTALL()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
$python -m installer -p $prefix $portName-$portVersion-py3-none-any.whl
mkdir -p $installLocation
rm -rf build
# Version suffix all the scripts
for f in $binDir/*; do
mv $f $f-$pythonVersion
done
$python setup.py build install \
--root=/ --prefix=$prefix
# 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* \