Compiling Go Fyne on raspberry pi

94 Views Asked by At

I want to have the fyne GUI running on a raspberry PI I followed Fyne documentation https://developer.fyne.io/started/cross-compiling and aimed at linux arm but I could not get an EXE that would run. So I installed VS code on raspberry PI and compiled the executable there. This is not a bad idea as you need access to the GPIO whilst your developing. But when it came time to compile and executable many problems of libraries and dependencies erupted.

$ uname -m : returns aarch64 == go install compiles ok for both console and web apps. go1.21.4 When you try to build with fyne dependencies problems start.

  1. OpenGL development files are needed = solve with $ sudo apt-get install libgles2-mesa-dev

  2. compilation process is missing the X11/Xcursor/Xcursor.h header file, which is necessary for GLFW to work on X11-based systems like the Raspberry Pi. = solve with $ sudo apt-get install libglfw3-dev libgles2-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libx11-xcb-dev libxkbcommon-dev libwayland-dev libwayland-egl-backend-dev

  3. linker (ld) cannot find the library -lXxf86vm during the compilation of your Go code. This library is related to the XFree86 VidMode Extension, which is commonly used for managing screen modes in X11 environments. = solve with. sudo apt-get install libxxf86vm-dev

Finally I was able to produce a Fyne GUI and transpose it to a fresh Raspbian where the exe ran ok. Although I am successful(and can develop) I don't feel confident making apps for distribution. It feels like I am braking new ground when I want a stable CI/CD.

I went through these issues myself with very little help that I could find. I post here as my experience may help somebody, in the event that nobody can help me find a better way.

One needs to develop on the raspberry up an until a raspberry simulator is available. So it makes sense that fyne should have a working solution for raspberry with out users going through dependency hell. Please could anyone help me find a smoother more dependable path.

I tried many combinations of dependency references where I was expecting all dependencies as needed by the fine package to come with the fyne package or be noted in documentation. I want to support fyne and go , but to do that I need to get up and running myself first. There are may uses for fyne in IOT devices and mobile edge case computing. I wish better documentation and home my feedback can help in that.

0

There are 0 best solutions below