1 # Maintainer: David Runge <dvzrv@archlinux.org>
6 pkgdesc="Use a text editor. Make a PDF"
8 url="https://github.com/rst2pdf/rst2pdf"
13 python-importlib-metadata
28 # TODO: package python-xhtml2pdf
29 # https://github.com/xhtml2pdf/xhtml2pdf/issues/560
40 # TODO: package python-xhtml2pdf
42 'plantuml: for UML diagram support'
43 'python-aafigure: for ASCII image support'
44 'python-pyphen: for hyphenation support'
45 'python-matplotlib: for math support'
46 'python-sphinx: for sphinx support'
47 'python-svglib: for SVG support'
49 source=($pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/refs/tags/$pkgver.tar.gz)
50 sha512sums=('ad08629ddec84c50463da726caba71ee3045a37a62fdd58f33afb4ecabeae1b5b0b5ca139d11996ba733f9e03f893e0e7108cd9cbbdd6f0ec9b1c81056b9c3da')
51 b2sums=('bbc448e8a1fa6a50dc9883a0466de1ec6f0f99582a0d968733f2801766fa1ee2793c84186887144ebd75b79f757689248cbb3334716ceddb80dc2bdc73f729ed')
55 export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
56 python -m build --wheel --no-isolation
60 local pytest_options=(
62 # https://github.com/rst2pdf/rst2pdf/issues/1067
63 --deselect tests/input/test_raw_html.rst::test_raw_html
65 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
68 python -m installer --destdir="test_dir" dist/*.whl
70 export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
71 export PATH="$PWD/test_dir/usr/bin:$PATH"
72 pytest "${pytest_options[@]}"
77 python -m installer --destdir="$pkgdir" dist/*.whl
78 install -vDm 644 {CHANGES,MAINTAINERS,README}.rst -t "$pkgdir/usr/share/doc/$pkgname/"
79 install -vDm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"