Mail archive
alpine-aports

[alpine-aports] [PATCH] testing/py-cycler: Build py2- and py3- versions as subpkgs

From: Marian Buschsieweke <marian.buschsieweke_at_ovgu.de>
Date: Sun, 20 May 2018 12:02:57 +0200

---
 testing/py-cycler/APKBUILD | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/testing/py-cycler/APKBUILD b/testing/py-cycler/APKBUILD
index ffa6c6e306..6c3d90eee5 100644
--- a/testing/py-cycler/APKBUILD
+++ b/testing/py-cycler/APKBUILD
_at_@ -3,27 +3,45 @@
 pkgname=py-cycler
 _pkgname=cycler
 pkgver=0.10.0
-pkgrel=0
+pkgrel=1
 pkgdesc="Composable style cycles in Python"
 url="http://matplotlib.org/cycler/"
 arch="noarch"
 license="BSD"
-depends="python2"
+depends=""
 depends_dev=""
-makedepends="python2-dev py-setuptools"
+makedepends="python2-dev python3-dev py-setuptools"
 install=""
-subpackages=""
+subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3"
 source="https://files.pythonhosted.org/packages/source/C/Cycler/$_pkgname-$pkgver.tar.gz"
 
 builddir="${srcdir}/${_pkgname}-$pkgver"
 build() {
 	cd "$builddir" || return 1
 	python2 setup.py build || return 1
+	python3 setup.py build || return 1
 }
 
 package() {
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+	replaces="$pkgname"
+	_py python2
+}
+
+_py3() {
+	_py python3
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+
 	cd "$builddir"
-	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
+	$python setup.py install --prefix=/usr --root="$subpkgdir" || return 1
 }
 
 md5sums="4cb42917ac5007d1cdff6cccfe2d016b  cycler-0.10.0.tar.gz"
-- 
2.17.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sun May 20 2018 - 12:02:57 GMT