mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-11 06:54:37 +08:00
94 lines
3.1 KiB
Bash
94 lines
3.1 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.8.0
|
|
pkgrel=1
|
|
pkgdesc="Scientific tools for Python"
|
|
arch=('x86_64')
|
|
license=('custom')
|
|
url="http://numpy.org/"
|
|
makedepends=('blas'
|
|
'gcc-fortran'
|
|
'lapack'
|
|
'python3'
|
|
'python2'
|
|
'python3-setuptools'
|
|
'python2-setuptools'
|
|
'python3-nose'
|
|
'python2-nose')
|
|
source=(http://downloads.sourceforge.net/numpy/numpy-${pkgver}.tar.gz)
|
|
sha512sums=('ec3d002ed786335e8748983261c96f88a9f1520fc345ad5b810dc02a5e126e15fe5afb02bed1f4b43d580a1da39583d86b84f57dc456b0702653e34e5357c857')
|
|
|
|
build() {
|
|
cd "${srcdir}"
|
|
cp -a numpy-${pkgver} 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')
|
|
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')
|
|
optdepends=('python3-nose: testsuite')
|
|
|
|
_pyver=3.3
|
|
_pyinc=3.3m
|
|
|
|
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"
|
|
}
|