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 #393

Open
JakobDev opened this issue Jun 6, 2024 · 8 comments
Open

Flatpak #393

JakobDev opened this issue Jun 6, 2024 · 8 comments

Comments

@JakobDev
Copy link

JakobDev commented Jun 6, 2024

I've created a Flatpak package for PokeFinder, which allows easier Installation on Linux.
Here are the build files. PokeFinder works (except 2 little patches) out of the box, so you just need to add some data files. I can make a PR which does all needed changes, if you are interested in an Flatpak package.

@Admiral-Fish
Copy link
Owner

Is there any significant advantage to flatpak over something like appimage? I have see https://github.com/probonopd/linuxdeployqt before in the past but never tried to use it

@JakobDev
Copy link
Author

With Flatpak you have the guarantee that it works everywhere the same. An AppImage might not work on all Systems depending on how it's packaged.

Flatpak also offers a better System integration. You install and update Flatpaks through the Software Center of your Distro instead of downloading and executing random files from the Internet.

It also offers better Security through Sandboxing.

Flatpak is also easier than AppImage. You don't need to setup and Maintain a build pipeline. All you need to do is create a Manifest and submit it to Flathub. Flathub will automatically build and publish your App for x86_64 and AArch64.

@Admiral-Fish
Copy link
Owner

What changes would the repo need to support that

@JakobDev
Copy link
Author

There is only one change to the Code needed (could be put behind a build flag):

diff -ruN a/Source/main.cpp b/Source/main.cpp
--- a/Source/main.cpp	2024-06-06 08:22:08.352510825 +0200
+++ b/Source/main.cpp	2024-06-06 09:06:14.217586335 +0200
@@ -37,7 +37,7 @@
 {
     if (!setting.contains("settings/profiles"))
     {
-        QString profilePath = QString("%1/profiles.json").arg(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
+        QString profilePath = QString("%1/PokeFinderProfiles.json").arg(qgetenv("XDG_DATA_HOME"));
 
         QFile f(profilePath);
         if (f.open(QIODevice::NewOnly | QIODevice::Text | QIODevice::WriteOnly))

You could also use QStandardPaths::AppDataLocation, but then you would need to create the needed directory.

A thing that is more Linux specific, is that you need a Icon as PNG, a Desktop file and a AppStream file. Should I open a PR for that?

@Iguessthiswasinevitable

I would also be in favor of a flatpak. They're a lot less dependent on external factors unique to your specific computer.

@Admiral-Fish
Copy link
Owner

I wouldn't be opposed to adding flatpak support

@it-is-final
Copy link
Contributor

it-is-final commented Nov 9, 2024

As a proof of concept, I have a repository (which is a fork of PokeFinder) that has the needed files and a modified .yaml workflow which allows the CI to produce AppImages. The changes in this repo adds the needed .desktop, .png icon files and AppStream files needed for Flatpak, so the remaining work needed is the change to main.cpp.

Edit: Created new branch with more congruent folder structure
Another edit: Deemphasising AppImages, as they are not the point of this issue.
Another edit: Added the AppStream file
https://github.com/kaitouctr/PokeFinder/tree/appimage

@it-is-final
Copy link
Contributor

it-is-final commented Nov 15, 2024

By the way, for the Flatpak support, is there's any web domain that controlled by PokeFinder? That is particularly important for creating an application ID for Flatpak. I thought of io.github.Admiral_Fish.PokeFinder, which just requires Admiral-Fish to have a GitHub Pages set up actually maybe it is possible to just leave it without GitHub Pages, it just means that the Flatpak will be unverified (which only matters for people really conscious of their security). Those underscores are there as Flatpak (due to arbitrary dbus naming conventions) does not allow hyphens or dashes in anywhere but the last component of the application ID.

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

No branches or pull requests

4 participants