# Contributor: Dirk Stolle

_realname=sphinxcontrib-serializinghtml
pkgname=python-${_realname}
pkgver=2.0.0
pkgrel=1
pkgdesc='Sphinx extension which outputs "serialized" HTML files (JSON and pickle)'
arch=('any')
url='https://github.com/sphinx-doc/sphinxcontrib-serializinghtml'
msys2_references=(
  'cygwin: python-sphinxcontrib-serializinghtml'
  'purl: pkg:pypi/sphinxcontrib-serializinghtml'
)
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=('e9d912827f872c029017a53f0ef2180b327c3f7fd23c87229f7a8e8b70031d4d')

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"
}
