Perl Gtk3 app

Alexander Larsson alexl at redhat.com
Fri Mar 10 09:00:07 UTC 2017


On Thu, 2017-03-09 at 11:50 +1100, Daniel Kasak wrote:
> Hi all.
> 
> I'm investigating the feasibility of packaging a perl-gtk ( gtk3 )
> application using Flatpak. The application will soon be released
> under the GPL, but there will be commercial plugins from various
> sources ( in particular, us, but also 3rd party things like DB
> drivers ). There is quite a list of dependencies, even for the open-
> source version. For example we need the latest unixODBC, we need a
> long list of obscure Perl libraries. We of course need all the gtk3
> dependencies.

This is not uncommon for commercial apps, even when not packaging as a
bundle. The intended mode for flatpak use is that you bundle these
dependencies with your application.

1) Can an application depend on more than 1 repo?

I'm not sure what you mean by repo here. A flatpak repo? Flatpaks don't
depend on repos. They are installed from them. 

In general there is no package-system style of dependencies in flatpak.
There is only the app, and the runtime it uses. Anything not in the
runtime you chose will have to be added to the app.

> 2) Are there any Perl repos in existence? I guess I'm asking too much
> for a Perl repo with all the Gtk3 bindings built already? :) I guess
> this isn't *too* hard to build on Linux? It's practically impossible
> on Windows.

If you use the freedesktop or gnome runtimes there is no perl on the
final platform runtime, however there is one in the SDK (as lots of
apps use perl during the build, but not so many at runtime). So, you
would need to bundle perl too (although you may be able to copy it from
the sdk into the app rather than rebuilding it yourself).

I've not seen anyone building the perl gtk bindings in flatpak, but it
should be pretty easy.

> 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?

In a fully sandboxed mode there is only one writable location, which
is in "$HOME/.var/app/$application". This is the per-application data
storage area, and is different for each user.

Of course, you can also explicitly grant the app access to some other
directory if needed.
 
> 
> 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?
> Alternatively I assume I can expose / map a part of the host
> filesystem to my application? I'd prefer not to do this if possible -
> I like the idea of sandboxing the app, in particular because clients
> will feel much safer installing a sandboxed app.

There are two ways this could be done. First of all, you can inject
such files by storing them in the per-application storage area. In this
case they would be completely unmaintained by flatpak.

Secondly, you can use something called "extensions". A flatpak
application can expose an "extension point", and if a separate flatpak
runtime with an id that matches the extension point is installed it
will be mounted at the place specified for the extension point. This
allows you to have "maintained" things being inhected into the app
(i.e. these are listed in flatpak list, gets updates, can be available
for multiple users, etc) .

> 
> 5) I understand that Linux is the only OS currently targeted. Has
> anyone tried Flatpak under Window's "bash for windows" thing? I'd be
> interested in hearing thoughts on future compatibility.

I have not personally tested it, but at least some of the features
flatpak uses seem to be supported in bash for windows, so it may work
(or rather, may be possible to make it work).

I don't know of anyone being interested in doing that work atm though.


> 6) Assuming an application can depend on more than 1 repo, would an
> application that pulled in both GPL and non-GPL dependencies using
> Flatpak be considered "distributing", and therefore possibly not
> compliant with the GPL?

Lawyer questions must be answered by a Lawyer.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's a jaded neurotic cop She's a disco-crazy punk fairy princess with an 
incredible destiny. They fight crime! 



More information about the xdg-app mailing list