Mail archive
alpine-aports

[alpine-aports] [PATCH 6/8] main/py-nose: Add support for python3

From: Ivan Tham <pickfire_at_riseup.net>
Date: Mon, 8 May 2017 00:59:13 +0800

---
 main/py-nose/APKBUILD | 51 ++++++++++++++++++++++++++++++++-------------------
 1 file changed, 32 insertions(+), 19 deletions(-)
diff --git a/main/py-nose/APKBUILD b/main/py-nose/APKBUILD
index 7476876388..29ac3bac63 100644
--- a/main/py-nose/APKBUILD
+++ b/main/py-nose/APKBUILD
_at_@ -8,32 +8,45 @@ pkgdesc="A Python unittest module"
 url="http://readthedocs.org/docs/nose/"
 arch="noarch"
 license="LGPL2+"
-depends="python2 py-setuptools"
-depends_dev=""
-makedepends="python2-dev"
-install=""
-subpackages=""
+depends=""
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
-
-_builddir="$srcdir"/$_pkgname-$pkgver
-prepare() {
-	local i
-	cd "$_builddir"
-	for i in $source; do
-		case $i in
-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
-		esac
-	done
-}
+builddir="$srcdir"/$_pkgname-$pkgver
 
 build() {
-	cd "$_builddir"
+	cd "$builddir"
 	python2 setup.py build || return 1
+	python3 setup.py build || return 1
+}
+
+check() {
+	cd "$builddir"
+	python2 setup.py check || return 1
+	python3 setup.py check || return 1
 }
 
 package() {
-	cd "$_builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+	mkdir -p "$pkgdir"
+}
+
+_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" || return 1
+}
+
+_py2() {
+        replace="$pkgname"
+        _py python2
+}
+
+_py3() {
+        _py python3
 }
 
 md5sums="4d3ad0ff07b61373d2cefc89c5d0b20b  nose-1.3.7.tar.gz"
-- 
2.12.2
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon May 08 2017 - 00:59:13 UTC