# Automatically generated by apkbuild-cpan, template 4
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-ffi-platypus
pkgver=2.10
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=FFI-Platypus
pkgdesc="Write Perl bindings to non-Perl libraries with FFI. No XS required"
url="https://metacpan.org/release/FFI-Platypus/"
arch="all"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-capture-tiny perl-ffi-checklib"
makedepends="libffi-dev perl-dev"
checkdepends="perl-devel-hide"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/FFI-Platypus-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

# 32-bit archs require this additional
# package to work with 64-bit values
case "$CARCH" in
armv7|armhf|x86)
	depends="$depends perl-math-int64"
	;;
esac

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

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

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
a5096539553d193d9161f46a226b2026f16b2b3d1a61e424bd30b98981ba3145dcf4445332eea4340971bc73058a6a15b415258b6162b738c88e8fa00d0a256a  FFI-Platypus-2.10.tar.gz
"
