# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>

pkgname=python-wheezy-template
_pkgname=wheezy.template
pkgver=3.2.3
pkgrel=2
pkgdesc="A lightweight template library"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://github.com/akornatskyy/wheezy.template"
license=(MIT)
depends=(
  glibc
  python
)
makedepends=(
  cython
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('7ab065cac94f1509857662be718c10dafadeba550c8d8dc853b8f66c270569c2')

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

check() {
  cd "$_pkgname-$pkgver"
  python -m installer -d tmp_install dist/*.whl
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  PYTHONPATH="$PWD/tmp_install/$site_packages" pytest
}

package() {
  cd "$_pkgname-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
