Building Software from the AUR on Arch Linux ARM, Part 1: Qt /Plasma Mobile apps
Table of Contents
Building software on the PinePhone? Sounds crazy? It sure may, but unless you have to deal with apps written in Rust, compilation does not take that long — the PinePhone has a quad-core CPU after all. To me, Arch Linux ARM (project/PinePhone images) is the obvious choice to build some programs that are listed on the MGLapps list (or similar lists that just are not available otherwise. In part, that is because the Arch Linux community embraces building apps from source with the Arch User Repository (AUR), and also because of Arch's packaging approach, that does not require you to install a ton of extra -dev
packages to build software unlike Debian, Ubuntu or Fedora do.
Preparations
On the current build of Arch Linux ARM by danct12 upgrading can be the opposite of fun unless you reign in those locales in /etc/locale.gen
, either by deleting or commenting out every line you don't need.
Then, at least if you are on a 2 GB PinePhone, consider adding a swap. You can do that by adding a swap partition, using zram or both. I like adding the swap partition with Gnome Disks, this time I chose a size of 3 GB on my microSDXC card. After that, just add it to /etc/fstab
. If you don't know how to do that, do read the articles on Swap and fstab on the Arch Wiki. Also, there is zramswap
, which can be installed via sudo pacman -S zramswap
. After that, I adjusted my /etc/zramswap.conf
to look like this:
ZRAM_SIZE_PERCENT=50
ZRAM_COMPRESSION_ALGO=lz4
To install/build software from the AUR, we need an AUR-helper. I like yay
.
Before installing yay
let's first upgrade the system and install necessary packages: sudo pacman -S fakeroot git make gcc go binutils
.
Please be careful and do try to read the pkgbuild
before building software, as you might otherwise end up with malware on your system. This may seem hard at first, but eventually you'll get the hang of it and gain the benefit of adjusting or making your own pkgbuild's.
Create a folder for building software and change to that folder (I usually build stuff in ~/build
, which you would create and change to by running mkdir -p ~/build && cd ~/build
). Now get yay-bin
by running git clone https://aur.archlinux.org/yay-bin.git
and build and install it by running cd yay
to change to the directory and then running makepkg -si
. (This also works with every other package, so if you are feeling uneasy about using yay
or need to adjust a little more to build a package, you can clone the pkgbuild of any AUR package by running git clone https://aur.archlinux.org/_package_.git
).
Installing software from the AUR
Let's start with some Plasma Mobile apps. Let's install a couple of common build dependencies first:
sudo pacman -S qt5-svg knotifications kdbusaddons kservice kcmutils purpose cmake breeze breeze-icons plasma-framework
.
To make Qt applications use the breeze
theme which matters if you don't want to end up with invisible buttons because of missing icons), you need to set it. One way to do so is to add the line QT_STYLE_OVERRIDE=breeze
to /etc/environments/
. Also, for certain Plasma Mobile apps, like KClock (a clock app) adding QT_QUICK_CONTROLS_MOBILE=true
and QT_QUICK_CONTROLS_STYLE=Plasma
is recommended.
cmake
adds an item in your launcher you will likely never need. Just add a new line NoDisplay=true
to /usr/share/applications/cmake-gui.desktop
Calindori
As of writing this article, the Calindori pkgbuild lacks dependencies (I guess they assume to have all of Plasma Desktop installed), but we've taken care of them above, so the following is enough: yay -S calindori-git
.
Angelfish (browser)
QtWebEngine may be based on Chromium, but it makes for good browser, and Angelfish, while marked experimental, is a good enough browser. A simple yay -S plasma-angelfish
should get it up and running.
If you want to set it your default browser, just run xdg-settings set default-web-browser org.kde.mobile.angelfish.desktop
.1
KWeather
Gnome Weather is fine after a scale-to-fit
, but KWeather is just a bit better. It just is a yay -S kweather-git
away.
Index (file manager)
Imho, this is the best file manager for the PinePhone:
yay -S index-fm-git
Because mauikit-git
also needs to be built from source this build takes a while.
Alligator (rss client)
If you need a simple RSS client, Alligator may be for you:
yay -S alligator-git
Fresh from the git
Kongress
Let's say you want to see the schedule of Akademy 2020, which of this writing is already going on. There is an app named Kongress for that, but it is not in the AUR, nor in the repos:
You can install it manually:
git clone https://invent.kde.org/utilities/kongress.git
cd kongress
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j$(nproc)
sudo make install
Plasma Samegame
This is a simple Samegame, and installing works just like this:
git clone https://invent.kde.org/plasma-mobile/plasma-samegame.git
cd plasma-samegame
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j$(nproc)
sudo make install
Plasma Settings
In order to use Calindori with online accounts, this settings application appears to be necessary. It requires some more dependencies to build, I installed kdelibs4support
, kdoctools
, kinit
, kdesignerplugin
. After that, is was a similar procedure, only starting with a git clone https://invent.kde.org/plasma-mobile/plasma-settings.git
.
Unfortunately, even with this app, I still can't add an online account to Calindori (and I could not find reliable information on whether online accounts are implemented in Calindori yet), so you should only try this if you want to have a third app called Settings next to the Android settings app (which comes with Anbox) and the Gnome Settings app.
Caveats and Conclusion
As you can hopefully see on the screenshots, the apps are using icons from at least two icon sets currently: Adwaita and Breeze. I guess that there is an environment variable that could be set to mitigate this. Also, Index
looks a bit broken and seems to suffer from a "white text on white" issue. In a previous post on using Qt apps on Phosh I had taken a different approach to theming with qt5ct
which makes some of these issues probably easier to fix. Aside from that, while they don't totally fit in, these Plasma Mobile programs just work very well on Phosh. Being build with a "mobile first" approach, they are quickly compiled from source (this is not true for every GTK app, specifically for those built with Rust). Have fun trying them!
The section on how to make Angelfish your default browser was added on October 10th, 2020.