# Contributor: Curt Tilmes <Curt.Tilmes@nasa.gov>
# Maintainer: Curt Tilmes <Curt.Tilmes@nasa.gov>
pkgname=nqp
pkgver=2024.07
pkgrel=0
pkgdesc="Not Quite Perl"
url="https://github.com/Raku/nqp"
arch="all"
options="!archcheck" # Arch dependencies are embedded
license="Artistic-2.0"
depends="moarvm~$pkgver"
makedepends="perl-utils moarvm-dev~$pkgver"
checkdepends="perl-test-harness"
subpackages="$pkgname-doc"
source="https://github.com/Raku/nqp/releases/download/$pkgver/nqp-$pkgver.tar.gz"

build() {
	perl Configure.pl --prefix=/usr --backends=moar
	make -j"$JOBS"
}

check() {
	export TEST_JOBS=$JOBS
	export HARNESS_VERBOSE=1

	msg "Running $TEST_JOBS parallel test jobs"
	make test
}

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

	install -Dvm644 CREDITS LICENSE README.pod VERSION \
		-t "$pkgdir"/usr/share/doc/"$pkgname"
	cp -vr docs examples "$pkgdir"/usr/share/doc/"$pkgname"/
}

sha512sums="
b6989c5297c97d20b82459949ef05965a0312885334f157965b655fdb9459cca3060090af57a1c60c47e95f7090aebe8ff43305825374a6f4decab5a96d2e73a  nqp-2024.07.tar.gz
"
