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

_realname='build'
pkgname="python-${_realname}"
pkgver=1.6.1
pkgrel=1
pkgdesc='A simple, correct Python build frontend'
arch=('any')
url='https://build.pypa.io'
msys2_repository_url='https://github.com/pypa/build'
msys2_documentation_url='https://build.pypa.io'
msys2_changelog_url='https://build.pypa.io/en/stable/changelog.html'
msys2_references=(
  'anitya: 132276'
  'archlinux: python-build'
  'gentoo: dev-python/build'
  'purl: pkg:pypi/build'
)
license=('spdx:MIT')
depends=(
  'python-packaging'
  'python-pyproject-hooks'
)
makedepends=(
  'python-flit-core'
  'python-installer'
)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('51cc11666391ab6f092070437ac747002ff46f3e4113a3622177ee6b488bfc53')

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

  python -m flit_core.wheel
}

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

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

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