# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Ashwin Vishnu <ashwinvis+arch at pr0t0nm4il dot com>
# Contributor: xantares

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

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

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

package() {
  cd pythran-$pkgver
  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
}
