Mail archive
alpine-aports

[alpine-aports] [PATCH] testing/py-anyjson: fix python 3 support

From: Drew DeVault <sir_at_cmpwn.com>
Date: Sat, 20 Jan 2018 10:20:27 -0500

---
 testing/py-anyjson/APKBUILD | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/testing/py-anyjson/APKBUILD b/testing/py-anyjson/APKBUILD
index 4641a62508..59475e74e1 100644
--- a/testing/py-anyjson/APKBUILD
+++ b/testing/py-anyjson/APKBUILD
_at_@ -8,17 +8,28 @@ pkgdesc="Wraps the best available JSON implementation available in a common inte
 url="https://bitbucket.org/runeh/anyjson/"
 arch="noarch"
 license="BSD"
-makedepends="python2-dev python3-dev py-setuptools"
+makedepends="python2-dev python3-dev py-setuptools py3-nose py3-pytest"
 subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
 builddir="$srcdir"/$_pkgname-$pkgver
 
+prepare() {
+	cd "$srcdir"
+	cp -R "$_pkgname-$pkgver" "$_pkgname-$pkgver"-py3
+}
+
 build() {
 	cd "$builddir"
 	python2 setup.py build || return 1
+	cd "$builddir"-py3
 	python3 setup.py build || return 1
 }
 
+check() {
+	cd "$builddir"-py3
+	pytest-3
+}
+
 package() {
 	mkdir -p "$pkgdir"
 }
_at_@ -26,11 +37,13 @@ package() {
 _py2() {
 	replaces="$pkgname"
 	depends="${depends//py-/py2-}"
+	cd "$builddir"
 	_py python2
 }
 
 _py3() {
 	depends="${depends//py-/py3-}"
+	cd "$builddir"-py3
 	_py python3
 }
 
_at_@ -39,8 +52,6 @@ _py() {
 	pkgdesc="$pkgdesc (for $python)"
 	depends="$depends $python"
 	install_if="$pkgname=$pkgver-r$pkgrel $python"
-
-	cd "$builddir"
 	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
-- 
2.15.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sat Jan 20 2018 - 10:20:27 GMT