# Automatically generated by apkbuild-cpan, template 4
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=perl-ffi-platypus
pkgver=2.09
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="
7dbe620d4ca48ee6d8c1e2d2b8720f84fcf56ff32797e8618f5188f419a20ff579e500e7b63e794c6b662a142f730a5bf36b27f553f717e1d95ef3d6fc2b5fa7  FFI-Platypus-2.09.tar.gz
"
