Install Perl 6 modules in non standard location

621 Views Asked by At

Installing Perl 6 using the Rakudo Star 2016.01 production is quite straighforward. I did the manual installation as suggested here:

perl Configure.pl --backend=moar --gen-moar --prefix=/opt/rakudo/rakudo-star-2016.01
make
make install

Perl6 is now installed on /opt/rakudo/rakudo-star-2016.01/bin

Panda, a Perl 6 module manager that comes along with Rakudo, is installed in /opt/rakudo/rakudo-star-2016.01/share/perl6/site/bin

I can then add both paths to the $PATH variable to have a running installation of Perl6 right away.

My only problem is that the default installation for Perl 6 modules is still in the $HOME directory: ~/.perl6

However, I would like to have Perl 6 modules installed in /opt as well, actually in /opt/perl/perl6

I tried to set PERL6LIB variable, before running the installation steps above, with export PERL6LIB=/opt/perl/perl6 but without any success, because modules are still installed ~/.perl6

How can I tell Perl6 or Panda to install modules in a non-standard location, outside my $HOME directory?

1

There are 1 best solutions below

0
On BEST ANSWER

Setting PERL6LIB should suffice to specify the path where new Perl 6 modules will be installed. This variable can be set prior to Perl 6 installation.

export PERL6LIB="/opt/perl/perl6/lib" # or better is to put this line in .profile or .bash_profile
perl Configure.pl --backend=moar --gen-moar --prefix=/opt/rakudo-star/rakudo-star-2016.01
make && make install

This will install perl6 in /opt/rakudo-star/rakudo-star-2016.01/bin and panda in /opt/rakudo-star/rakudo-star-2016.01/share/perl6/site/bin

New modules can be installed with panda, e.g.

panda install Task::Star

and they should be found in /opt/perl/perl6/lib/.precomp (it's a hidden folder...)

During this installation ~/.perl6 is still created but should be empty.