Search code examples
craspberry-pigtkgnomegnome-builder

How to export GTK app for Raspberry pi os with Gnome Builder (my opereting system is ubuntu)


I want to make app for raspberry pi. I chosed gtk for gui library because it has a good looking ui and it is free. But i have 1 problem with it: i don't know how to export simple app that will work on raspberry pi. I have raspberry pi zero.


Solution

  • GNOME Builder supports automagic cross compiling when using flatpak (it is also really simple with cli flatpak-builder). It also supports adding extra sysroots for non-flatpak cross compilation.

    But if you are using flatpak, you should install and setup deviced on the raspberry pi https://gitlab.gnome.org/chergert/deviced. And have qemu-user-static (usually named like that on distros) installed on the computer you are compiling on. Then you can simply select the device enter image description here, accept it on the raspberry pi, it will automatically download the SDK. Then click the run button and it will run on the raspberry pi.

    Note that compilation will be quite slow as flatpak emulates a native arm compiler instead of using a compiler that compiles to arm, but the compiler itself is x86.