This is a small shellscript to download Rakudo Perl 6, build it, install it into ~/.local and clean up the sources again. Once completed, this will result in Perl 6 being installed in your ~/.local directory.

To make good use of it, you will have to add the following two paths to your $PATH:

This script has only been tested on Funtoo, so I cannot guarantee it will work correctly on every other distro. For Debian, and derivatives like Ubuntu, you will have to install git and build-essential through apt, for instance. If anyone is willing to test it on other distros and provide me with feedback, I will update the descriptions as needed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /usr/bin/env sh

readonly WORKDIR="$HOME/.local/src/perl6"

build()
{
    perl Configure.pl --gen-moar --gen-nqp --backends=moar --prefix=$HOME/.local
    make
    make install
}

cleanup()
{
    cd || exit
    rm -rf "$WORKDIR"
}

prepare()
{
    mkdir -p "$WORKDIR"
    git clone https://github.com/rakudo/rakudo/ "$WORKDIR"
    cd "$WORKDIR" || exit

    git checkout "$1"
    git pull
}

main()
{
    prepare "${1:-master}"
    build
    perl6 --version
    cleanup
}

main "$@"