# Template build file for 'rakudo-star'.
pkgname=rakudo-star
only_for_archs="i686 x86_64"
version=2016.02
revision=1
hostmakedepends="panda"
makedepends="${hostmakedepends}"
depends="panda>=2015.12"
short_desc="Rakudo is an implementation of Perl 6 language"
maintainer="Ruslan <axetwe@gmail.com>"
homepage=http://rakudo.org
license=Artistic-2.0
nopie=yes

pre_build() {
	cd /usr/share/perl6/site
	find -type f > list.txt
}

do_build() {
	export PATH="$PATH:/usr/share/perl6/site/bin"
	panda --notests --force install Task::Star
	cp /usr/share/perl6/site/panda/state /usr/share/perl6/site/panda/state.bak
}

do_install() {
	cd /usr/share/perl6/site
	xargs rm < list.txt
	find . -type d -empty -delete
	mv panda/state.bak panda/state
	vmkdir usr/share/perl6
	cp -r /usr/share/perl6/site ${DESTDIR}/usr/share/perl6/
}
