# Template file for 'gwenhywfar'
pkgname=gwenhywfar
version=5.14.1
revision=1
build_style=gnu-configure
build_helper=qmake6
configure_args="--disable-binreloc --disable-network-checks"
hostmakedepends="automake pkg-config libgcrypt-devel libtool which
 gettext-devel qt6-tools qt6-base"
makedepends="libgcrypt-devel gnutls-devel qt6-base-devel gtk+3-devel"
short_desc="OS abstraction functions for various projects"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://github.com/aqbanking/gwenhywfar"
distfiles="https://github.com/aqbanking/gwenhywfar/archive/refs/tags/${version}.tar.gz"
checksum=d52937b56e0760d11dc200ad5fb2cfd9d8bf147d0b1b97451f23f31c6ee641a2
replaces="gwenhywfar-qt5>=0"

do_configure() {
	# export QT_SELECT=6
	autoreconf -fi
	if [ "$CROSS_BUILD" ]; then
		configure_args+=" GPGRT_CONFIG=$XBPS_CROSS_BASE/usr/bin/gpgrt-config"
	fi
	./configure ${configure_args} --with-guis="qt6 gtk3"
}

gwenhywfar-gtk3_package() {
	short_desc+=" - gtk+3 bindings"
	pkg_install() {
		vmove usr/lib/*-gtk3*
	}
}

gwenhywfar-qt6_package() {
	short_desc+=" - Qt6 bindings"
	pkg_install() {
		vmove usr/lib/*-qt6*
	}
}

gwenhywfar-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/bin/gwenhywfar-config
		vmove usr/share/aclocal
		vmove usr/lib/cmake
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
