Perl Gtk3 app

Mathieu Bridon bochecha at daitauha.fr
Thu Mar 9 08:25:35 UTC 2017


Hi,

I'll only answer the questions for things I know, and let others fill
in what's missing.

On Thu, 2017-03-09 at 11:50 +1100, Daniel Kasak wrote:
> Anyway ... questions:
> 
> 1) Can an application depend on more than 1 repo?

Yes. In your flatpak-builder manifest, you just list all the modules
which need to be bundled (the dependencies for your app not already
provided by the runtime).

For example, org.gnome.Games uses the GNOME runtime (for GNOME
dependencies like GLib, Gtk3, ...) and then bundles its additional
dependencies (libretro cores, ...).

https://git.gnome.org/browse/gnome-games/tree/flatpak/org.gnome.Games.j
son

> 3) Does Flatpak allow files to be injected into an application after
> installation. For example, there are some commercial ODBC drivers
> that I can't legally distribute. Users however can purchase,
> download, and install them into a regular linux system. Is there a
> way to push these libraries into an installed Flatpak application? 

Not unless you make the host filesystem accessible inside the sandbox.
(see further down)

You can "package" those as extensions to your application, though.

For example, org.gnome.Games will soon have an
org.gnome.Games.Plugin.NonFree extension which will contain some non-
free emulators.

https://git.gnome.org/browse/gnome-games/tree/flatpak/org.gnome.Games.P
lugin.NonFree.json?h=wip/alex/example-app-extension

Users who only install org.gnome.Games with Flatpak will only have the
emulators bundled with it, but users who additionally install
org.gnome.Games.Plugin.NonFree will automatically have the non-free
emulators too, as Flatpak will "mount" the extension into the
application sandbox.

> Alternatively I assume I can expose / map a part of the host
> filesystem to my application?

You can, with the "filesystem" finish args.

See the flatpak-build-finish man page for the possible values, and look
at other flatpak-builder manifests (for example the org.gnome.Games one
I shared above) for how to use that in your own manifest.

But you're right that it is a hole in the sandbox and it should be
avoided if possible.

> 4) Does a sandboxed flatpak application have a permanent storage
> space for storing configuration files, etc? If it does, where does
> this live? Would each user get their own storage space?

An app will have access to its $XDG_DATA_HOME, $XDG_CONFIG_HOME and
$XDG_CACHE_HOME. It can write in those, and the data written there will
persist after closing the app.

Those directories live under the user's home directory.

You can probably add some system-wide (shared among all users) folder
to $XDG_DATA_DIRS so that the app would have access to it, but I'm not
sure how it would work and whether the app could write to it.

See the Freedesktop spec for more details on the XDG directories:

https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html


-- 
Mathieu



More information about the xdg-app mailing list