blob: 6448585ffd2119e3bdb3c0a0804ff3f7c5cbbe19 (
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
|
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py-pygments
_pkgname=Pygments
pkgver=2.1.3
pkgrel=0
pkgdesc="A syntax highlighting package written in Python."
url="http://pygments.org/"
arch="noarch"
license="BSD"
depends=""
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-doc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
build() {
cd "$builddir"
python2 setup.py build || return 1
python3 setup.py build || return 1
}
package() {
mkdir -p "$pkgdir"
}
_py2() {
replaces="$pkgname"
_py python2
}
_py3() {
_py python3
}
_py() {
local python="$1"
pkgdesc="$pkgdesc (for $python)"
depends="$depends $python"
install_if="$pkgname=$pkgver-r$pkgrel $python"
cd "$builddir"
$python setup.py install --prefix=/usr --root="$subpkgdir"
}
doc() {
cd "$builddir"
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname || return 1
for _doc in AUTHORS CHANGES LICENSE TODO; do
install -Dm644 $_doc "$subpkgdir"/usr/share/doc/$pkgname/$_doc \
|| return 1
done
install -Dm644 doc/pygmentize.1 \
"$subpkgdir"/usr/share/man/man1/pygmentize.1 || return 1
# Note: The documentation in the doc directory needs to be generated
# by py-sphinx
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/docs || return 1
cp -R ./doc/* "$subpkgdir"/usr/share/doc/$pkgname/docs/ || return 1
chmod -R 644 "$subpkgdir"/usr/share/doc/$pkgname/docs/ || return 1
rm -f "$subpkgdir"/usr/share/doc/$pkgname/docs/make.bat || return 1
rm -f "$subpkgdir"/usr/share/doc/$pkgname/docs/pygmentize.1 || return 1
# Fix subdir perms
find "$subpkgdir"/usr/share/doc/$pkgname/ -type d \
-exec chmod 755 '{}' \; || return 1
default_doc
}
md5sums="ed3fba2467c8afcda4d317e4ef2c6150 Pygments-2.1.3.tar.gz"
sha256sums="88e4c8a91b2af5962bfa5ea2447ec6dd357018e86e94c7d14bd8cacbc5b55d81 Pygments-2.1.3.tar.gz"
sha512sums="f6885abfa0033dc2b8894649c7a4626165af01e69268344f002efdfc536c776a9af86be4e76e5905bd31cb78096e1ed3c16d9dd4b29c6a97b4c9cc1bfd7a5b67 Pygments-2.1.3.tar.gz"
|