Perl6 installation saga

aur
makepkg
perl
#1

Perl6 installation is not easy

Purpose

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.

Narrative

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 rakudo-star into ~/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 moarvm, and 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.

Back to moarvm, which built itself more or less straightforwardly, as I recall.

Finally, to 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 depends=("nqp>=$pkgver") where 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!

0 Likes

#2

Maybe a stupid question, but did you actually try the most simple way to install packages from AUR, i.e. using a helper like yay?
yay -S rakudo-star

EDIT: from what I understand, you first have to install nqp with yay -S nqp as it isn't in the dependency array of rakudo-star's PKGBUILD.

2 Likes

#3

I've never heard of yay, should I do that from a fresh clone of just rakudo-star?

0 Likes

#4

Nothing to clone. Just execute the command. Yay handles cloning, dependencies, configure+make.

EDIT: I just tried it.
nqp can be installed, but rakudo-star fails with a make error due to a missing file:
Unhandled exception: While looking for '/usr/share/perl6/runtime/perl6.moarvm': no such file or directory

EDIT 2: You can try rakudo instead of rakudo-star.

0 Likes

#5

Was just an example for an AUR helper/wrapper. As your user description shows, you are on i3, so you can use the built in Package Manager and run from terminal:
pamac build nqp
and
pamac build rakudo-star

When asked to edit the build files, you can chose no or yes, depending what you want ...

0 Likes

#6

yeah that's why you have to install moarvm

0 Likes

#7

Is installed with nqp.

0 Likes

#8

Okay, rakudo works. So it's basically just two commands you need:

yay -S nqp
yay -S rakudo

You can specify custom directories for the source and built packages in /etc/makepkg.conf.
And you can of course use a different helper than yay.

0 Likes

#9

So I finally found something I can install with pacman : pacman -S yay :sweat_smile:
Using yay to install nqp-git came up with the same error regarding moarvm, even after installing moarvm first. I think that line in PKGBUILD file is simply missing that flag as far as I can tell.
Installing nqp appears to have gone without a glitch, and rakudo instead of rakudo-star appears to work as well. Wow thanks to you guys, I finally got my Perl6 prompt on my Manjaro! :grin::star_struck::nerd_face:

0 Likes

#10

Actually, this is the only command you need. nqp and moarvm are both brought in as dependencies (assuming your AUR helper can cope with it).

0 Likes

#11

yeah I'm not sure why I was going for rakudo-star instead of rakudo, and nqp-git instead of nqp. I guess they're similar packages but not quite what I needed. This seems like the perfect thing to make into a snap tbh

0 Likes

#12

Meh. I'd rather just have them in the repos.

I thought it was only me who had Perl 6 installed, but if there's more people using it I might start packaging it for Manjaro.

0 Likes

#13

Me personally, I'm trying to learn it. As for other people...

0 Likes

#14

Perl 6 ain't Perl. :wink:

1 Like