Flatpak installation

I’m about to install Gramps via Flatpak in my Chromebook’s Linux environment, to find out whether the drag-and-drop issue exists in that version, but have a few questions:

  1. I notice that Flatpak wants to install some other things. Are these typical of Flatpak installations?

$ flatpak install flathub org.gramps_project.Gramps
Looking for matches…
Required runtime for org.gramps_project.Gramps/x86_64/stable (runtime/org.gnome.Platform/x86_64/43) found in remote flathub
Do you want to install it? [Y/n]: Y

org.gramps_project.Gramps permissions:
ipc network fallback-x11 wayland x11 file access [1] bus ownership [2]

[1] home
[2] org.gramps-project.Gramps


    ID                                             Branch                 Op            Remote             Download
  1. org.freedesktop.Platform.GL.default            22.08                  i             flathub            < 143.1 MB
    
  2. org.freedesktop.Platform.GL.default            22.08-extra            i             flathub            < 143.1 MB
    
  3. org.freedesktop.Platform.openh264              2.2.0                  i             flathub            < 944.3 kB
    
  4. org.gnome.Platform.Locale                      43                     i             flathub            < 340.6 MB (partial)
    
  5. org.gramps_project.Gramps.Locale               stable                 i             flathub              < 7.2 MB (partial)
    
  6. org.gtk.Gtk3theme.CrosAdapta                   3.22                   i             flathub            < 386.3 kB
    
  7. org.gnome.Platform                             43                     i             flathub            < 329.3 MB
    
  8. org.gramps_project.Gramps                      stable                 i             flathub             < 77.5 MB
    

Proceed with these changes to the system installation? [Y/n]:

  1. This thread suggests that not all add-ons are available in the Flatpak installation. Does that mean I cannot add them later?

  2. This thread suggests that I might not be able to modify anything within the installation (for example, applying a patch of my own). Is that correct?

  3. Is there another way I can determine whether the Flatpak version will solve the previously mentioned drag-and-drop issue?

Thanks.

You can install add-ons, but dependencies for some add-ons may not be available. @S.Mackay will probably be able to give you more details.

Hi, the way flatpaks work to make one installation script work for all linux operating systems that have flatpak already installed is to use the same prerequisite runtimes for all operating systems. The script that gramps flatpak uses is at the gramps-project github page flatpak/org.gramps_project.Gramps.yml at main · gramps-project/flatpak · GitHub Flatpaks share the runtimes so they can be regularly updated, which occasionally causes problems for apps that are not regularly maintained or (in the case of many Gramps add-ons) use old prerequisites. Flathub is supposed to reject any script that attempts to rewrite parts of these runtimes like would happen in a normal OS installation.

This use of standard runtimes is also useful for making a weak sandbox available. Many apps, like gramps, have to poke holes in that “sandbox” to make the app useable for regular users. The holes I made (with explaining comments) for Gramps to work are at the finish-args section lines 9-23. They include internet access (without which some add-ons or maps won’t work), full home directory access since 5.1.x has issues with using xdg specs for previously installed media folders (I don’t know where random users decide to install their media and data files inside home), graphics access, and a command to let the flatpak use the system name that normal installations of Gramps use. For more advanced flatpak users who want to tighten their sandboxes, there is Flatseal to manage permissions.

So the explanation for the 8 current runtimes are:
1-3 are graphics related. I tried to remove X11 from the Gramps flatpak and use only Wayland runtimes to reduce the number of runtimes required to download for Gramps, but a flathub maintainer told me to add X11 back in.
4-5 appear to be regional files for whatever country and language you use on your device
6. Gtktheme is icons and stuff for whatever theme flatpak expects Gramps to use
7. is the runtime for Gnome (currently 43). Flatpak has separate runtimes for different desktop environments including Gnome and KDE, along with generic freedesktop runtimes. This is the heart of how one app installation script will work for any linux device that has flatpak installed
8. Gramps compiled with a limited number of add-ons

There are so many optional add-ons for Gramps that to attempt to include prerequisites for them all will cause the following problems:

  1. the Gramps app flatpak would be a massive pre-compiled download by itself. With the runtimes, it is already large if the runtimes are not already installed by another flatpak app
  2. different add-ons sometimes work best for different versions of the same prerequisite. This can cause conflicts in a flatpak
  3. each runtime or Gramps update has the potential to cause the flatpak to stop working. This has happened before. I personally check prerequisite updates to make sure the app does not break. While some people recommend automating prerequisite updates, I do not want to be responsible for breaking an app that some people use a lot. Furthermore, some add-ons will not work with newer prerequisites, so old versions are required in that case.
  4. including more prerequisites for more add-ons would make the flatpak for Gramps very time consuming. Some prerequisites could be updated if I had the ability for checking each prerequisite repository and then testing/troubleshooting the Gramps flatpak each time I made a change. I do not have that ability at this time.

Many popular add-ons do work on the Gramps flatpak. You are welcome to follow the link earlier to see the prerequisites included in the Gramps flatpak. If an add-on that you want does not work in the Gramps flatpak, you are welcome to submit a feature request. If an add-on seems popular then I am likely to add it when I have time for testing, or you could submit an update at GitHub - gramps-project/flatpak: Manifest and data files required to make a Gramps Flatpak if you already use github and can work a yml file. There is the flathub github also for Gramps, but everything sits at the gramps-project/flatpak for about a week for review first before submission to flathub unless it is an emergency (like to fix a crash caused by a runtime or prerequisite update).

As mentioned, for security reasons flathub will not allow shared runtimes to be modified, and the Gramps flatpak is precompiled and downloaded from flathub. These are the instructions for making your own flatpak from a manifest Building your first Flatpak — Flatpak documentation if you can do that then you are welcome to submit updates to the Gramps project flatpak linked earlier.

Drag and drop to the Gramps clipboard works fine for me, from both the OS file manager and also from the media tab of Gramps itself. However, I intentionally limited access to the linux home directory instead of root access, so if Chrome (based on linux kernel) stores files outside what the flatpak recognizes as the home directory, then install Flatseal from flathub in order to expand access to wherever the media is stored. I confirmed drag-and-drop works just now with the current Gramps 5.1.5 flatpak on Linux Mint 21.1 with the Mate desktop environment.

2 Likes

I hope this isn’t too far off topic but I wonder if you could help me understand flatpaks better. The yml file for Gramps is the first time I’ve tried to look at how Flatpak works.

First, does Flatpak build everything from source on the user’s machine? Or are pre-built binaries provided where the license allows?

If pieces are built on the user’s machine, does Flatpak try to ensure that each package is configured in a consistent manner? For example, Gramps uses GraphViz. GraphViz has many configuration options such as various language bindings (Java, Lua, Ocaml, R, …). Depending on what the GraphViz configure script finds on a particular user’s system, I believe it will automatically enable or disable a bunch of different features such as these language bindings. This can lead to bugs that are virtually impossible to reproduce and therefore extraordinarily frustrating for both users and those trying to provide support. Maybe I’m missing something important, though.

Thanks,

Craig

Flatpaks are not meant to be compiled on user systems. The manifest (in yml or javascript form) gets submitted to the flathub github, where after approval flathub compiles the app on its own servers using the manifest. So everything flatpak related is downloaded pre-compiled.

I test every update to the Gramps, usually on a VM with debian. Once the Gramps flatpak works on my VM without problems, it should work exactly the same on every installation regardless of the linux OS.

1 Like

If you haven’t heard it lately… thanks very much for this work! I’m new to Linux and appreciate the extra effort you’ve contributed.

With some tribulation, it seems likely I will need to begin exploring VMs to do some taste-testing of different forks to see which one can best serve up the Gramps master. The Flatpak should make prelim testing the VM forks much easier.

Thanks for the clarification. Does Flatpak support anything other than Intel x86 then?

Craig

The Gramps flatpak on Flathub is available for 64-bit Intel (x86_64 ) and 64-bit ARM (aarch64 ).

It looks like the Gnome runtime that we use is available on the following architectures:

  • arm
  • aarch64
  • i686
  • x86_64
  • ppc64le
  • riscv64

I don’t know how easy it would be to provide a flatpak on another architecture.

Now that I think about it, I only test that the Gramps flatpak works on an AMD64 system. I don’t have a Chromebook, so I don’t currently have a way of making sure the arch64 version works right. I also haven’t tested i686, though perhaps I could with a VM. Flathub requires that the manifest work for both AMD64 and arch64, which has caused occasional surprise arch64 compiling errors for the Gramps flatpak in the past with the prerequisites for some addons, even though the amd64 i tested compiled fine. IIRC one of the patches at the github for the Gramps flatpak are specifically to make it compile for arch64. One of the flathub maintainers has helped with the exiv and arch64 related stuff, which I barely know.

My Chromebook (Acer CB515-1HT-P39B) has an Intel Pentium chip. I haven’t been able to test the Flatpak installation yet because I need to free up some disk space.

I finally got it installed, and the drag-and-drop issue is still there.

FYI I got these warnings. (They don’t seem to be related to the issue but might be of interest.)

$ flatpak run org.gramps_project.Gramps

(gramps:2): Gtk-WARNING **: 18:46:19.073: Theme parsing error: adapta.css:9587:62: Using one color stop with linear-gradient() is deprecated.

(gramps:2): Gtk-WARNING **: 18:46:19.076: Theme parsing error: adapta.css:10258:71: Using one color stop with linear-gradient() is deprecated.

(gramps:2): Gtk-WARNING **: 18:46:19.082: Theme parsing error: adapta.css:11225:65: Using one color stop with linear-gradient() is deprecated.

(gramps:2): Gtk-WARNING **: 18:46:42.811: Theme parsing error: adapta.css:9587:62: Using one color stop with linear-gradient() is deprecated.

(gramps:2): Gtk-WARNING **: 18:46:42.824: Theme parsing error: adapta.css:10258:71: Using one color stop with linear-gradient() is deprecated.

(gramps:2): Gtk-WARNING **: 18:46:42.828: Theme parsing error: adapta.css:11225:65: Using one color stop with linear-gradient() is deprecated.
2023-06-11 18:46:47.598: WARNING: dummydb.py: line 1420: database is closed

I just noticed this, sorry for the delay. The first and easiest troubleshooting step is regarding permissions as I mentioned earlier. I don’t remember ever seeing a “home” directory in my Android phones, and so I suspect Chrome has a similar folder structure. I don’t know if there is code in Gramps for the Chrome file structure, and the flatpak only has access to “home” anyway which might not exist in Chrome.

Install flatseal through flathub and make sure that Gramps has access to whatever folder you want to drag files from into Gramps clipboard. Also make sure that the default media folder for Gramps as set in “preferences” is allowed in flatseal for Gramps to access. If there is a blank in the box for the folders mentioned in “preferences” then set each box to a folder and then make sure flatseal can access each folder.

Thanks @S.Mackay. There is a /home directory and Gramps has no problems accessing it. (It’s actually Debian running within a container within Chrome.) Anyway, I’ve given up on Flatpak since it didn’t fix the issue. I haven’t tried 5.1.6 yet but I doubt that will make a difference.

(For clarity, it’s not really a drag-and-drop-issue, just a drop issue. Dragging windows around is no problem, and I can drag objects but just can’t drop them anywhere.)

Since drag and drop doesn’t work on your ChromeOS system with either the flatpak nor directly installing Gramps into the debian container, but they both work fine for other people in linux, then you are right to guess that 5.1.6 probably won’t fix the problem. The problem has got to be something to do with file access or permissions on your system, possibly with a sandbox between the debian container and Chrome.

I should also mention, drag and drop works fine in other apps running in the container.

Some have suggested a possible issue with GTK, but its version is the same (3.24) as in other environments where the drag and drop works.

Anyway – I opened this thread because I was initially having issues installing Flatpak, but I’m beyond that now. If anyone has more ideas about the drag-and-drop issue, please post them there.

Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.