From a0172993482abf7e6c950828aee9136e541a4eec Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Fri, 23 Aug 2019 23:11:03 +0000 Subject: [PATCH] added extra/python2-numpy --- extra/python2-numpy/PKGBUILD | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 extra/python2-numpy/PKGBUILD diff --git a/extra/python2-numpy/PKGBUILD b/extra/python2-numpy/PKGBUILD new file mode 100644 index 000000000..7c6b86de5 --- /dev/null +++ b/extra/python2-numpy/PKGBUILD @@ -0,0 +1,59 @@ +# Maintainer: Jan de Groot +# Maintainer: Felix Yan +# Contributor: Douglas Soares de Andrade +# Contributor: Angel 'angvp' Velasquez + +# ALARM: Kevin Mihelich +# - standalone python2 variant until upstream fixes packages + +pkgname='python2-numpy' +pkgver=1.16.4 +pkgrel=1.1 +pkgdesc="Scientific tools for Python" +arch=('x86_64') +license=('custom') +url="https://www.numpy.org/" +makedepends=('cblas' 'lapack' 'python2' 'python2-setuptools' + 'gcc-fortran' 'python2-nose' 'cython2') +checkdepends=('python2-pytest') +options=('staticlibs') +source=("$pkgname-$pkgver.tar.gz::https://github.com/numpy/numpy/archive/v$pkgver.tar.gz") +sha512sums=('c8437e01a8c6c37787a8bf52f26d1adb273a6bb8f709f3cd92b427c63a1f772f9b2285b46321f2bd1a60a572797223d801aaed0fc2782bcdc7cbe39cd8c34c69') + +prepare() { + cp -a numpy-$pkgver{,-py2} + cd numpy-$pkgver-py2 + + 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') +} + +build() { + cd "$srcdir"/numpy-$pkgver-py2 + python2 setup.py build +} + +check() { + # TODO: Fix fortran tests here (it works fine after installation) + + cd "$srcdir"/numpy-$pkgver-py2 + python2 setup.py install --root="$PWD/tmp_install" --optimize=1 + cd "$PWD/tmp_install" + PATH="$PWD/usr/bin:$PATH" PYTHONPATH="$PWD/usr/lib/python2.7/site-packages:$PYTHONPATH" python2 -c 'import numpy; numpy.test()' +} + +package() { + depends=('cblas' 'lapack' 'python2') + optdepends=('python2-nose: testsuite' + 'openblas: faster linear algebra') + + cd numpy-$pkgver-py2 + python2 setup.py 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/" + + mv "$pkgdir"/usr/bin/f2py{,2} +}