# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
pkgname=python-sphinxcontrib-serializinghtml
_name=${pkgname#python-}
pkgver=1.1.10
pkgrel=3
pkgdesc='Sphinx extension which outputs "serialized" HTML files (json and pickle)'
arch=('any')
url=https://github.com/sphinx-doc/sphinxcontrib-serializinghtml
license=('BSD-2-Clause')
depends=('python')
makedepends=('git' 'python-build' 'python-flit-core' 'python-installer')
#checkdepends=('python-pytest' 'python-sphinx')
source=("git+$url.git#tag=$pkgver")
b2sums=('5622d9c45ed753dc3ac62881b7a72cdc7c2c55a1eaa13cef2b1db3b8c3b9348409e6d2e23dc9b4c877b68d8a4df5efc8053880230ec5c0fddd533b3dc23834df')
build() {
cd "$_name"
python -m build --wheel --skip-dependency-check --no-isolation
}
#check() {
# cd "$_name"
# pytest
#}
package() {
cd "$_name"
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
}