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

pkgname=python-fastbencode
_pkgname=fastbencode
pkgver=0.3.1
pkgrel=1
pkgdesc="Implementation of bencode with optional fast C extensions"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://github.com/breezy-team/fastbencode"
license=(GPL-2.0-or-later)
depends=(
  glibc
  python
)
makedepends=(
  cython
  python-build
  python-installer
  python-setuptools
  python-wheel
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('103c93fe84db0c7088de4e2944c70e619d674e8fe55161130aeb1492eec679f9')

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

check() {
  cd $_pkgname-$pkgver
  python -m unittest discover -vs fastbencode/tests
}

package() {
  cd $_pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}
