Hi,

I have been working on getting Flatpak on Sailfish device. It doesn't work
yet, but let me give a short overview of the status.

Why: Flatpak would allow us to get latest Qt base, 5.12 and 5.13 are
available already. There are other advantages, as collaboration between
Linux mobile communities via the same app format, for example. Although, we
do loose native feel until Silica can be packaged as a part of an app.

Current longer-term limitations: As Lipstick (?) supports wl-shell only,
Gdk apps as distributed in Flatpak don't support that older standard, they
refuse to start.

Status:

Packages are available at
https://build.merproject.org/project/show/home:rinigus:flatpak. By
installing `flatpak` you will pull the dependencies as well. For me it was

The following 11 NEW packages are going to be installed:
  flatpak flatpak-session-helper gdk-pixbuf json-glib libappstream-glib
libcroco librsvg libseccomp ostree-libs
  xdg-dbus-proxy xdg-desktop-portal

 After installation, set /usr/libexec/flatpak-bwrap to setuid. Without it
we get issues with /proc mounting in flatpak (bwrap: Can't mount proc on
/newroot/proc: Device or resource busy).

To use, reboot the device. While running commands leading to download of an
app/platform/sdk, I am getting gpg-connect-agent error messages. Seems like
we can ignore them for now.

Just install and running fails, probably due to OpenGLES in Qt case. For
Gnome apps, I am getting error with "Wayland compositor does not provide
any supported shell interface", so those are out (for now, at least).

For Qt, I have added manually an extension (as in
https://blog.tingping.se/2018/08/26/flatpak-host-extensions.html and
https://gitlab.com/debian-pm/halium/flatpak-extension-libhybris). Right
now, I have
made /var/lib/flatpak/extension/org.freedesktop.Platform.GL.default/arm/1.4/lib
and added content similar to the one generated by
https://gitlab.com/debian-pm/halium/flatpak-extension-libhybris/blob/master/debian/flatpak-extension-libhybris.postinst.in
with few additions, such as linker/o.so. Applications are installed using
--user and run with several environment variables to help hybris out, as
shown in strace run below:

flatpak run --devel --command=strace
--env=LD_LIBRARY_PATH=/usr/lib/arm-linux-gnueabihf/GL/default/lib
--env=HYBRIS_EGLPLATFORM_DIR=/usr/lib/arm-linux-gnueabihf/GL/default/lib/libhybris
--env=HYBRIS_LINKER_DIR=/usr/lib/arm-linux-gnueabihf/GL/default/lib/libhybris/linker
org.kde.falkon /app/bin/falkon

While I can get into Flatpak sandbox (using command sh), GUI has opened
only once on a qtdemo app, but without hybris extension. In case of Falkon,
strace ends on

fstatat64(AT_FDCWD, "/dev/__properties__", 0xffef3fa8, 0) = -1 ENOENT (No
such file or directory)
openat(AT_FDCWD, "/dev/__properties__",
O_RDONLY|O_LARGEFILE|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or
directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x684} ---

which is missing in the flatpak sandbox, indeed. For few other apps, it
ended earlier on failing to find libhardware.so (curiously, found by falkon
sandbox).

That's pretty much it at this moment. All being tested on SFOS
3.2.1.20/AOSP9 based port. Did not work in emulator with what looked to be
missing kernel config options.

As far as I read, Plasma Mobile has hybris/flatpak working and I will try
to get in touch with them. Would be great to get help - maybe someone would
like to join and try to make it work together. At this moment I have spent
few nights to get it packaged and haven't poked it too much.

Cheers,

Rinigus

PS: Full range of portals (GUI for requesting file access and such) needs
to be written. But that can wait till it gets working first.
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to