Mail archive
alpine-aports

[alpine-aports] [PATCH 5/8] main/cython: Add support for cython3

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

Note that this breaks compatibility with a few packages that I since
I am not sure how to add the -dev. If that is fixed, remember to add
the -dev to py-pandas. The following packages should be broken:

    community/libplist
    community/py-numpy
    community/py-opengl-accelerate
    community/py-rencode
    community/xpra
    testing/ceph
    testing/py-cassandra-driver

---
 main/cython/APKBUILD | 39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)
diff --git a/main/cython/APKBUILD b/main/cython/APKBUILD
index 53e7b443d4..fc185c9c9c 100644
--- a/main/cython/APKBUILD
+++ b/main/cython/APKBUILD
_at_@ -3,26 +3,53 @@
 pkgname=cython
 pkgver=0.25.1
 pkgrel=0
-pkgdesc="Cython is an optimising static compiler for both the Python & the extended Cython programming languages."
+pkgdesc="C-extensions for Python"
 url="http://cython.org"
 arch="all"
 license="ASL-2.0"
 depends=""
-depends_dev="python2-dev py-pgen cython"
-makedepends="$depends_dev"
-subpackages="$pkgname-dev"
+depends_dev="py-pgen cython"
+makedepends="$depends_dev python2-dev py-setuptools python3-dev"
+subpackages="${pkgname}3:_py3 ${pkgname}2:_py2" # Split into -dev
 source="$pkgname-$pkgver.tar.gz::https://github.com/cython/cython/archive/$pkgver.tar.gz"
 builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
 	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() {
+	mkdir -p "$pkgdir"
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc ${python:6:1}"
+	depends="$depends $python"
+	install_if="pkgname=$pkgver-r$pkgrel $python"
+
 	cd "$builddir"
-	python2 setup.py install --prefix=/usr \
-		--root="$pkgdir" --optimize=1 || return 1
+	$python setup.py install --prefix=/usr \
+		--root="$subpkgdir" --optimize=1 || return 1
+}
+
+_py2() {
+	replaces="$pkgname"
+	depends="${depends//py-/py2-}"
+	_py python2
+}
+
+_py3() {
+	depends="${depends//py-/py3-}"
+	_py python3
 }
 
 md5sums="775d29a7735798720e26782cac088f1b  cython-0.25.1.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:12 UTC