Perl6 installation is not easy
The purpose in writing this is not only to get practical help but to leave some sort of record for others who are curious to try out the fallen Practical Extraction and Reporting Language ("Perl") on Manjaro. I have searched several of the forums on the site and it was my conclusion that this is a new topic, but if I am mistaken I humbly apologize.
My first resort was simply to try
sudo pacman -S perl6, but obviously it doesn't work (yet). I then attempted to follow the instructions on Perl's website to compile and build the stuff from source, but no dice. Is it obvious I'm new at this?
What I finally did today was attempt to do it from the AUR, which hosts a repo named
rakudo-star. This was actually my first experience cloning from an AUR repo, or using the
git command with any repo not on github for that matter. So far so good.
I made a mistake by attempting to download the source code into
/usr/src, a folder I made to store tools I compiled from source myself, because I didn't want them sitting in my home folder. Before I get yelled at I would just like to point out that this does not violate any of the FHS precepts that I saw. But it was a mistake to do this because the
makepkg command may not run as root, and obviously any changes to anything in
/usr need to be done with root privileges. I attempted to simply move the whole folder into home, but having cloned the files into root I as a user did not have the right to write to the individual files and subdirectories created therein.
I started fresh and re-cloned
~/perl6. What follows is a result of either shortcomings of the dependency resolution mechanism used by AUR, undocumented dependencies in the repos, or shortcomings of my own threadbare understanding of what I'm doing.
Attempting to run
makepkg on the correctly cloned branch of the repo produced errors because I did not have
moarvm installed. After another reflexive attempt to have
pacman deal with it, which did not work, I found that there was an AUR repo with precisely this name available, so within the same main folder I cloned
moarvm and attempted to compile it.
Again another error, this time another dependency for
nqp-git, which was yet another AUR repo which I had to clone. So basically I am three dependencies deep: I want to try Perl 6, which apparently means I have to compile
rakudo-star, and that in turn will not function without
moarvmin turn needs nqp-git.
However installing nqp-git had some additional difficulties. It looks like the nqp-git PKGBUILD file runs Perl to build the tool, but it attempts to write to
/usr, which it does not have the permission to do. And I cannot naively
sudo the command, so I had to actually insert "sudo" into the PKGBUILD file, but just in case I changed the prefix value to the same directory I was planning to build the perl6 binary, just to keep things tidy. The output of the command also said that it needed the additional flag '--gen-moar' which was missing from this command, so I inserted that too. After this, the tool was successfully built.
moarvm, which built itself more or less straightforwardly, as I recall.
rakudo-star. This involved additional editso the PKGBUILD file in an attempt to resolve another error. Despite the fact I just compiled and built
nqp from a fresh clone of the repo, the output was telling me that my current install didn't meet the version requirements. A line reading
pkgver=2019.03 was not being satisfied by my fresh install of nqp version 2019.03-71. I removed the operator and the variable reference.
I also edited a Perl invocation, very similar to that described above, where I adjusted the directory specified by the
--prefix flag to that directory I made in my home.
Having done all that, calling
makepkg -si produces a lot of output that gets my hope up that it is kind of working, but it still encounters errors. Unfortunately I am totally stumped now because it provides no feedback about the error at all: apparently line 44 in some Makefile.
This is so unnecessary. Why aren't these dependencies just downloaded with the original repo or resolved automatically? And why do I have to go into these installation scripts and tinker with the details to try to make it work? Am I crazy for even going to this trouble, or did I make a bad decision at some early stage and now I am trying to put the cart before the horse?
If anybody has installed Perl6 on Manjaro, I could use some pointers!