diff options
author | Oleg Titov <oleg.titov@gmail.com> | 2019-02-06 16:01:02 -0600 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-04-17 11:45:35 +0000 |
commit | 9152114841efd08e0a5bca6eb82d7329f182322e (patch) | |
tree | 0fd630b379f7c30c9f3b99a26b6c925c20a7efb4 /main | |
parent | 0f953585896314833b6ceda31f4d4fa51cbf81d4 (diff) | |
download | aports-9152114841efd08e0a5bca6eb82d7329f182322e.tar.bz2 aports-9152114841efd08e0a5bca6eb82d7329f182322e.tar.xz |
main/py-cython: upgrade to 0.29.6, add support for python2 and python3 packages
Upgrade to 0.29.6, add support for python2 and python3 packages.
Diffstat (limited to 'main')
-rw-r--r-- | main/py-cython/APKBUILD | 66 |
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" |