From a8017ef5fec8c3fe33f335fc86d157738ede85b3 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 11 Mar 2019 16:46:56 -0400 Subject: [PATCH] Add py-ansi2html --- sr.ht/py-ansi2html/APKBUILD | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sr.ht/py-ansi2html/APKBUILD diff --git a/sr.ht/py-ansi2html/APKBUILD b/sr.ht/py-ansi2html/APKBUILD new file mode 100644 index 0000000..6953d1f --- /dev/null +++ b/sr.ht/py-ansi2html/APKBUILD @@ -0,0 +1,59 @@ +# Contributor: Fabian Affolter +# Maintainer: Fabian Affolter +pkgname=py-ansi2html +_pkgname=ansi2html +pkgver=1.5.2 +pkgrel=0 +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="py-setuptools" +checkdepends="py-nose py-mock py2-pytest pytest" +source="$pkgname-$pkgver.tar.gz::https://github.com/ralphbean/$_pkgname/archive/$pkgver.tar.gz" +builddir="$srcdir"/$_pkgname-$pkgver +options="!check" # upstream tests don't work unless module is installed + +prepare() { + cp -r "$builddir" "$builddir"-py3 +} + +build() { + cd "$builddir" + PYTHONPATH="$(pwd)" python2 ./tests/test_ansi2html.py + cd "$builddir"-py3 + PYTHONPATH="$(pwd)" python3 ./tests/test_ansi2html.py +} + +check() { + cd "$builddir" + pytest-2 + cd "$builddir"-py3 + pytest-3 +} + +package() { + mkdir -p "$pkgdir" +} + +_py2() { + cd "$builddir" + replaces="py-ansi2html" + _py python2 +} + +_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" -- 2.45.2