# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Gordian Edenhofer <gordian.edenhofer[at]yahoo[dot]de>

pkgname=python-fastpbkdf2
pkgver=0.2
pkgrel=15
pkgdesc="A faster implementation of PBKDF2"
arch=('x86_64' 'aarch64')
license=('Apache-2.0')
url="https://github.com/Ayrx/python-fastpbkdf2"
depends=('python-cffi' 'python-six')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest')
source=("git+https://github.com/Ayrx/python-fastpbkdf2.git#tag=v$pkgver")
sha512sums=('2feea3934cb69cb6fa627d8fe79b3f09b75a5e11c4c9374e860787d5c5a63ad148f024b017de48c9421f25445e76ddb6f42adeb075e6c5bf3e9127c3c2bda673')

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

check() {
  cd python-fastpbkdf2
  local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
  PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-${python_version}" pytest
}

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