# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
pkgname=py3-netifaces2
pkgver=0.0.22
pkgrel=0
pkgdesc="network interface information 2: oxidized"
url="https://github.com/SamuelYvon/netifaces-2"
arch="all"
license="MIT"
makedepends="
	cargo
	py3-gpep517
	py3-maturin
	py3-wheel
	"
checkdepends="py3-pytest"
options="net"
subpackages="$pkgname-pyc"
source="
	https://github.com/SamuelYvon/netifaces-2/archive/V$pkgver/py3-netifaces2-V$pkgver.tar.gz
	cargo-update.patch
	"
builddir="$srcdir/netifaces-2-$pkgver"
provides="py3-netifaces"
replaces="py3-netifaces"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--config-json '{"build-args": "--frozen"}' \
		--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="
eb188ef1ac16a59ca05b8c94aee380a6e55d2dc78271967a29db5b3528b55057ce4d19ed2ac64dba9a731a64ddaebb627654773012105bcf7a9e5440936aefea  py3-netifaces2-V0.0.22.tar.gz
f81d1d8d41354763bfd0264d2387ab98e9bd2203dc4603c457f2a06d63ea9bc67d9adffcea47cbad272f157fe633fe699f4529f369e9b44532c967ef9708ec0f  cargo-update.patch
"
