Admiral-Fish / PokeFinder

Cross platform Pokémon RNG tool
GNU General Public License v3.0
295 stars 72 forks source link

Flatpak #393

Open JakobDev opened 1 month ago

JakobDev commented 1 month ago

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 commented 1 month ago

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 commented 4 weeks ago

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 commented 4 weeks ago

What changes would the repo need to support that

JakobDev commented 3 weeks ago

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?