summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0af11ce344813f8e62bf8d7642d175b902801d0c (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
# Maintainer: Maks Verver <maks@verver.ch>

pkgname=pypy3-numpy
pkgver=2.2.1
pkgrel=1
pkgdesc="Scientific tools for Python"
arch=('x86_64')
license=('custom')
url="https://www.numpy.org/"
depends=('cblas' 'lapack' 'pypy3')
optdepends=('blas-openblas: faster linear algebra')
makedepends=('pypy3-build' 'pypy3-cython' 'pypy3-installer' 'meson-pypy3' 'cmake' 'gcc-fortran')
source=("https://github.com/numpy/numpy/releases/download/v$pkgver/numpy-$pkgver.tar.gz")
md5sums=('57c5757508a50d1daefa4b689e9701cb')
sha256sums=('45681fd7128c8ad1c379f0ca0776a8b0c6583d2f69889ddac01559dfe4390918')

build() {
  cd numpy-$pkgver
  CYTHON=/usr/bin/cython-pypy3 \
  CFLAGS+=" -ffat-lto-objects" \
  CXXFLAGS+=" -ffat-lto-objects" \
  pypy3 -m build --wheel --no-isolation --skip-dependency-check \
    -Csetup-args="-Dblas=cblas" \
    -Csetup-args="-Dlapack=lapack"
}

package() {
  cd numpy-$pkgver
  pypy3 -m installer --destdir="$pkgdir" dist/*.whl

  # Symlink license file
  local site_packages=$(pypy3 -c "import site; print(site.getsitepackages()[0])")
  install -d "$pkgdir"/usr/share/licenses/$pkgname
  ln -s "$site_packages"/numpy-$pkgver.dist-info/LICENSE.txt \
    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt

  # Symlink f2py
  mkdir -p "$pkgdir"/usr/bin
  ln -s /opt/pypy3/bin/f2py "$pkgdir"/usr/bin/f2py-pypy3
}