mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-04 02:27:13 +08:00
97 lines
3.2 KiB
Bash
97 lines
3.2 KiB
Bash
# Maintainer: H W Tovetjärn (totte) <totte@tott.es>
|
|
# Contributors: P Miller <philm@chakra-project.org>
|
|
# Jan de Groot <jgc@archlinux.org>
|
|
# Douglas Soares de Andrade <dsa@aur.archlinux.org>
|
|
# Angel Velasquez (angvp) <angvp@archlinux.com.ve>
|
|
|
|
pkgbase=python-numpy
|
|
pkgname=('python3-numpy' 'python2-numpy')
|
|
pkgver=1.13.3
|
|
pkgrel=1
|
|
pkgdesc="Scientific tools for Python"
|
|
arch=('x86_64')
|
|
license=('custom')
|
|
url="http://numpy.org/"
|
|
makedepends=('openblas'
|
|
'gcc-fortran'
|
|
'lapack'
|
|
'python3' 'python2'
|
|
'python3-setuptools' 'python2-setuptools'
|
|
'python3-nose' 'python2-nose'
|
|
'python3-cython' 'python2-cython')
|
|
source=(https://github.com/numpy/numpy/archive/v${pkgver}.tar.gz "site.cfg")
|
|
md5sums=('a0d7ae9fa51a597d7d45871bfe50962b'
|
|
'050c4ca9c90195558ac037ae2af48ff9')
|
|
options=('staticlibs')
|
|
|
|
build() {
|
|
cd "${srcdir}"
|
|
cp -a numpy-${pkgver} numpy-py2-${pkgver}
|
|
|
|
cp ${srcdir}/site.cfg numpy-${pkgver}
|
|
cp ${srcdir}/site.cfg numpy-py2-${pkgver}
|
|
|
|
export ATLAS=None
|
|
export LDFLAGS="$LDFLAGS -shared"
|
|
|
|
echo "Building Python 2 version"
|
|
cd "${srcdir}/numpy-py2-${pkgver}"
|
|
python2 setup.py config_fc --fcompiler=gnu95 build
|
|
|
|
echo "Building Python 3 version"
|
|
cd "${srcdir}/numpy-${pkgver}"
|
|
python3 setup.py config_fc --fcompiler=gnu95 build
|
|
}
|
|
|
|
package_python2-numpy() {
|
|
depends=('lapack' 'python2' 'openblas')
|
|
optdepends=('python2-nose: testsuite')
|
|
provides=('python-numpy')
|
|
conflicts=('python-numpy')
|
|
replaces=('python-numpy')
|
|
|
|
_pyver=2.7
|
|
|
|
export ATLAS=None
|
|
export LDFLAGS="$LDFLAGS -shared"
|
|
|
|
cd "${srcdir}/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/"
|
|
|
|
sed -i -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|" \
|
|
$(find ${pkgdir} -name '*.py')
|
|
|
|
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' 'openblas')
|
|
optdepends=('python3-nose: testsuite')
|
|
|
|
_pyver=3.6
|
|
_pyinc=3.6m
|
|
|
|
export ATLAS=None
|
|
export LDFLAGS="$LDFLAGS -shared"
|
|
|
|
cd "${srcdir}/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/"
|
|
|
|
sed -i -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|" \
|
|
$(find ${pkgdir} -name '*.py')
|
|
|
|
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"
|
|
}
|