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

_realname='pyproject-hooks'
_pyname="${_realname/-/_}"
pkgname="python-${_realname}"
pkgver=1.3.3
pkgrel=1
pkgdesc='A low-level library for calling build-backends in pyproject.toml-based project'
arch=('any')
url='https://pyproject-hooks.readthedocs.io'
msys2_repository_url='https://github.com/pypa/pyproject-hooks'
msys2_changelog_url='https://pyproject-hooks.readthedocs.io/en/latest/changelog.html'
msys2_references=(
  'anitya: 320474'
  'archlinux: python-pyproject-hooks'
  'gentoo: dev-python/pyproject-hooks'
  'purl: pkg:pypi/pyproject-hooks'
)
license=('spdx:MIT')
depends=(
  'python'
)
makedepends=(
  'python-flit-core'
  'python-installer'
)
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('defda19b854fa0d3bd4f76ea4ddcba8abd7dcfcdd585a6690ade050744fc5f43')

build() {
  cd "${_pyname}-${pkgver}"

  python -m flit_core.wheel
}

package() {
  cd "${_pyname}-${pkgver}"

  python -m installer --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
