Diego-Ivan / Flowtime

Spend your time wisely
GNU General Public License v3.0
115 stars 21 forks source link

Make libportal dependency optional #64

Closed chereskata closed 1 year ago

chereskata commented 1 year ago

libportal allows flowtime to talk to xdg-desktop-portals, providing integration into the host system when running as a container.

Installed natively, libportal is not needed to access host resources. It seems therefore useful to add an compile time option whether the artefact is containerised.

Thank you

ptrcnull commented 1 year ago

not only that, but Flowtime seems to currently depend on an unreleased version of libportal, making it impossible to build against a stable version (and, as a result, package for distros in a meaningful way):

../src/Services/Timer.vala:198.34-198.61: error: The name `set_background_status' does not exist in the context of `Xdp.Portal' (libportal)
  198 |             bool success = yield portal.set_background_status (status, null);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                
Diego-Ivan commented 1 year ago

Installed natively, libportal is not needed to access host resources. It seems therefore useful to add an compile time option whether the artefact is containerised. - @chereskata

In Flowtime, libportal isn't used to access files or other resources from the base system. Its primary uses in Flowtime are:

  1. Listen to the system's session manager and in case the session is ending, Flowtime will save the work/break statistics that would otherwise be lost. This is (I believe) done through a D-Bus calls that are provided through a nice API in libportal
  2. Report the status of the application in case it is running without a window. In GNOME Shell, this is reflected in the Background Apps panel.

When I worked in both of this features, I used libportal because it provides a nice wrap around D-Bus calls that I'd have to implement myself in order to make them work, and I really do not want to do that if there is a relatively small library that does that for me. So, libportal can not be optional.

not only that, but Flowtime seems to currently depend on an unreleased version of libportal, making it impossible to build against a stable version (and, as a result, package for distros in a meaningful way): - @ptrcnull

The version of libportal that Flowtime depends on provides the feature mentioned in the second point above, so I won't be using an older version of the library. Flatpak, which is the only packaging I support and actively maintain, provides a very easy way for me to include this version of the library without any conflicts.

I do not intend to maintain any packaging format other than Flatpak, and all the changes I make in the repository, will only be tested using Flatpak.

Thanks.