There are some Flatpak apps that have optional dependencies that are not bundled with the app. E.g the plotting package Veusz is available as a Flatpak and it can optionally use the Python package h5py
to open HDF5 files. But h5py
is not bundled with the Flatpak version. I saw a flatpak command flatpak enter
that the documentation says allows us to
Enter the flatpak sandbox.
So I started the Veusz flatpak app and used flatpak ps
to get its PID. Then I tried sudo flatpak enter PID pip3 install h5py
but it installed h5py
in my host operating system!
TLDR; Is it possible to install custom packages (not just Python packages) in a Flatpak application's sandbox? If yes, how shall I do it?
In general, you need to add an extension point and create a new package.
For example, add an extension point for the directory you need to add files (here lib/GL
):
[Extension org.gnome.Platform.GL]
version=1.4
directory=lib/GL
and make a new flatpak package with the files to add (here org.gnome.Platform.GL
).
In this case though, there may be some sort of issue. Looking at the metadata file for the Veusz flatpak here, they seem to be including hdf5 and h5py already. If you're missing this functionality you probably want to raise an issue in the repo.