#! /bin/bash # Customising for your environment: # # set "directory" to the head directory for your rakudo(s)' # set "execute" to the directory for perl6 on your $PATH # the symbolic link there will be pointed to rakudo's version # the options on the Configure line may need to be changed # setup rakudo* after download # Download, untar, make, install and link test programs # invoke with get_rakudo yyyy mm # # Usage instructions - first line is constant, 2nd is specific usage_message="Usage: $0 yyyy mm v yyyy is year, mm is month, optional v is version #" min_args=2 # minimum number of arguments max_args=3 # maximum number # standard routines function die ## Usage: # die #(Optional exit code; fill in for other than 1) { echo >&2 "$0: $1" exit ${2:-1} # default error code is 1 } # test for -h - die $usage_message 0 (--help not yet implemented) while getopts "h" opt; do die "$usage_message" 0 done test $min_args -le $# -a $max_args -ge $# || die "Wrong number ($#) of arguments $usage_message" test 2015 -le $1 || die "Year $1 not valid; must be >= 2015" test 01 -le $2 -a 12 -ge $2 || die "Month $2 not valid; must be 01 to 12" # At this point, we've validated request directory=~/rakudo # set to wherever you want rakudo wanted=rakudo-star-$1.$2${3+.}$3 # versioned filename execute=~/bin # where executable is to be invoked set -e cd $directory test -e $wanted.tar.gz && # If we've already downloaded it die "$wanted already downloaded" # Don't bother redoing curl -O rakudo.org/downloads/star/$wanted.tar.gz # get the tarball tar -xvf $wanted.tar.gz # unpack it cd $wanted # change into directory # Note the options on the following line may need to be changed perl Configure.pl --gen-moar --gen-nqp --backend=moar make make install ln -sf $directory/$wanted/perl6 $execute/perl6 # Point at latest version perl6 -v # check run to see what we have cd - # return whence you came # End get_rakudo Last changed: 2016-02-23 17:43:17