# Automatically generated by apkbuild-cpan, template 3
# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=perl-tkx
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Tkx
pkgver=1.10
pkgrel=0
pkgdesc="Yet another Tk interface"
url="https://metacpan.org/release/Tkx/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-tcl tk"
checkdepends="xvfb-run"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/C/CA/CAC/Tkx-$pkgver.tar.gz
	remove-scripts.patch
	"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	xvfb-run -a make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

doc() {
	local file; find "$pkgdir" -name "*.pod" | while read -r file; do
		amove "${file#"$pkgdir"}"
	done
	default_doc
}

sha512sums="
95264a6cf0894f69dbc26c48e7e8772383c64aa9c2f5fc037a7f57a608ae1309f5a9f7570abfa5f0570a43b2a977594ee9caaacfeef48f9370fc4d99087f7dac  Tkx-1.10.tar.gz
6be038922f0eb0f976df1ca3b11019bf95f79b90f8edd4afeb5280c29402798fb6b947771534b1af32da0c6a388c8baf59c9544d254cafd02b9d26127053f3c8  remove-scripts.patch
"
