# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=python-brotlicffi
pkgver=1.2.0.1
pkgrel=4
pkgdesc='Python bindings to the Brotli compression library'
arch=(x86_64 aarch64)
url=https://github.com/python-hyper/brotlicffi
license=(MIT)
depends=(
  brotli
  glibc
  python
  python-cffi
)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
source=(git+https://github.com/python-hyper/brotlicffi.git#tag=v${pkgver})
b2sums=('a4a0d4b15ca550c8737cde99e28cdb9b5e4c86aaab5e718b54b0658b5b4e76ea5fa62adf22dea0aea2cc8efe27d2cb34ef2c250d26b85fdb487d6e7a757ed8ee')

build() {
  cd brotlicffi
  USE_SHARED_BROTLI=1 python -m build --wheel --no-isolation
}

package() {
  cd brotlicffi
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/python-brotlicffi
}
