# Contributor: Dirk Stolle

_realname=sphinxcontrib-jsmath
pkgname=python-${_realname}
pkgver=1.0.1
pkgrel=1
pkgdesc='Sphinx extension which renders display math in HTML via JavaScript'
arch=('any')
url='https://github.com/sphinx-doc/sphinxcontrib-jsmath'
msys2_references=(
  'cygwin: python-sphinxcontrib-jsmath'
  'purl: pkg:pypi/sphinxcontrib-jsmath'
)
license=('spdx:BSD-2-Clause')
depends=('python')
makedepends=(
  'python-build'
  'python-flit-core'
  'python-installer'
  'python-setuptools'
)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8')

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 LICENSE "${pkgdir}${MSYSTEM_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
