aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/py-cython/APKBUILD66
1 files changed, 66 insertions, 0 deletions
diff --git a/main/py-cython/APKBUILD b/main/py-cython/APKBUILD
new file mode 100644
index 0000000000..e59dd16981
--- /dev/null
+++ b/main/py-cython/APKBUILD
@@ -0,0 +1,66 @@
+# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
+# Contributor: Oleg Titov <oleg.titov@gmail.com>
+# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
+pkgname="py-cython"
+_pkgname=cython
+pkgver=0.29.6
+pkgrel=0
+pkgdesc="Cython is an optimising static compiler for both the Python & the extended Cython programming languages."
+url="https://cython.org"
+arch="all"
+license="Apache-2.0"
+options="!check" # several tests fail
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 \
+ $pkgname-doc \
+ py2-${pkgname#py-}-dev:_py2 py3-${pkgname#py-}-dev:_py3"
+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
+ python3 setup.py build
+}
+
+check() {
+ cd "$builddir"
+ make test
+}
+
+package() {
+ mkdir -p "$pkgdir"/usr/bin
+
+ local name; for name in cygdb cython cythonize; do
+ ln -s ${name}3 "$pkgdir"/usr/bin/$name
+ done
+
+ install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/license"
+ install -Dm 644 README.rst "$pkgdir/usr/share/doc/$pkgname/readme.rst"
+}
+
+_py2() {
+ replaces="cython"
+ _py python2
+}
+
+_py3() {
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ local pyver="${1:6: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" --optimize=1
+
+ local path; for path in "$subpkgdir"/usr/bin/*; do
+ mv "$path" "${path}${pyver}"
+ done
+}
+
+sha512sums="0fdf2bb7cf269a2251b08639f73ab03a98fbb5b616de18eba810ba6e6eb9a3706f8f265f7389ae34d2a701ca86920779ae533c1c68c9119aec1fbdfeea83ddb0 cython-0.29.6.tar.gz"