APKBUILD 1.27 KB
Newer Older
Matt Smith's avatar
Matt Smith committed
1
2
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer: Matt Smith <mcs@darkregion.net>
3
pkgname=py-urwid
4
_pkgname=urwid
5
6
pkgver=2.0.1
pkgrel=0
7
pkgdesc="A console user interface library for Python"
8
url="http://urwid.org/"
9
arch="all"
10
license="LGPL-2.0-or-later"
11
makedepends="python2-dev python3-dev py-setuptools"
12
checkdepends="py-twisted py2-tornado py3-tornado" # twisted isn't packaged for python3
13
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
14
source="https://files.pythonhosted.org/packages/source/u/$_pkgname/$_pkgname-$pkgver.tar.gz"
Matt Smith's avatar
Matt Smith committed
15

16
builddir="$srcdir"/$_pkgname-$pkgver
Matt Smith's avatar
Matt Smith committed
17
18

build() {
19
	cd "$builddir"
20
21
	python2 setup.py build
	python3 setup.py build
Matt Smith's avatar
Matt Smith committed
22
23
24
}

package() {
25
26
27
28
29
30
31
	mkdir -p "$pkgdir"
}

_py2() {
	replaces="$pkgname"
	depends="${depends//py-/py2-}"
	_py python2
32
33
}

34
35
36
_py3() {
	depends="${depends//py-/py3-}"
	_py python3
37
38
}

39
40
41
42
43
44
45
46
_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"
Matt Smith's avatar
Matt Smith committed
47
48
}

49
50
51
52
53
54
55
check() {
	cd "$builddir"
	python2 setup.py test
	python3 setup.py test
}

sha512sums="99c86a26b08c624c23207ce8e587e8442bece1f522e0c788600ad5f01a4c679efff95dd947edade8b6f4adc376edca949a40c305f9d5ddaf6a0ff97f13c6da30  urwid-2.0.1.tar.gz"