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=1
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
a21662217e3e1e10e4394fb368b7e8d48deb2d17efc63428d757eb330a3299aafc4c06328e9be2921639741c5d85fedd53fbdcdd82f950cd88c69e57220355ee 0001-lexers-add-Hare.patch
"