# Automatically generated by apkbuild-cpan, template 3
# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=perl-parser-mgc
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Parser-MGC
pkgver=0.21
pkgrel=0
pkgdesc="Build simple recursive-descent parsers in Perl"
url="https://metacpan.org/release/Parser-MGC/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-module-build"
checkdepends="perl-test-fatal"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Parser-MGC-$pkgver.tar.gz
	use-try-from-core.patch
	"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	perl Build.PL --installdirs=vendor
	./Build
}

check() {
	./Build test
}

package() {
	./Build install --destdir="$pkgdir"
	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="
d3fdfdbccd45a04cc7869401fcb6a91fe5ffd213defdc8b997309c5f5f65f2e9a40139279107b9f813de3d28ec21f7452d880440bc0487e824439db1fc10cd2e  Parser-MGC-0.21.tar.gz
61a4dedad66d188abc3c62376e8653d48aa7480cd7966fb7a72aa364ede2c354e1f08285d638a9070957cb3f6a675969679c7e22be5d773d926656156bfa0bb7  use-try-from-core.patch
"
