# Maintainer: Oleg Titov <oleg.titov@gmail.com>

pkgname=python-brotli
pkgver=1.1.0
pkgrel=5
pkgdesc='Brotli compression library - python library'
arch=('i686' 'x86_64')
license=('MIT')
url='https://github.com/google/brotli'
msys2_references=(
  "purl: pkg:pypi/brotli"
  "cpe: cpe:/a:google:brotli"
)
depends=('python')
makedepends=(
  'python-devel'
  'gcc'
  "python-setuptools"
  "python-build"
  "python-installer"
)
source=("brotli-${pkgver}.tar.gz::https://github.com/google/brotli/archive/v${pkgver}.tar.gz")
sha256sums=('e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff')

build() {
  cd "${srcdir}"/brotli-${pkgver}

  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd brotli-${pkgver}

  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -D -m644 "${srcdir}"/brotli-${pkgver}/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
