# Template file for 'python3-siphash24'
pkgname=python3-siphash24
version=1.8
revision=2
_c_siphash_ver="1.1.0"
_c_stdaux_ver="1.5.0"
build_style=python3-pep517
build_helper="meson"
hostmakedepends="python3-Cython python3-meson-python pkg-config"
makedepends="python3-devel"
depends="python3"
short_desc="Streaming-capable SipHash implementation"
maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="Apache-2.0 OR LGPL-2.0-or-later"
homepage="https://github.com/dnicolodi/python-siphash24"
changelog="https://raw.githubusercontent.com/dnicolodi/python-siphash24/refs/heads/master/CHANGELOG.rst"
distfiles="
 ${PYPI_SITE}/s/siphash24/siphash24-${version}.tar.gz
 https://github.com/c-util/c-siphash/archive/v${_c_siphash_ver}.tar.gz>c-siphash-v${_c_siphash_ver}.tar.gz
 https://github.com/c-util/c-stdaux/archive/v${_c_stdaux_ver}.tar.gz>c-stdaux-v${_c_stdaux_ver}.tar.gz
"
checksum="aa932f0af4a7335caef772fdaf73a433a32580405c41eb17ff24077944b0aa97
 a70c71effbcd553858250d109dd39599b9e3d5a91d46f0beb731bf6799893e63
 19fb163160c25babf1f2ecf817e6eb696decfb5e33490dcd9cf68c2ecae97d13"
skip_extraction="
 c-siphash-v${_c_siphash_ver}.tar.gz
 c-stdaux-v${_c_stdaux_ver}.tar.gz
"

post_extract() {
	vsrcextract -C subprojects/libcsiphash-1 c-siphash-v${_c_siphash_ver}.tar.gz
	vsrcextract -C subprojects/libcstdaux-1 c-stdaux-v${_c_stdaux_ver}.tar.gz
}

do_check() {
	local testdir="${wrksrc}/.xbps-testdir/$(date +%s)"
	python3 -m venv --system-site-packages --without-pip "${testdir}"

	local testpy="${testdir}/bin/python3"
	"${testpy}" -m installer dist/*.whl
	"${testpy}" ./test.py
}
