# Maintainer: Daniel M. Capella <polyzen@archlinux.org>

_name=sphinx_basic_ng
pkgname=python-sphinx-basic-ng
pkgver=1.0.0b2
pkgrel=1
pkgdesc='Modernised skeleton for Sphinx themes'
arch=('any')
url=https://github.com/pradyunsg/sphinx-basic-ng
license=('MIT')
depends=('python-sphinx')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
sha256sums=('9ec55a47c90c8c002b5960c57492ec3021f5193cb26cebc2dc4ea226848651c9')
b2sums=('57983c174bfec3e3f40d7a3de0a53903394f47d93c5aba0d2953f8f3f5526e36d67712453aa5c1060ced92f09c4ae8e86d9c1080834cff038a1c224e7dfd6fbc')

build() {
  cd $_name-$pkgver
  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  # Symlink license file
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  install -d "$pkgdir"/usr/share/licenses/$pkgname
  ln -s "$site_packages"/$_name-$pkgver.dist-info/LICENSE \
    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
