blob: f93961783309a8bf5dbc8a9a4e3374c3a79a1b7d (
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# Maintainer: Angel Velasquez <angvp@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgbase=python-lxml
pkgname=('python-lxml' 'python2-lxml' 'python-lxml-docs')
pkgver=4.3.0
pkgrel=1
arch=('x86_64')
license=('BSD' 'custom')
url="http://lxml.de/"
makedepends=('libxslt' 'python-setuptools' 'python2-setuptools' 'epydoc' 'python2-pygments'
'python2-docutils' 'cython' 'cython2')
checkdepends=('python-cssselect' 'python2-cssselect' 'python-html5lib' 'python2-html5lib'
'python-beautifulsoup4' 'python2-beautifulsoup4')
source=("https://github.com/lxml/lxml/archive/lxml-$pkgver.tar.gz")
sha512sums=('3739e243b543e8a5f678aaca19fe1b5be21351c343065fe8e52709523d4e27dbd5c846c0681473b9612fd73af6a4d04ec21c6834e53680410cab854b7f7f1675')
prepare() {
mv lxml-lxml-$pkgver lxml-$pkgver
cp -a lxml-$pkgver{,-py2}
# Setting LC_CTYPE to workaround encoding issue
export LC_CTYPE=en_US.UTF-8
}
build() {
cd "$srcdir"/lxml-$pkgver
python setup.py build
cd "$srcdir"/lxml-$pkgver-py2
python2 setup.py build
make PYTHON=python2 html
}
check() {
# TODO: Find a sane way to skip inplace build
cd "$srcdir"/lxml-$pkgver
make PYTHON=python test || warning "Tests failed"
cd "$srcdir"/lxml-$pkgver-py2
make PYTHON=python2 test || warning "Tests failed"
}
package_python-lxml() {
pkgdesc="Python3 binding for the libxml2 and libxslt libraries"
depends=('python' 'libxslt')
optdepends=('python-beautifulsoup4: support for beautifulsoup parser to parse not well formed HTML'
'python-cssselect: support for cssselect'
'python-html5lib: support for html5lib parser'
'python-lxml-docs: offline docs')
cd lxml-$pkgver
python setup.py install --root="$pkgdir" --skip-build --optimize=1
install -Dm644 LICENSES.txt \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
install -Dm644 doc/licenses/BSD.txt \
"$pkgdir"/usr/share/licenses/$pkgname/BSD.txt
install -Dm644 doc/licenses/elementtree.txt \
"$pkgdir"/usr/share/licenses/$pkgname/elementtree.txt
}
package_python2-lxml() {
pkgdesc="Python2 binding for the libxml2 and libxslt libraries"
depends=('python2' 'libxslt')
optdepends=('python2-beautifulsoup4: support for beautifulsoup parser to parse not well formed HTML'
'python2-cssselect: support for cssselect'
'python2-html5lib: support for html5lib parser'
'python-lxml-docs: offline docs')
cd lxml-$pkgver-py2
python2 setup.py install --root="$pkgdir" --skip-build --optimize=1
install -Dm644 LICENSES.txt \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
install -Dm644 doc/licenses/BSD.txt \
"$pkgdir"/usr/share/licenses/$pkgname/BSD.txt
install -Dm644 doc/licenses/elementtree.txt \
"$pkgdir"/usr/share/licenses/$pkgname/elementtree.txt
}
package_python-lxml-docs() {
pkgdesc="Python binding for the libxml2 and libxslt libraries (docs)"
options=('docs')
cd lxml-$pkgver-py2
install -d "$pkgdir"/usr/share/doc/$pkgbase
cp -r doc/html "$pkgdir"/usr/share/doc/$pkgbase
install -Dm644 LICENSES.txt \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
install -Dm644 doc/licenses/BSD.txt \
"$pkgdir"/usr/share/licenses/$pkgname/BSD.txt
install -Dm644 doc/licenses/elementtree.txt \
"$pkgdir"/usr/share/licenses/$pkgname/elementtree.txt
}
|