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 Port #198

Merged
merged 8 commits into from
Jun 11, 2024
Merged

Flatpak Port #198

merged 8 commits into from
Jun 11, 2024

Conversation

jo5huajohn
Copy link
Contributor

I'm not sure if this is in a state to be merged, but I figured it would be good if other people with more experience with flatpaks took a look at this and suggested best practices/improvements that I could make.

@jo5huajohn jo5huajohn mentioned this pull request Apr 21, 2024
@vrement
Copy link

vrement commented Apr 27, 2024

Oh nice! The first "RC" is here

@berarma
Copy link
Owner

berarma commented Apr 28, 2024

I know nothing about Flatpak packaging so I can't help.

This patch doesn't affect normal operation , I can merge and let users try it.

Apart from merging, I guess there's some more work to do to create the actual package and publish it. Are you doing it too?

Instead of patching the meson build file, wouldn't it be easier to use the command line arguments to change the udev path?

@berarma berarma added enhancement New feature or request help wanted Extra attention is needed labels Apr 28, 2024
@berarma berarma added this to the 0.9.0 milestone Apr 28, 2024
@berarma
Copy link
Owner

berarma commented Apr 28, 2024

There might be some important tips here. I would need help implementing them correctly for Flatpak though.

@jo5huajohn
Copy link
Contributor Author

I've removed the patch in my local branch and added the config in the metadata file in my local workspace.

@jo5huajohn
Copy link
Contributor Author

As for creating the actual package and supporting it, I'd like to do it, but it will take a while since I'm still learning what goes into creating a flatpak. I'm also looking into how to support XDG portals in the application. From what I understand, oversteer only needs to integrate the file chooser portal to select profiles and test CSVs.

@jo5huajohn
Copy link
Contributor Author

I've implemented the xdg file chooser portal and updated the appdata file, but I'm not so sure about the udev rules since as I understand it, it violates flatpak rules.

@jo5huajohn
Copy link
Contributor Author

Additionally, I would like to rename the app-id to io.github.berarma.oversteer as per the flathub app id requirements:

The Application ID should be a real URL of a domain that the app author has control over or where their app is hosted.

Ignoring this will lead to problems down the line, such as not being able to verify the app and receiving payments. It also decides, which verification methods will be available. For e.g. using io.github.flathub.TestApp would only allow for Github or Website verification.

@berarma
Copy link
Owner

berarma commented May 17, 2024

I've implemented the xdg file chooser portal and updated the appdata file, but I'm not so sure about the udev rules since as I understand it, it violates flatpak rules.

Installing udev rules should be discarded. A Flatpak package shouldn't do that. The user will have to install them manually or ask distros to include the rules. Maybe native packages could be created for the main distros with only the rules. They have never belonged here but it was the easiest way to distribute them.

I've seen there are GTK changes included. Why these changes? And why not apply them independently of this PR?

@jo5huajohn
Copy link
Contributor Author

This change is to implement the FileChooser portal, and introduce file filters for tests and profiles. FileChooserNative uses FileChooserDialog in the backend, but uses the FileChooser portal if it detects that it is being run in a flatpak environment.

@berarma
Copy link
Owner

berarma commented May 17, 2024

This change is to implement the FileChooser portal, and introduce file filters for tests and profiles. FileChooserNative uses FileChooserDialog in the backend, but uses the FileChooser portal if it detects that it is being run in a flatpak environment.

Why are they duplicated? Once in the source code and the same changes again in portals.diff.

@jo5huajohn
Copy link
Contributor Author

jo5huajohn commented May 17, 2024

Oops. That shouldn't have been there. Removed the patch.

@jo5huajohn
Copy link
Contributor Author

Additionally, I would like to rename the app-id to io.github.berarma.oversteer as per the flathub app id requirements:

The Application ID should be a real URL of a domain that the app author has control over or where their app is hosted.
Ignoring this will lead to problems down the line, such as not being able to verify the app and receiving payments. It also decides, which verification methods will be available. For e.g. using io.github.flathub.TestApp would only allow for Github or Website verification.

Do you have any thoughts on this? Additionally, if the flatpak is good to go, the flatpak directory should be submitted to the flathub repo. I can add a commit to remove the flatpak directory and submit it to the flathub repo.

@berarma
Copy link
Owner

berarma commented May 26, 2024

Additionally, I would like to rename the app-id to io.github.berarma.oversteer as per the flathub app id requirements:

The Application ID should be a real URL of a domain that the app author has control over or where their app is hosted.
Ignoring this will lead to problems down the line, such as not being able to verify the app and receiving payments. It also decides, which verification methods will be available. For e.g. using io.github.flathub.TestApp would only allow for Github or Website verification.

Do you have any thoughts on this? Additionally, if the flatpak is good to go, the flatpak directory should be submitted to the flathub repo. I can add a commit to remove the flatpak directory and submit it to the flathub repo.

I've enabled berarma.gihub.io. Is that enough?

@jo5huajohn
Copy link
Contributor Author

It isn't necessary, but yeah. I've made the following changes:

  • Removed the flatpak directory since this needs to be submitted to the flathub repo.
  • Included an image in data/ and referenced this in the README and the appdata file (for flathub images).
  • Renamed the application in all appropriate files.

Once this commit is merged, I'll run final tests defined by the flathub guidelines and create a new PR there.

@berarma berarma merged commit f5132ad into berarma:master Jun 11, 2024
@jo5huajohn
Copy link
Contributor Author

A flatpak for Oversteer is now live on flathub.

@berarma
Copy link
Owner

berarma commented Jun 21, 2024

A flatpak for Oversteer is now live on flathub.

I've tried it but it doesn't read settings nor let me change them. It has no permissions.

Shouldn't I make a new release with the Flatpak changes?

@jo5huajohn
Copy link
Contributor Author

Ideally, yes. But I've linked it to the latest commit for now. I'll start following the releases once 0.8.3 is out.

That's odd. I'm assuming you're running the driver and have the udev rules installed. Do you have xdg-desktop-portal-gnome on your system? You can check by going to the directory /usr/share/xdg-desktop-portal and looking for gnome-portals.conf.

You can also try flatpak override --reset io.github.berarma.Oversteer. This should reset any global permission overrides on the application. Some users have also reported a reboot working.

My suspect is the application can't access the files created by the driver due to flatpak filesystem permissions on your system.

You can also use Flatseal to check if any permissions are denied.

@berarma
Copy link
Owner

berarma commented Jun 21, 2024

I uninstalled my natively installed version and it removed the udev rules. Now that I've restored them it's working. I'll add a note in the Readme. I'll create a new release shortly so Flatpak users are on a known release version.

Thanks for your work on this! 👏

@jo5huajohn
Copy link
Contributor Author

Awesome. Happy to help!

@vrement
Copy link

vrement commented Jun 22, 2024

Just noticed this after a longer time and i see we now have a flatpak! Great work all involved! Viva la easy effortless Linux installations 👍

@vandea05
Copy link

A note from a Linux neophyte- the readme for the Flatpak is a little sparse and I found the documentation pretty hard to follow regarding the udev rules. I'd propose updating the Flatpak readme to make the udev requirement a little more prominent and perhaps include a little more information on where to find the rules in the repo and where to put them. It probably seems really obvious from inside the ecosystem but it's quite daunting from the outside!

@jo5huajohn
Copy link
Contributor Author

@vandea05 I'll have the README updated with the information in the next update.

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

Successfully merging this pull request may close these issues.

4 participants