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

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

build() {
  cd "$srcdir"/python-fastpbkdf2
  python setup.py build
}

check() {
  cd "$srcdir"/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 setup.py install --root="$pkgdir/" --optimize=1
}
sha256sums=('SKIP')
