Building the Applications¶
The apps
directory contains a collection of subdirectories. Each of these
contains the application for the corresponding part of the tutorial. You can
either use GNOME Builder to build it, or use Meson and Ninja at the command
line.
Using GNOME Builder¶
Each application is configured automatically when imported into Builder. To build it, click the “OmniBar” in the center at the top of the window, then click Build or Rebuild as necessary.
See the GNOME Builder documentation for more information about build options.
Using Meson and Ninja¶
When building the application for deployment on the phone, we will use Flatpak to coordinate the build process. However, behind the scenes, we are using Meson and Ninja to perform the actual configuration and build. If you want to try and build the application for testing on your workstation, you can follow the steps below to build, install, and finally uninstall it.
Each of these application subdirectories contains a meson.build
file that
describes how the application is built. These are used by the Meson build
tool to configure the build process.
Meson is usually run so that it creates a build directory. This is where all the resources are put so that the Ninja build tool can perform the actual process of building and installing the application.
To configure the build on the command line, enter the directory containing the application you want to build, then run Meson, specifying the source and build directories:
meson . _build
Build the application using Ninja, passing the build directory as an argument so that the build occurs within that directory. There is no need to specify a build rule because the default rule builds the application:
ninja -C _build
Finally, use sudo
to install the application in a standard location on your
system using the install
build rule:
sudo ninja -C _build install
To uninstall the application, run its uninstall
rule:
sudo ninja -C _build uninstall
All of the files that were installed should now have been cleanly removed from system locations.