~dricottone/huttese-apk

ref: 9107e9b759aef081ae2b99a14954ddc0971d17bd huttese-apk/sr.ht/py-ansi2html/APKBUILD -rw-r--r-- 1.4 KiB
9107e9b7 — Drew DeVault Add git.sr.ht-webhooks service 5 years ago
                                                                                
a8017ef5 Drew DeVault
6b30e22f Drew DeVault
a8017ef5 Drew DeVault
01e3b966 Drew DeVault
6d8771f8 Drew DeVault
a8017ef5 Drew DeVault
bd54fdb8 Drew DeVault
a8017ef5 Drew DeVault
6d8771f8 Drew DeVault
a8017ef5 Drew DeVault
6d8771f8 Drew DeVault
a8017ef5 Drew DeVault
6b30e22f Drew DeVault
a8017ef5 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
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-ansi2html
_pkgname=ansi2html
pkgver=1.5.2
pkgrel=1
pkgdesc="Convert text with ANSI color codes to HTML"
url="http://github.com/ralphbean/ansi2html/"
arch="noarch"
license="LGPL-3.0-or-later"
depends="py-six"
makedepends="python2 python3 py-setuptools"
checkdepends="py2-pytest pytest py-mock py-nose"
source="$pkgname-$pkgver.tar.gz::https://github.com/ralphbean/$_pkgname/archive/$pkgver.tar.gz"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
builddir="$srcdir"/$_pkgname-$pkgver
options="!check" # upstream tests don't work unless module is installed

prepare() {
	cp -r "$builddir" "$builddir"-py3
}

build() {
	cd "$builddir"
	python2 setup.py build
	cd "$builddir"-py3
	python3 setup.py build
}

check() {
	cd "$builddir"
	pytest-2
	cd "$builddir"-py3
	pytest-3
}

package() {
	mkdir -p "$pkgdir"
}

_py2() {
	cd "$builddir"
	replaces="py-ansi2html"
	_py python2
	rm "$subpkgdir"/usr/bin/ansi2html
}

_py3() {
	cd "$builddir"-py3
	_py python3
}

_py() {
	python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends="$depends $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

sha512sums="d386502d755a393a8de2f9c37ac2f1d6cfad1ac5dd3c1e508fe42a72a49762d43546d474e9ad7def5c89b5d7466ae7dceb331c46e2be6cfc4d1f6896a278dce2  py-ansi2html-1.5.2.tar.gz"