# Contributor: Stuart Cardall # Contributor: Oleg Titov # Maintainer: Stuart Cardall pkgname=cython pkgver=0.29.10 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="py2-setuptools py3-setuptools python2-dev python3-dev" subpackages="cython2:_py2 cython3:_py3 cython-doc" source="cython-$pkgver.tar.gz::https://github.com/cython/cython/archive/$pkgver.tar.gz" # compatible fix for removing dev subpkg from apkbuild # cython is not a library but a compiler and does not need a dev subpackage provides=cython-dev prepare() { cp -r "$builddir" "$builddir"-py2 } build() { python3 setup.py build cd "$builddir"-py2 python2 setup.py build } check() { make test } package() { mkdir -p "$pkgdir" install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/cython/license" install -Dm 644 README.rst "$pkgdir/usr/share/doc/cython/readme.rst" } _py2() { cd "$builddir"-py2 _py python2 local f; for f in cygdb cython cythonize; do mv "$subpkgdir"/usr/bin/$f "$subpkgdir"/usr/bin/${f}2 done } _py3() { cd "$builddir" _py python3 local f; for f in cygdb cython cythonize; do mv "$subpkgdir"/usr/bin/$f "$subpkgdir"/usr/bin/${f}3 ln -s ${f}3 "$subpkgdir"/usr/bin/$f done } _py() { _python="$1" pkgdesc="$pkgdesc (for $_python)" depends="$depends $_python" install_if="cython=$pkgver-r$pkgrel $_python" $_python setup.py install --prefix=/usr --root="$subpkgdir" --optimize=1 } sha512sums="a78fbe21251beb598489194997218dd32f54d5d46cf684a517d563049ee185ed495dc874e3db9627e9f097dbb6cc0e80bfadd173c8de02d24079ef7b90133c4e cython-0.29.10.tar.gz"