summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a37345570848c178aad50cb13589751cc06752ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#Maintainer: Dylan Delgado <dylan1496 at live dot com>

pkgname=python-numpy-git
_pkgname=numpy
pkgver=v1.23.0.dev0.r907.gf6efa62e3c
pkgrel=1
pkgdesc="Scientific tools for Python - git version"
arch=('x86_64')
license=('custom:BSD 3-clause')
url="https://www.numpy.org/"
depends=('cblas' 'lapack' 'python' 'openblas-lapack')
optdepends=('python-nose: testsuite')
makedepends=('python-setuptools' 'gcc-fortran' 'python-nose' 'cython')
checkdepends=('python-pytest' 'python-hypothesis')
conflicts=('python-numpy')
provides=('python-numpy')
options=('staticlibs')
source=("git+https://github.com/numpy/numpy.git")
sha512sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  # https://github.com/numpy/numpy/issues/17390
    sed -i '/error/a \    ignore:Module already imported so cannot be rewritten' ${srcdir}/numpy/pytest.ini
}

build() {
    cd ${srcdir}/numpy
    git submodule update --init
    python setup.py build
}

check() {
  cd ${srcdir}/numpy
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  cd "$PWD/tmp_install"
  PATH="$PWD/usr/bin:$PATH" PYTHONPATH="$PWD/usr/lib/python3.10/site-packages/:$PYTHONPATH" python -c 'import numpy; numpy.test()'
}

package() {
  cd ${srcdir}/numpy
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1

  install -m755 -d "${pkgdir}/usr/share/licenses/python-numpy"
  install -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/python-numpy/"
}