Mail archive
alpine-aports

[alpine-aports] [PATCH] testing/py-cycler: Add support for python3

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

---
 testing/py-cycler/APKBUILD | 41 ++++++++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 9 deletions(-)
diff --git a/testing/py-cycler/APKBUILD b/testing/py-cycler/APKBUILD
index ffa6c6e306..0b6be8f00a 100644
--- a/testing/py-cycler/APKBUILD
+++ b/testing/py-cycler/APKBUILD
_at_@ -8,22 +8,45 @@ pkgdesc="Composable style cycles in Python"
 url="http://matplotlib.org/cycler/"
 arch="noarch"
 license="BSD"
-depends="python2"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
+depends=""
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3"
 source="https://files.pythonhosted.org/packages/source/C/Cycler/$_pkgname-$pkgver.tar.gz"
+builddir="$srcdir/"$_pkgname-$pkgver
 
-builddir="${srcdir}/${_pkgname}-$pkgver"
 build() {
-	cd "$builddir" || return 1
-	python2 setup.py build || return 1
+	cd "$builddir"
+	python2 setup.py build
+	python3 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	python2 setup.py check
+	python3 setup.py check
 }
 
 package() {
+	mkdir -p "$pkgdir"
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+	install_if="$pkgname=$pkgver-r$pkgrel $python"
+
 	cd "$builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+	$python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+_py2() {
+	replaces="$pkgname"
+	_py python2
+}
+
+_py3() {
+	_py python3
 }
 
 md5sums="4cb42917ac5007d1cdff6cccfe2d016b  cycler-0.10.0.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 - 10:05:59 UTC