mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 08:26:49 +02:00
68 lines
1.9 KiB
Text
68 lines
1.9 KiB
Text
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
|
|
# Maintainer: Julien Voisin <julien.voisin@dustri.org>
|
|
pkgname=py3-pygments
|
|
pkgver=2.19.1
|
|
pkgrel=1
|
|
pkgdesc="Syntax highlighting package written in Python"
|
|
url="https://pygments.org/"
|
|
arch="noarch"
|
|
license="BSD-2-Clause"
|
|
depends="python3"
|
|
makedepends="py3-setuptools py3-gpep517 py3-wheel py3-installer"
|
|
checkdepends="py3-pytest py3-lxml py3-wcag-contrast-ratio"
|
|
subpackages="$pkgname-pyc $pkgname-doc"
|
|
source="https://files.pythonhosted.org/packages/source/P/Pygments/pygments-$pkgver.tar.gz
|
|
build-with-setuptools.patch
|
|
"
|
|
builddir="$srcdir/pygments-$pkgver"
|
|
options="!check" # causes issues when bootstrapping (py3-pytest depends on this)
|
|
|
|
replaces="py-pygments" # Backwards compatibility
|
|
provides="py-pygments=$pkgver-r$pkgrel" # Backwards compatibility
|
|
|
|
# secfixes:
|
|
# 2.7.4-r0:
|
|
# - CVE-2021-20270
|
|
|
|
build() {
|
|
gpep517 build-wheel \
|
|
--wheel-dir .dist \
|
|
--output-fd 3 3>&1 >&2
|
|
}
|
|
|
|
check() {
|
|
python3 -m venv --clear --without-pip --system-site-packages .testenv
|
|
.testenv/bin/python3 -m installer .dist/*.whl
|
|
.testenv/bin/python3 -m pytest
|
|
}
|
|
|
|
package() {
|
|
python3 -m installer -d "$pkgdir" \
|
|
.dist/pygments*.whl
|
|
|
|
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="
|
|
f8547b1eb032fb4c0ad15f1bb61bc6d8c25b309e61850a7ebe4e879fefe1ebb0acba53192d1294e8ef243613ba546e1e7ac7474ab1b49b1a1c1551c6733d9ec7 pygments-2.19.1.tar.gz
|
|
5843e84f597cb249c2ca4c88b224a7e737b204ce8cbb136005576739126b1f72d2cb89b12bcb23cd863d5f6447951ad767d37a38cbcb5d8db70f1f4fb5c11a76 build-with-setuptools.patch
|
|
"
|