diff options
-rw-r--r-- | .SRCINFO | 41 | ||||
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | .nvchecker.toml | 3 | ||||
-rw-r--r-- | PKGBUILD | 96 | ||||
-rw-r--r-- | reportlab-4.1.0-compatibility.patch | 28 |
5 files changed, 127 insertions, 47 deletions
@@ -1,25 +1,34 @@ pkgbase = python-xhtml2pdf pkgdesc = A library for converting HTML into PDFs using ReportLab - pkgver = 0.2.2 - pkgrel = 1 + pkgver = 0.2.15 + pkgrel = 2 url = https://github.com/xhtml2pdf/xhtml2pdf arch = any - license = Apache + license = Apache-2.0 + checkdepends = python-nose + makedepends = python-build + makedepends = python-installer makedepends = python-setuptools - makedepends = python-sphinx + makedepends = python-wheel makedepends = python-sphinx_rtd_theme - makedepends = python-nose - makedepends = texlive-core - makedepends = texlive-bin - depends = python-reportlab - depends = python-pillow + makedepends = python-sphinxcontrib-pdfembed + makedepends = texlive-fontsextra + makedepends = texlive-latexextra + depends = python + depends = python-arabic-reshaper + depends = python-asn1crypto + depends = python-bidi depends = python-html5lib - depends = python-httplib2 - depends = python-coverage - depends = python-pypdf2 - depends = python-six - source = https://github.com/xhtml2pdf/xhtml2pdf/archive/0.2.2.tar.gz - sha256sums = 3a1e04941adaae1fb44ba51b7f9769fea55ef13ba01acd6fd5666c18d6bf25cf + depends = python-pillow + depends = python-pyhanko + depends = python-pyhanko-certvalidator + depends = python-pypdf + depends = python-reportlab + depends = python-svglib + depends = python-typing_extensions + source = python-xhtml2pdf-0.2.15.tar.gz::https://github.com/xhtml2pdf/xhtml2pdf/archive/v0.2.15.tar.gz + source = reportlab-4.1.0-compatibility.patch + sha256sums = 4e802908267d3b8682076cca11cb314997dff946400e10a929243d40b4c17e28 + sha256sums = 53fb653376a3d92cf50d28094c99e6685a588ab9390526e31992815690ea9096 pkgname = python-xhtml2pdf - diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..3d192c721931 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +* +!.gitignore +!.nvchecker.toml +!.SRCINFO +!PKGBUILD +!reportlab-4.1.0-compatibility.patch diff --git a/.nvchecker.toml b/.nvchecker.toml new file mode 100644 index 000000000000..e4c73dfa082c --- /dev/null +++ b/.nvchecker.toml @@ -0,0 +1,3 @@ +[python-xhtml2pdf] +source = "pypi" +pypi = "xhtml2pdf" @@ -1,46 +1,80 @@ -# Maintainer: András Wacha <awacha@gmail.com> +# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com> +# Contributor: András Wacha <awacha@gmail.com> +# Contributor: Michał Wojdyła < micwoj9292 at gmail dot com > + pkgname=python-xhtml2pdf -_name=${pkgname#python-} -pkgver=0.2.2 -pkgrel=1 +_pkgname=${pkgname#python-} +pkgver=0.2.15 +pkgrel=2 pkgdesc="A library for converting HTML into PDFs using ReportLab" arch=(any) url="https://github.com/xhtml2pdf/xhtml2pdf" -license=('Apache') -makedepends=( python-setuptools - python-sphinx - python-sphinx_rtd_theme - python-nose - texlive-core - texlive-bin +license=(Apache-2.0) +depends=( + python + python-arabic-reshaper + python-asn1crypto + python-bidi + python-html5lib + python-pillow + python-pyhanko + python-pyhanko-certvalidator + python-pypdf + python-reportlab + python-svglib + python-typing_extensions +) +makedepends=( + python-build + python-installer + python-setuptools + python-wheel + # Documentation + python-sphinx_rtd_theme + python-sphinxcontrib-pdfembed + texlive-fontsextra + texlive-latexextra ) -depends=( python-reportlab - python-pillow - python-html5lib - python-httplib2 - python-coverage - python-pypdf2 - python-six +checkdepends=(python-nose) +source=( + "$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz" + "reportlab-4.1.0-compatibility.patch" ) -source=("https://github.com/${_name}/${_name}/archive/${pkgver}.tar.gz" ) -sha256sums=('3a1e04941adaae1fb44ba51b7f9769fea55ef13ba01acd6fd5666c18d6bf25cf') +sha256sums=( + '4e802908267d3b8682076cca11cb314997dff946400e10a929243d40b4c17e28' + '53fb653376a3d92cf50d28094c99e6685a588ab9390526e31992815690ea9096' +) + +_archive="$_pkgname-$pkgver" + +prepare() { + cd "$_archive" + + patch --forward --strip=1 --input="$srcdir/reportlab-4.1.0-compatibility.patch" +} build() { - cd ${_name}-${pkgver} - python setup.py build - (cd doc && make html) - (cd doc && make latexpdf) + cd "$_archive" + + python -m build --wheel --no-isolation + + export PYTHONPATH=$PWD/docs/source:$PWD + make -C docs html man } check() { - cd ${_name}-${pkgver} - python setup.py test + cd "$_archive" + + nosetests } package() { - cd ${_name}-${pkgver} - python setup.py install --root="$pkgdir/" --optimize=1 --skip-build - mkdir -p ${pkgdir}/usr/share/doc/${pkgname} - cp ${srcdir}/${_name}-${pkgver}/doc/build/html ${pkgdir}/usr/share/doc/${pkgname} -R - cp ${srcdir}/${_name}-${pkgver}/doc/build/latex/${_name}.pdf ${pkgdir}/usr/share/doc/${_name}.pdf + cd "$_archive" + + python -m installer --destdir="$pkgdir" dist/*.whl + + install -dm755 "$pkgdir/usr/share/doc/$pkgname" + cp -at "$pkgdir/usr/share/doc/$pkgname" docs/build/html + + install -Dm644 -t "$pkgdir/usr/share/man/man1" docs/build/man/xhtml2pdf.1 } diff --git a/reportlab-4.1.0-compatibility.patch b/reportlab-4.1.0-compatibility.patch new file mode 100644 index 000000000000..0ba4658d2677 --- /dev/null +++ b/reportlab-4.1.0-compatibility.patch @@ -0,0 +1,28 @@ +From 1252510bd23b833b45b4d252aeac62c1eb51eeef Mon Sep 17 00:00:00 2001 +From: Stefan <96178532+stefan6419846@users.noreply.github.com> +Date: Sat, 10 Feb 2024 11:47:23 +0100 +Subject: [PATCH] Adapt to new ShowBoundaryValue import + +--- + xhtml2pdf/context.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/xhtml2pdf/context.py b/xhtml2pdf/context.py +index 31abc542..d768875b 100644 +--- a/xhtml2pdf/context.py ++++ b/xhtml2pdf/context.py +@@ -27,8 +27,13 @@ + from reportlab.lib.styles import ParagraphStyle + from reportlab.pdfbase import pdfmetrics + from reportlab.pdfbase.ttfonts import TTFont +-from reportlab.platypus.frames import Frame, ShowBoundaryValue ++from reportlab.platypus.frames import Frame + from reportlab.platypus.paraparser import ParaFrag, ps2tt, tt2ps ++try: ++ from reportlab.pdfgen.canvas import ShowBoundaryValue ++except ImportError: ++ # reportlab < 4.0.9.1 ++ from reportlab.platypus.frames import ShowBoundaryValue + + from xhtml2pdf import default, parser + from xhtml2pdf.files import getFile, pisaFileObject |