~dricottone/huttese-apk

ref: 45ec23c4f99e6fed1356b17d113aaf8023689e52 huttese-apk/sr.ht/py3-pygments/APKBUILD -rw-r--r-- 1.6 KiB
45ec23c4 — dannyfreeman py3-pygments: upgrade to 2.12.0 2 years ago
                                                                                
b7c90e6f Drew DeVault
45ec23c4 dannyfreeman
b7c90e6f Drew DeVault
45ec23c4 dannyfreeman
30bc5713 Sebastian
b7c90e6f Drew DeVault
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.12.0
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="
70bbfaefeb34f9afb5d74aa924ac3da4a913d1c7f607c0b3f80b6cd25c88a8996e516a689062bf2009c472b29999e309eb044f0f427fa1ea8479bf921b51c524  Pygments-2.12.0.tar.gz
9787753652d4ae322d8fdb11464a6b1682e77070284a2b173e0087435a6aeb10b7320b327a957363a7eb94ff763446ee451e04dd91b25f901a72128fb2e2bb56  0001-lexers-add-Hare.patch
"