summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 68cb4915b97c408844b723257e271c35de40c490 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Florijan Hamzic <florijanh at gmail dot com>

_pyname=weasyprint
pkgname=python-$_pyname
pkgver=53.4
pkgrel=1
pkgdesc='Convert web documents (HTML, CSS, SVG, ...) to PDF'
arch=(any)
url=https://weasyprint.org
license=(BSD)
_pydeps=(brotli # for fonttools[woff]
         cffi
         cssselect2
         fonttools
         html5lib
         pillow
         pydyf
         pyphen
         tinycss2
         zopfli) # for fonttools[woff]
depends=(pango
         python
         "${_pydeps[@]/#/python-}"
         ttf-font)
makedepends=(python-setuptools)
_pycheckdeps=(coverage
              pytest
              pytest-cov
              pytest-flake8
              pytest-isort
              toml) # for coverage[toml
checkdepends=("${_pycheckdeps[@]/#/python-}")
provides=("$_pyname=$pkgver")
_archive="$_pyname-$pkgver"
source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.tar.gz")
sha256sums=('10ccb17d55c73096bdf1edd3efe58cb855b07e4c307d9bad4ebc9a3f13ff4580')

prepare() {
	cd "$_archive"
	# Flit produces broken setup.py scripts that pretend distutils is setuptools
	# Upstream Issue: https://github.com/Kozea/WeasyPrint/issues/1410
	sed -i -e 's/distutils.core/setuptools/' setup.py
}

build() {
	cd "$_archive"
	python setup.py build_ext
	python setup.py build
}

check() {
	cd "$_archive"
	# Test suite results: 303 failed, 1309 passed, 29 xfailed, 479 warnings
	# For now I'm giving this a pass because I think some of it is font metric
	# related, and perhaps some to do with SVG rendering pixel differences.
	PYTHONPATH=. pytest tests ||:
}

package() {
	cd "$_archive"
	python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}