# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Ashwin Vishnu <ashwinvis+arch at pr0t0nm4il dot com>
# Contributor: xantares

pkgname=python-pythran
pkgver=0.17.0
pkgrel=2
pkgdesc='Ahead of Time compiler for numeric kernels'
arch=(any)
url='https://pythran.readthedocs.io/'
license=(BSD-3-Clause)
depends=(boost
         python
         python-beniget
         python-gast
         python-numpy
         python-ply
         python-setuptools # distutils
         xsimd)
makedepends=(git
             python-build
             python-installer
             python-wheel)
#checkdepends=(python-pytest)
source=(git+https://github.com/serge-sans-paille/pythran#tag=$pkgver)
sha256sums=('b2758ab1a90c0098db4b7dc416066c032f49650d440784aee3bf74203fc2c6cc')

build() {
  cd pythran
  python -m build --wheel --no-isolation
}

# Takes many hours
#check() {
#  cd pythran-$pkgver
#  pytest -v
#}

package() {
  cd pythran
  python -m installer --destdir="$pkgdir" dist/*.whl
  rm -r "$pkgdir"/usr/lib/python*/site-packages/pythran/{boost,xsimd} # Remove bundled boost and xsimd
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}