# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

pkgname=python-cffi
pkgver=2.1.0
pkgrel=1
pkgdesc="Foreign Function Interface for Python calling C code"
arch=('i686' 'x86_64')
url="https://cffi.readthedocs.org/"
msys2_repository_url='https://github.com/python-cffi/cffi'
msys2_references=(
  'purl: pkg:pypi/cffi'
)
license=('spdx:MIT')
depends=('python-pycparser' 'libffi')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'gcc' 'libffi-devel')
source=("https://github.com/python-cffi/cffi/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('a69036098a10a868931309440132ada6e4bfc4289304023627ddde8df85a9589')

build() {
  cd cffi-$pkgver

  python -m build -nw
}

package() {
  cd cffi-$pkgver

  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
