mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-12 13:34:37 +08:00
48 lines
1.2 KiB
Bash
48 lines
1.2 KiB
Bash
pkgbase=cython
|
|
pkgname=('cython3' 'cython2')
|
|
pkgver=0.27.3
|
|
pkgrel=1
|
|
pkgdesc="C-Extensions for Python"
|
|
arch=(x86_64)
|
|
url="http://cython.org"
|
|
license=('APACHE')
|
|
makedepends=('python3-setuptools' 'python2-setuptools')
|
|
source=($pkgbase-$pkgver.tar.gz::"https://github.com/cython/cython/archive/$pkgver.tar.gz")
|
|
sha256sums=('648feb8a257574a3e4ef854475e7d767732ef26e870d2f9fcc1ca5b244b3ac89')
|
|
|
|
prepare() {
|
|
cp -r cython-$pkgver cython2-$pkgver
|
|
find cython2-$pkgver -name '*.py' | xargs sed -e 's|/usr/bin/env python|/usr/bin/env python2|' -e 's|/usr/bin/python|/usr/bin/python2|' -i
|
|
}
|
|
|
|
build() {
|
|
cd cython-$pkgver
|
|
python3 setup.py build
|
|
|
|
cd ../cython2-$pkgver
|
|
python2 setup.py build
|
|
}
|
|
|
|
package_cython3() {
|
|
depends=(python3 python3-setuptools)
|
|
|
|
cd cython-$pkgver
|
|
python3 setup.py install --root="$pkgdir" --skip-build
|
|
|
|
for f in cygdb cython cythonize; do
|
|
mv "$pkgdir"/usr/bin/$f "$pkgdir"/usr/bin/${f}3
|
|
ln -s ${f}3 "$pkgdir"/usr/bin/$f
|
|
done
|
|
}
|
|
|
|
package_cython2() {
|
|
depends=(python2 python2-setuptools)
|
|
|
|
cd cython2-$pkgver
|
|
python2 setup.py install --root="$pkgdir" --skip-build
|
|
|
|
for f in cygdb cython cythonize; do
|
|
mv "$pkgdir"/usr/bin/$f "$pkgdir"/usr/bin/${f}2
|
|
done
|
|
}
|