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
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py3-pygments
_pkgname=Pygments
pkgver=2.11.2
pkgrel=0
pkgdesc="Syntax highlighting package written in Python"
url="https://pygments.org/"
arch="noarch"
license="BSD-2-Clause"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-lxml py3-wcag-contrast-ratio"
subpackages="$pkgname-doc"
source="
https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-$pkgver.tar.gz
0001-lexers-add-Hare.patch
"
builddir="$srcdir/$_pkgname-$pkgver"
replaces="py-pygments" # Backwards compatibility
provides="py-pygments=$pkgver-r$pkgrel" # Backwards compatibility
# secfixes:
# 2.7.4-r0:
# - CVE-2021-20270
build() {
python3 setup.py build
}
check() {
python3 -m pytest
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir"
mkdir -p "$pkgdir"/usr/bin
ln -s pygmentize "$pkgdir"/usr/bin/pygmentize-3
}
doc() {
local destdir="$subpkgdir/usr/share/doc/$pkgname"
cd "$builddir"
install -m 644 -D doc/pygmentize.1 \
"$subpkgdir"/usr/share/man/man1/pygmentize.1
mkdir -p "$destdir"
cp AUTHORS CHANGES LICENSE "$destdir"/
# Note: The documentation in the doc directory needs to be generated
# by py-sphinx
cp -R ./doc/docs/* "$destdir"/
default_doc
}
sha512sums="
606ff0c35fa47882f4c5c3794827132e1ee6ccbb4895ae858f9c93ea0c92b73163c9f4d630b51a8bb782ba0b4944a66d1059ad5d017d3191a0a5b30c1e5b8f9f Pygments-2.11.2.tar.gz
d5b38a4febb44e4f79ac4372614e1d8a4a9cbc3c0464db264636d40ae5582250ab9d3f91d31aeb71542c01f0436d5acf7f2318f3877cbecd4aeb2a473bf5c094 0001-lexers-add-Hare.patch
"