aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-traceback2/APKBUILD
blob: 333e094da660f203444e8861424990f2eb07b6a4 (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
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py-traceback2
_pkgname=${pkgname#py-*}
pkgver=1.4.0
pkgrel=0
pkgdesc="Backport of the Python3 stdlib traceback module"
url="https://github.com/testing-cabal/traceback2"
arch="noarch"
license="PSF"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
options="!check" # temp disable until py2-unittest2 is in repos
#checkdepends="py2-contextlib2 py-fixtures py-testtools py2-unittest2 py2-linecache2 py-extras"
source="$pkgname-$pkgver.tar.gz::https://github.com/testing-cabal/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

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

check() {
	cd "$builddir"
	python2 -m unittest2 discover
	python3 -m unittest2 discover
}

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

_py2() {
	_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"
}

sha512sums="33ef29ab051d5ddca1dc3e802cd0cbaf216067157b4e5bea4bb0481cd7a6758614fc551d614b5bcf3354757b315b9549bde9ff9c552980fb75ddb3aa31909d79  py-traceback2-1.4.0.tar.gz"