Commit 87e83917 authored by Heather Ellsworth's avatar Heather Ellsworth

Starting to add section on Builder building C flatpak and install it on board

parent c3e0fb9b
......@@ -6,15 +6,70 @@
C
##
*************
C App Example
*************
TODO
**********************************************************
Building a C/GTK3 (gnome-music) flatpak with GNOME Builder
**********************************************************
.. It is assumed that you have already gone through the `Using flatpak <https://developer.puri.sm/Tools/Flatpak.html>`_ section.
It is assumed that you have already gone through the `Using flatpak <http://192.168.1.140/Tools/Flatpak.html>`_ section.
For this example, we'll be building `gnome-music <https://wiki.gnome.org/Apps/Music>`_ which is written in C and available in Debian apt repositories.
When you open Builder, select to "Clone" a new project. For gnome-music, the Repository URL is:
https://gitlab.gnome.org/GNOME/gnome-music.git
To build gnome-muisic, we'll need to satisfy some dependencies::
$ sudo apt-get build-dep gnome-music
Note that if your dependencies are not resolved, you can watch the Builder "Build Log" in the bottom panel (brick wall icon) where the unsatisfied dependencies will be complained about until they were installed.
.. image:: images/builder-export-bundle.png
:width: 500px
:height: 300px
:align: left
To build a flatpak, we can click the omnibar and select the "Export Bundle" button and patiently wait while the flatpak is built.
.. image:: images/builder-view-build-console-contents.png
:width: 500px
:height: 300px
:align: left
|
|
|
|
|
|
|
|
You can watch the build progress by selecting the button to the right of Build status.
|
|
|
|
|
|
|
|
When the flatpak creation is finished, a nautilus window will pop up in the directory where the org.gnome.Music.flatpak is located.
In this example, the flatpak can be found here: ~/.var/app/org.gnome.Builder/cache/gnome-builder/flatpak/staging/gnome-music/flatpak:org.gnome.Platform-x86_64-master/org.gnome.Music.flatpak
********************************************
Installing and running your flatpak in GNOME
********************************************
TODO
So you have your dev board or qemu-x86_64 vm running (system under test, a.k.a the `sut`) and you have a new org.gnome.Music.flatpak. How do we install and run this flatpak on the dev environment? Well I'm glad you asked.
Whatever platform you are using (board or vm), the system should have a working networking setup and ip address that you can use to ssh/scp. The OS has ssh running and enabled by default (port 22). The system should also have flatpack installed.
Scp the flatpak to the system, install it and run it::
user@workstation:~$ scp ~/.var/app/org.gnome.Builder/cache/gnome-builder/flatpak/staging/gnome-music/flatpak:org.gnome.Platform-x86_64-master/org.gnome.Music.flatpak purism@<sut_ip>:~/
purism@pureos:~$ sudo flatpak install org.gnome.Music.flatpak
*********************************************
Installing and running your flatpak in Plasma
......
......@@ -8,6 +8,7 @@ Tools
.. toctree::
Tools/Flatpak
Tools/Gbuilder
Tools/Kirigami
.. librem5 documentation master file, created by
sphinx-quickstart on Mon Jan 29 14:23:33 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Using flatpak
=============
The `official flatpak documentation <http://docs.flatpak.org/en/latest/>`_ should be used as reference but we will provide some basic steps for installing flatpak on the dev system::
purism@pureos:~$ sudo apt-get install flatpak
purism@pureos:~$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
purism@pureos:~$ sudo flatpak install flathub org.gnome.Platform//3.26
......@@ -3,7 +3,22 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Building a flatpak with GNOME Builder
=====================================
TODO
Setting up GNOME Builder for flatpak builds
===========================================
Builder is a fantastic IDE traditionally used for building GNOME GTK+ apps however the fun doesn't have to stop there. It can build kde apps as long as there is flatpak metadata for the application - more on that later.
First, checkout the `official documentation for GNOME Builder <https://builder.readthedocs.io/en/latest/>`_ and go through the steps to install GNOME Builder on your workstation.
For this example, a nightly builder that was built from commit f34ee25c71ae will be used.
It is assumed that you have both `flatpak` and `flatpak-builder` installed. Following the `Builder install instructions <https://builder.readthedocs.io/en/latest/installation.html>`_, you can install a nightly or stable version.
**If you have say a nightly build installed already, you can update it with**::
$ flatpak update org.gnome.Builder//master
**If you'd like to install a specific commit of GNOME Builder**::
$ flatpak update --commit=f34ee25c71ae org.gnome.Builder//master
......@@ -10,8 +10,8 @@ Librem5 Docs
:maxdepth: 5
Design
PlasmaMobile
Tools
Troubleshooting
Apps
PlasmaMobile
Troubleshooting
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment