mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-25 02:52:13 +08:00
88 lines
3.0 KiB
Bash
88 lines
3.0 KiB
Bash
|
# Contributor from Arch: https://projects.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/python-numpy
|
||
|
|
||
|
pkgbase=python-numpy
|
||
|
pkgname=('python2-numpy' 'python3-numpy')
|
||
|
pkgver=1.10.2
|
||
|
pkgrel=1
|
||
|
pkgdesc="Scientific tools for Python"
|
||
|
arch=('i686' 'x86_64')
|
||
|
license=('custom')
|
||
|
url="http://www.numpy.org/"
|
||
|
makedepends=('cblas' 'lapack' 'python3' 'python2' 'python3-setuptools' 'python2-setuptools' 'gcc-fortran'
|
||
|
'python3-nose' 'python2-nose' 'python3-cython' 'python2-cython')
|
||
|
options=('staticlibs')
|
||
|
source=("$pkgbase-$pkgver.tar.gz::https://github.com/numpy/numpy/archive/v$pkgver.tar.gz" 'site.cfg')
|
||
|
md5sums=('74268c2ec25fd917756e10e39bd179c0'
|
||
|
'6ac5f9dac5d4c0e25a2eba6c98bf5b3c')
|
||
|
|
||
|
prepare() {
|
||
|
cp site.cfg numpy-$pkgver
|
||
|
cp -a numpy-$pkgver numpy-py2-$pkgver
|
||
|
cd numpy-py2-$pkgver
|
||
|
|
||
|
sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
|
||
|
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
|
||
|
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
|
||
|
-i $(find . -name '*.py')
|
||
|
|
||
|
cd ../numpy-$pkgver
|
||
|
sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python3|" \
|
||
|
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python3|" \
|
||
|
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python3|" \
|
||
|
-i $(find . -name '*.py')
|
||
|
}
|
||
|
|
||
|
build() {
|
||
|
export LDFLAGS="$LDFLAGS -shared"
|
||
|
|
||
|
echo "Building Python2"
|
||
|
cd numpy-py2-$pkgver
|
||
|
python2 setup.py config_fc --fcompiler=gnu95 build
|
||
|
|
||
|
echo "Building Python3"
|
||
|
cd ../numpy-$pkgver
|
||
|
python3 setup.py config_fc --fcompiler=gnu95 build
|
||
|
}
|
||
|
|
||
|
package_python2-numpy() {
|
||
|
depends=('lapack' 'python2' 'cblas')
|
||
|
optdepends=('python2-nose: testsuite' 'atlas-lapack: for improved performance of some linear algebra operations')
|
||
|
provides=("python-numpy=${pkgver}")
|
||
|
replaces=('python-numpy')
|
||
|
conflicts=('python-numpy')
|
||
|
|
||
|
_pyver=2.7
|
||
|
|
||
|
export ATLAS=None
|
||
|
export LDFLAGS="$LDFLAGS -shared"
|
||
|
|
||
|
cd numpy-py2-$pkgver
|
||
|
python2 setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root="${pkgdir}" --optimize=1
|
||
|
|
||
|
install -m755 -d "${pkgdir}/usr/share/licenses/python2-numpy"
|
||
|
install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python2-numpy/"
|
||
|
|
||
|
install -m755 -d "${pkgdir}/usr/include/python${_pyver}"
|
||
|
ln -sf /usr/lib/python${_pyver}/site-packages/numpy/core/include/numpy "${pkgdir}/usr/include/python${_pyver}/numpy"
|
||
|
}
|
||
|
|
||
|
package_python3-numpy() {
|
||
|
depends=('lapack' 'python3' 'cblas')
|
||
|
optdepends=('python3-nose: testsuite' 'atlas-lapack: for improved performance of some linear algebra operations')
|
||
|
|
||
|
_pyver=3.4
|
||
|
_pyinc=3.4m
|
||
|
|
||
|
export ATLAS=None
|
||
|
export LDFLAGS="$LDFLAGS -shared"
|
||
|
|
||
|
cd numpy-$pkgver
|
||
|
python3 setup.py config_fc --fcompiler=gnu95 install --prefix=/usr --root="${pkgdir}" --optimize=1
|
||
|
|
||
|
install -m755 -d "${pkgdir}/usr/share/licenses/python3-numpy"
|
||
|
install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python3-numpy/"
|
||
|
|
||
|
install -m755 -d "${pkgdir}/usr/include/python${_pyinc}"
|
||
|
ln -sf /usr/lib/python${_pyver}/site-packages/numpy/core/include/numpy "${pkgdir}/usr/include/python${_pyinc}/numpy"
|
||
|
}
|