archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-html5lib / trunk / PKGBUILD
blob42aef7a3c3a9cf2a351c1f93855bf58f854a1f85
1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
2 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
3 # Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
4 # Contributor: Erol V. Aktay <e.aktay@gmail.com>
6 pkgname=python-html5lib
7 pkgver=1.1
8 pkgrel=12
9 arch=('any')
10 url="https://github.com/html5lib"
11 license=('MIT')
12 pkgdesc="A Python HTML parser/tokenizer based on the WHATWG HTML5 spec"
13 _deps=('six' 'webencodings')
14 depends=("${_deps[@]/#/python-}")
15 makedepends=('python-setuptools' "${_deps[@]/#/python-}")
16 _checkdeps=('pytest' 'pytest-expect' 'mock')
17 checkdepends=("${_checkdeps[@]/#/python-}" 'python-lxml')
18 optdepends=('python-lxml: lxml treebuilder'
19             'python-genshi: genshi treewalker')
20 _test_commit=71eebd59772d1d39aced0c0582ae9c09acf3ce6e
21 source=("$pkgname-$pkgver.tar.gz::https://github.com/html5lib/html5lib-python/archive/${pkgver}.tar.gz"
22         "https://github.com/html5lib/html5lib-python/commit/2c19b9899ab3a3e8bd0ca35e5d78544334204169.patch"
23         "https://github.com/html5lib/html5lib-tests/archive/${_test_commit}.tar.gz")
24 sha256sums=('66e9e24a53c10c27abb6be8a3cf2cf55824c6ea1cef8570a633cb223ec46e894'
25             '6f37b33667e35ea138279be9842f012792821b1497b81ae4b108a74180cfe249'
26             'c866f5e4ae9ef34313e2b61fcb74849b6f8aef970bf8249956b6a5d142197087')
28 prepare() {
29     cd "${srcdir}"/html5lib-python-${pkgver}
31     # fix pytest 6 compat
32     patch -p1 -i ../2c19b9899ab3a3e8bd0ca35e5d78544334204169.patch
34     rmdir html5lib/tests/testdata
35     ln -sfT ../../../html5lib-tests-${_test_commit} html5lib/tests/testdata
38 build() {
39     cd "${srcdir}"/html5lib-python-${pkgver}
41     python setup.py build
44 check() {
45     cd "${srcdir}"/html5lib-python-${pkgver}
47     py.test
50 package() {
51     cd "${srcdir}"/html5lib-python-${pkgver}
53     python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
54     install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE