# Contributor: Dirk Stolle

_realname=sphinxcontrib-qthelp
pkgname=python-${_realname}
pkgver=2.0.0
pkgrel=1
pkgdesc='Sphinx extension which outputs QtHelp documents'
arch=('any')
url='https://github.com/sphinx-doc/sphinxcontrib-wthelp'
msys2_references=(
  'cygwin: python-sphinxcontrib-qthelp'
  'purl: pkg:pypi/sphinxcontrib-qthelp'
)
license=('spdx:BSD-2-Clause')
depends=('python')
makedepends=(
  'python-build'
  'python-flit-core'
  'python-installer'
)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname/-/_}-${pkgver}.tar.gz")
sha256sums=('4fe7d0ac8fc171045be623aba3e2a8f613f8682731f9153bb2e40ece16b9bbab')

build() {
  cp -r "${_realname/-/_}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"

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

package() {
  cd "python-build-${MSYSTEM}"

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

  install -Dm644 LICENCE.rst "${pkgdir}${MSYSTEM_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
