# Contributor: Matt Smith # Maintainer: Matt Smith pkgname=py-urwid _pkgname=urwid pkgver=2.0.1 pkgrel=0 pkgdesc="A console user interface library for Python" url="http://urwid.org/" arch="all" license="LGPL-2.0-or-later" makedepends="python2-dev python3-dev py-setuptools" checkdepends="py-twisted py2-tornado py3-tornado" # twisted isn't packaged for python3 subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="https://files.pythonhosted.org/packages/source/u/$_pkgname/$_pkgname-$pkgver.tar.gz" builddir="$srcdir"/$_pkgname-$pkgver build() { cd "$builddir" python2 setup.py build python3 setup.py build } package() { mkdir -p "$pkgdir" } _py2() { replaces="$pkgname" depends="${depends//py-/py2-}" _py python2 } _py3() { depends="${depends//py-/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" } check() { cd "$builddir" python2 setup.py test python3 setup.py test } sha512sums="99c86a26b08c624c23207ce8e587e8442bece1f522e0c788600ad5f01a4c679efff95dd947edade8b6f4adc376edca949a40c305f9d5ddaf6a0ff97f13c6da30 urwid-2.0.1.tar.gz"