# Automatically generated by apkbuild-cpan, template 3
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=perl-sereal-encoder
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=Sereal-Encoder
pkgver=5.004
pkgrel=2
pkgdesc="Fast, compact, powerful binary serialization"
url="https://metacpan.org/release/Sereal-Encoder/"
arch="all !armhf !armv7" # bus error on check
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev zstd-dev"
checkdepends="perl-test-warn perl-test-longstring perl-sereal-decoder perl-test-deep perl-test-differences"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/Y/YV/YVES/Sereal-Encoder-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
#[ "$CARCH" = "armhf" ] && options="!check" # zstd tests fail https://gitlab.alpinelinux.org/alpine/aports/-/issues/11644

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}')
	make test
}

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

sha512sums="
6ad25a4a3cdc3e7de7b7f47b7511154b5e6eca90a54b305a8d50f59dd1352000f054255912c4eeb6d37991813844068b1a0e2f544be27ac9bcea08fb6c0fc6d5  Sereal-Encoder-5.004.tar.gz
"
