Hello, I use Gambas for many years for the creation of application. I also participate from time to time in the development of the project gambas. I would like to find help to allow users of this RAD to generate snap packets.
I’m looking for several hours but I can not find really clear about the creation of plugin like python (both languages use an interpreter).
This would be great! Essentially a snap is just a squashfs file containing the application, supporting libraries and a little metadata. if you can identify what the necessary libraries are then you could generate a snapcraft.yaml template, and create the snap by running snapcraft. I’d love to help with this. I’ve not used gambas in anger before. If you have some sample code for an application which I could build in gambas, I could point you in a good direction.
An example of a program in Gambas?
I would say that the most representative at first is the IDE of Gambas. The code is in the source. One of the difficulties of gambas during these last ten years was precisely the evolution of dependencies … very active. Even if we avoided at best to break the codes. Snap would allow a gambas program to survive beyond the evolution of the linux ecosystem or gambas.
With regard to dependencies:
A gambas program uses libraries written in C or C ++ linked to third-party libraries (eg QT, GTK, SDL, MYSQL, sqlite etc … dbus) or written in gambas and sometimes using external resources (ex: gb. scan use scanimage). We already generate the necesary for the generation of standard packages (rpm, deb, tarball, etc … via the IDE) So I think this will not be difficult to get it working.
To try Gambas you need to use this ppa or git compilation because Ubuntu repository is far to be up to date for gambas. I’ve added the whole libs to install for compilation for 19.04 and 19.10 in the ubuntu part
So as a first step I took a look at making a snap of Gambas3 itself. Here’s the yaml. Unfortunately it segfaults on launch. Looking at the strace it seems to be looking for binaries which are outside the snap.
It seems that there is a hard link in one of the files in relation to the components, I just contacted the developer to understand the reason … and as soon as I have the answer, I come back to you.
If I understand a little about how snap works, the links must be relative, right?
yes … it will be usefull to me to see the full structure generated by the expanded snap. I need to know if the components are generated. If yes, then I will see for the locate. Normally gbr3 look in :
Here’s the contents of the snap https://paste.ubuntu.com/p/bXddF2B5rF/
Where squashfs-root would be mounted under /snap/gambas3/current (known as $SNAP at runtime).
Well so the gambas libs are right compiled and is the right place. I need to understand why the interpreter can’t find them. Maybe another environment variable or a problem in relative path solving
I just updated my snapcraft.yaml. It runs the archived file but then fails with:
gbx3: warning: cannot switch to language ‘pt_PT.UTF-8’: No such file or directory. Did you install the corresponding locale packages?
gbr3: unable to load component: gb.image
I haven’t tried yet to add gambas3-gb-qt5.
the file is compiled and archived and then the executable is placed in /usr/bin
On my case gb.image.so and gb.image.so.0 are placed in /snap/fight-climate-change/current/usr/lib/gambas3 when the snap is installed. Should there also be a gb.image.gambas?