# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-sphinxcontrib-jquery
pkgver=4.1
pkgrel=2
pkgdesc="Sphinx jquery extension"
url="https://github.com/sphinx-contrib/jquery"
arch="noarch"
license="0BSD"
depends="py3-sphinx"
makedepends="
	py3-flit-core
	py3-gpep517
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/sphinx-contrib/jquery/archive/refs/tags/v$pkgver.tar.gz
	sphinx-7.1.patch
	sphinx-7.2.patch
	"
builddir="$srcdir"/jquery-$pkgver

replaces="py-sphinxcontrib-images" # Backwards compatibility
provides="py-sphinxcontrib-images=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
17c6b69952171a715c12dea146e8654b3de7940ff4d357ac9fa0070c3daa057e156279d2ca292e4367a5788d58b7347a4df1539b33bdfbea2319473c189dff6a  py3-sphinxcontrib-jquery-4.1.tar.gz
4d462869ca570bc36bae14ad453b46d77b75743f0f683980360ca688392f3a838f74ca800279b40176df2eb4b17fdd27502c2a7c62c4b69ae69e91760480fa90  sphinx-7.1.patch
bf860e9c14986dfd36ec5f9b3665d14be95c0734b5b0f99edce1b460189e1e98a3dcfc28f477268b90790fde44cd39700e7a2c64e56ae81a241e6ebb03b8df68  sphinx-7.2.patch
"
