# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=niaaml-gui
_pkgorig=NiaAML-GUI
pkgver=0.3.2
pkgrel=0
pkgdesc="GUI for NiaAML Python package"
url="https://github.com/firefly-cpp/NiaAML-GUI"
arch="noarch"
license="MIT"
depends="python3 py3-niapy py3-niaaml py3-qtawesome py3-qt6"
checkdepends="py3-pytest-xdist"
makedepends="py3-poetry-core py3-gpep517"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://github.com/firefly-cpp/NiaAML-GUI/archive/$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/NiaAML-GUI-$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 -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/niaaml_gui-$pkgver-py3-none-any.whl

	install -Dm644 AppData/io.github.firefly-cpp.niaaml_gui.desktop "$pkgdir"/usr/share/applications/niaaml_gui.desktop
	install -Dm644 AppData/niaaml-gui.png "$pkgdir"/usr/share/icons/hicolor/256x256/apps/niaaml-gui.png

	install -Dm644 CITATION.cff -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
970330c1a2855f34839793e01ba53d5f98f2010cf81e04068b2e7f71d139530e16fe0ab2e043535f87e64f2d1f9192849da34b241384761178f3a71b99a200cf  NiaAML-GUI-0.3.2.tar.gz
"
