# Contributor: 6543 <6543@obermui.de>
# Maintainer: 6543 <6543@obermui.de>
pkgname=py3-regress
pkgver=2024.11.1
pkgrel=0
pkgdesc="Python bindings to the Rust regress crate which provides ECMA regular expressions"
url="https://github.com/crate-py/regress"
# s390x https://github.com/crate-py/regress/issues/20
arch="all !s390x"
license="MIT"
depends="python3"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools-rust
	py3-wheel
	python3-dev
	py3-maturin
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/crate-py/regress/archive/refs/tags/v$pkgver.tar.gz
	update-rust-libc.patch"
builddir="$srcdir/regress-$pkgver"

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/regress*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
a2d68fc73cd9f5fedc3d6a5d48c00b0eaa4710395401eb90560ebba1a69fa52095c38da28e91bb83a4fc5572cc146e85a7a154fa38e7c85db8c19634f3679841  py3-regress-2024.11.1.tar.gz
bb4ea6bdd25a7a8facf33e8db49ce1650a2e6af503b68242bfac2811e97d502cd6fcb01fa59b2b720c71d155ef48d39073e986aa748f502d15d679505d0caf01  update-rust-libc.patch
"
