# Contributor: Dirk Stolle

_realname=sphinx-alabaster-theme
pkgname=python-${_realname}
_pypiname=alabaster
provides=("python-${_pypiname}")
pkgver=1.0.0
pkgrel=1
pkgdesc='Light, configurable Sphinx theme'
arch=('any')
url='https://alabaster.readthedocs.io/'
msys2_repository_url='https://github.com/sphinx-doc/alabaster'
msys2_changelog_url='https://alabaster.readthedocs.io/en/latest/changelog.html'
msys2_references=(
  'archlinux: python-sphinx-alabaster-theme'
  'purl: pkg:pypi/alabaster'
)
license=('spdx:BSD-3-Clause')
depends=('python')
makedepends=(
  'python-build'
  'python-flit-core'
  'python-installer'
)
source=("https://pypi.org/packages/source/${_pypiname::1}/${_pypiname}/${_pypiname}-${pkgver}.tar.gz")
sha256sums=('c00dca57bca26fa62a6d7d0a9fcce65f3e026e9bfe33e9c538fd3fbb2144fd9e')

build() {
  cp -r "${_pypiname}-${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.rst "${pkgdir}${MSYSTEM_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
