Learning how to edit pkgbuilds for aarch64 and the pinebook pro

Continuing the discussion from Installing pandoc on pinebook pro

Hi, how is this actually done?
5.8.3-2-MANJARO-ARM on a pbp.

When I go to install any package from the AUR via yay that isn’t included in basic community, I inevitably run into architecture related errors for anything not found in Community repositories.

Click here for example with Wordgrinder-git

$ yay wordgrinder
2 aur/wordgrinder-git 0.7.1.r13.ge81cb70-1 (+2 0.00)
A word processor which gets the hell out of your way and lets you get some work done.
1 aur/wordgrinder 0.7.2-1 (+34 0.00)
A word processor for processing words.
==> Packages to install (eg: 1 2 3, 1-3 or ^4)
==> 2
:: Checking for conflicts...
:: Checking for inner conflicts...
[Repo Make:1] ninja-1.10.1-1
[Aur:1] wordgrinder-git-0.7.1.r13.ge81cb70-1

==> Remove make dependencies after install? [y/N] y
:: Downloaded PKGBUILD (1/1): wordgrinder-git
1 wordgrinder-git (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
:: (1/1) Parsing SRCINFO: wordgrinder-git
-> The following packages are not compatible with your architecture:

Hopefully this is a simple example since other packages require a number of incompatible dependencies. I’m still learning about editing pkgbuilds [1] for aarch64 and wondering how I actually go about editing them properly in order to install with yay. Any guidance appreciated in wrapping my head around it.

[1] https://wiki.archlinux.org/index.php/PKGBUILD

I run Manjaro KDE on the Pinebook Pro.

Using the GUI (Add/Remove Software), and assuming you already have AUR enabled:

find your package in aur, I’ll takeTuxRacer as an example from AUR.

I am also about to find out if tuxracer will build properly as it will be my first time… :slight_smile: All of my other packages have had the aarch64 added such as moneydance and duplicati… :slight_smile:

Also, sorry for no screenshots, after taking and inserting them, my account on these new forums wont let me post them… (probably too new)

The PKGBUILD file in AUR currently has this for the ARCH line: arch=('i686' 'x86_64')

So, i click the “Build” button after selecting it, and then Apply

Then click “Edit build files”

and then add 'aarch64' to the ARCH line so it looks like this:

````arch=(‘i686’ ‘x86_64’ ‘aarch64’) ```

Click Save, and Apply. It will then proceed and try to build the program under the aarch64 architecture.

and for my first time trying tuxracer, it actually works and is currently running on my Pinebook Pro… :smiley:


First its worth looking at the basic ‘true’ way with makepkg:
makepkg --help
man makepkg

Then we can point out some functions of yay:

yay --help
man yay

The following will download a directory of the AUR files: yay -G
(of course there are other ways, like downloading through the browser or using git
git clone https://aur.archlinux.org/wordgrinder-git.git )

So taking that with what we know about makepkg, and assuming package is wordgrinder-git

yay -G wordgrinder-git
cd wordgrinder-git
micro PKGBUILD          # use your preferred editor of course
makepkg -sric

But wait … theres more. yay has a config file at ~/.config/yay/config.json.
You may notice a section there "editmenu": true (or in your case probably ‘false’)
While you could edit this by hand - its actually options you can pass to yay itself.
(again, refer to the man page or yay --help)

For single use:

yay -S wordgrinder-git --editmenu

But we can also save the option to the config file

yay --editmenu --save

(or remove it with --noeditmenu --save)

From then on you should be automatically prompted to edit the PKGBUILD.

Also take a look at the other options for things you may want to turn on or off.


Would it help to understand cross compiling tools such as distcc in order to better automate the process of building applications for aarch64?

Honestly, I never even thought of using the GUI tool to install AUR packages. Thanks for the suggestion: AUR Enabled! Now I feel very old school.

Nice, it works well.

Awesome, this is the main option I was missing.

Excellent, this really helps!