Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatpak - Linux #810

Open
cadric opened this issue Dec 18, 2023 · 14 comments
Open

Flatpak - Linux #810

cadric opened this issue Dec 18, 2023 · 14 comments
Labels
enhancement New feature or request

Comments

@cadric
Copy link

cadric commented Dec 18, 2023

Is your feature request related to a problem? Please describe.
Flatpak's are a much better universal, sandboxed way of distributing apps on linux. It works on a majory of linux distro's. And it is much easier to handle and update for a user. And for some immutable distro's, like Fedora Silverblue, its the only way to install apps.
You can see distro's where flatpaks can be setup for here: https://flathub.org/setup

Describe the solution you'd like
While I am happy that you now create RPM and Deb files for libation, it would be better if you did it as a flatpak. They update automatically and it is possible for the user to download the app at either flathub.org or in their software center.
There is plenty of information on how to build flatpaks at https://docs.flatpak.org/en/latest/first-build.html and I am sure if you reached out to cassidyjames, he would be more then happy to help you get setup with building a flatpak. He has helped a lot of apps to get on flathub.

Additional context
A Verified version of Libation on flathub would be so hot ;)

@cadric cadric added the enhancement New feature or request label Dec 18, 2023
@P5421135-2
Copy link

Wholeheartedly agree, I am on void linux and I cannot install it. A flatpak would bring in many more users.

@ghost
Copy link

ghost commented Jan 28, 2024

Also unable to install on Arch Linux due to the AUR package being broken, and no other alternative for downloading, flatpak would be a game changing!

@rmcrackan
Copy link
Owner

I don't know how to script github to create a "flatpak". If you do though, let me know

@jjcf89
Copy link

jjcf89 commented Feb 1, 2024

If anyone cares, I did find a snap of the project. https://snapcraft.io/libation

@ghost
Copy link

ghost commented Feb 1, 2024

It doesn't work out! The snap build is also broken!

@jwillikers
Copy link
Contributor

@rmcrackan I think most users will want the app to be available on Flathub, which will take care of building everything for you. You'll need to submit a PR to add your app to the flathub repository.

There's a Flatpak GitHub Action available, which is really easy to use if you just want to build your application. It's a bit more involved to set up your own Flatpak repository for users to actually obtain the Flatpak, but it is possible through GitHub Pages.

Some projects will have a Flatpak manifest in their repository for building a development version of the app separate from the official one on Flathub. Regardless of whether you do that or not, I recommend adding a .desktop file and appstream metainfo file in the Libation repository itself. I have GitHub workflows that build a Flatpak and validate these files in my demo app repository here if you want a reference.

Let me know if you'd like any help with this.

@rmcrackan
Copy link
Owner

Let me know if you'd like any help with this.

Yes, please. I know very little about linux and frankly yaml just makes me angry -- there's always some gotcha that's impossible to track down. If you can help set this up for linux Libation folks, I'd be much appreciative.

My experience with yaml is like when the engineer's kid asked: why does the sun rise in the east and set in the west?
Engineer: It works -- don't touch it!

@jwillikers
Copy link
Contributor

Let me know if you'd like any help with this.

Yes, please. I know very little about linux and frankly yaml just makes me angry -- there's always some gotcha that's impossible to track down. If you can help set this up for linux Libation folks, I'd be much appreciative.

My experience with yaml is like when the engineer's kid asked: why does the sun rise in the east and set in the west? Engineer: It works -- don't touch it!

I feel your pain. I kinda of hate YAML too. If you like, the manifest can be written in JSON instead of YAML.

I bet I'll be able to find some time to work on this. I've never flatpak'd a C# app before, so I'll have to brush up on that.

@rmcrackan
Copy link
Owner

I have other yaml files here for building. I'm just in no rush to make another myself. If you can make it so I just have to drop it in my workflow, I'll happily do so.

@rmcrackan
Copy link
Owner

Hey linux folks, do you have any opinions or info about this .AppImage request? #1035

@jwillikers
Copy link
Contributor

@rmcrackan I've made some good progress on the Flatpak. Here's what needs attention before we submit the app to Flathub.

  1. Add an AppStream metainfo file. This should be maintained in the Libation repository, see here. It contains a releases section which should be updated for each release. The release information is displayed in app stores. As part of this, there needs to be screenshots which need to follow these guidelines. I've got an initial AppStream metainfo file with some screenshots and CI checks that I'll submit in a PR.
  2. The most important issue with the Flatpak right now is that it doesn't quite work right in the sandbox. That is, the filesystem access for ~/Libation is actually in the Flatpak itself instead of on the host filesystem where you'd expect. Anytime the Flatpak is updated, this internal path will be overwritten. When using the file chooser to select paths, everything will work because it takes care of granting permissions and exposing the path inside the container using XDG Desktop Portals. The path where things are mounted inside the Flatpak won't match the path outside the Flatpak, i.e. ~/Libation would be mounted at a somewhat arbitrary location like /sys/yadadada/1234-1. It's possible to get around this, though Flathub says access should be limited. The solutions are to expose the entire home directory to the Flatpak, to automatically mount the path ~/Libation in the Flatpak, or to rework how the storage directory is selected so that it always uses the portal to access the filesystem. Exposing the entire home directory should be avoided, but only exposing the ~/Libation directory could lead to problems where the My Documents folder is used, though we could also expose this path. Only using the portal to access the Books directory seems like the best option, if possible, but would require application changes. Sandbox permissions are documented here.
  3. The selection The same folder that Libation is running from for the Books location is bound to cause problems in the Flatpak. When Libation is running as a Flatpak, it should hide this setting. To determine if Libation is running inside a Flatpak, you can check for the flatpak-spawn executable and the file /app/manifest.json.
  4. Flatpaks should have settings that are separate from other installations of the same application. So if you set dark mode in the Flatpak app and not in Libation installed through the deb package, dark mode should only be set in the Flatpak. Using XDG configuration directories usually resolves this automatically with no intervention required by the developer as the Flatpak will automatically use its own directories for these things as documented here. It seems to me like the settings are stored in the Books directory, though, so they are shared across different installations. I'm not sure if this will actually come up in review, but it's not ideal.
  5. Once all of this is done, ideally a stable release will be cut which includes the necessary changes to support the Flatpak. Flathub requires stable releases, documented here. Then a submission can be made to Flathub.

@hendrix04
Copy link

I have other yaml files here for building. I'm just in no rush to make another myself. If you can make it so I just have to drop it in my workflow, I'll happily do so.

haha, I hear ya! One thing that I do is write everything in JSON then have my pipelines convert to YAML if something is absolutely needed. There is a reason ignition was created to sit on top of butane... That reason is that people hate YAML so they came up with a new system that required no yaml! I have also been gravitating towards cuelang to simplify generating config files.

@rmcrackan
Copy link
Owner

Pre-release v11.5.4 has docker and flatpak changes. Please reply here with your experiences.

@jwillikers
Copy link
Contributor

@rmcrackan You'll want to update the metadata file with the new release information here as part of the release process, so that it ends up in the release. That's what will end up being shown as the version of the Flatpak and the release description will also be shown in app stores as release notes. You can see how that will look like in Flathub as an example here.

I've got a fork of Flathub here. You should fork my branch there and submit a PR to the new-pr branch in the Flathub repository when you're ready. I've included a README with some documentation for building and updating the Flatpak. The instructions for submission are documented here.

Note that some of the points in my previous comment might come up during review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants