# Automatically generated by apkbuild-cpan, template 4
# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=spvm
pkgver=0.990009
pkgrel=0
#_pkgreal is used by apkbuild-cpan to find modules at MetaCpan
_pkgreal=SPVM
pkgdesc="SPVM Language"
url="https://metacpan.org/release/SPVM/"
# s390x: murmur_hash test from t/02_vm/08_module/Hash.t fails
arch="all !s390x"
license="MIT"
depends="gcc musl-dev perl"
makedepends="perl-dev"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/K/KI/KIMOTO/SPVM-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

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

	install -Dvm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
389047a0bfe4e9ef8a71321d40358788793f6e4f10cef6fb945298437bee2174f36be49c6eb82610188bb6a411e9f59e3f4c7a6590597ff91050d0ab3e0115a9  SPVM-0.990009.tar.gz
"
