# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=py3-sibc
_pkgname=sibc
pkgver=1.0.4
pkgrel=2
pkgdesc="Supersingular Isogeny-Based Cryptography constructions (python-code library)"
url="https://github.com/JJChiDguez/sibc"
arch="all"
license="GPL-3.0-or-later"
depends="python3 py3-click py3-progress py3-numpy py3-setuptools"
makedepends="py3-gpep517 py3-numpy-dev py3-wheel"
checkdepends="py3-pytest py3-pytest-runner"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/JJChiDguez/sibc/archive/refs/tags/v$pkgver.tar.gz
	bench_soft_requirements.patch
"
builddir="$srcdir/$_pkgname-$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/*.whl
	.testenv/bin/python3 -m pytest -k csidh_gae_p512_hvelu_df__unscaled
}

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

sha512sums="
11fb75240b0ceedce208380aef9572ed29fad8b6ea73ef982d0051792a8316cfb95ae0c81f30186f53941d129d2095988bef0f9160b643a1936ccf1175107a19  sibc-1.0.4.tar.gz
85b5bd2de5b3ba2d2c9d20bbfec343e778e70452c8a89d4a3b81ad19224669bb76bf072d78b2d18b3fbf9000d69f1eca2cd50f458dd2efe1d8fb34410afa6f60  bench_soft_requirements.patch
"
