ludo icon indicating copy to clipboard operation
ludo copied to clipboard

Publish releases on Snap or Flatpak

Open Jacalz opened this issue 5 years ago • 27 comments

It would be wonderful if you could set this up as a snap or a flatpak application. It would help with making it easier to test and use on different distributions on Linux. Really great looking project btw 👍

Jacalz avatar Dec 28 '18 12:12 Jacalz

I've merged 2 PRs that should help with linux packaging in general, allowing to set important paths.

kivutar avatar Jan 01 '19 07:01 kivutar

For Flatpak, I've worked on org.libretro.RetroArch. Could use that as a frame of reference.

RobLoach avatar Jan 01 '19 15:01 RobLoach

Hi! Can I take up this issue.

ShubhamKJha avatar Jan 01 '20 13:01 ShubhamKJha

Yes

kivutar avatar Jan 21 '20 06:01 kivutar

@kivutar I have a working snap but I run into an issue with $HOME path. Snaps rewrite $HOME internally to separate and restrict environment (confinement good because roms). Problem is path to settings always resolves to /home/user/.ludo no matter what $HOME is set to and that is not accessible to ludo from snap. So I need to change path resolving to respect $HOME env.

@RobLoach Is this a problem for flatpak also?

predr avatar Jan 21 '20 08:01 predr

That's by-design for both flatpak and snap. It tries to protect the home directory by pseudo-sandboxing the environments. For Flatpak, we added --filesystem=host to the flatpak definition file, for snapcraft, I think you use - home plug?

See https://github.com/libretro/retroarch-snap for some inspiration.

Strange that while the environment setting is overwriten, it's still forced to /home/user/.ludo. Do you have any idea why that is? snap/flatpak do a pretty good job overwriting those, so I'm rather surprised.

RobLoach avatar Jan 21 '20 08:01 RobLoach

It's because usr.HomeDir pulls from /etc/passwd and completely ignores $HOME. os.UserHomeDir() might be a solution, or just using os.Getenv('HOME') and if empty fallback to usr.HomeDir for other systems. Working on it.

Snap is working and runs roms manually but unable to load/save anything in .ludo because of $HOME issue.

predr avatar Jan 21 '20 09:01 predr

OK I've merged your PR

kivutar avatar Feb 07 '20 07:02 kivutar

Nice. I'm waiting on snapcrafters to grant auto-connections for ludo snap (joystick and reading access for usb drives and $HOME/.ludo). Snap is made from Ludo's latest Github release so I'm also waiting for next release. I can change it to build from source but if I do that it will build with different core versions #108. After that I'll share it for people to test.

predr avatar Feb 07 '20 09:02 predr

Cleared on snapcraft side, waiting for 0.10.5 release. Please test snap and report issues.

predr avatar Feb 21 '20 14:02 predr

I made a new release @predr

kivutar avatar Feb 26 '20 12:02 kivutar

@kivutar v0.11.0 snap is released. Works great except for new snap related issues with paths in settings.toml, now visible. Fixable in snap, no changes to ludo code needed.

predr avatar Feb 27 '20 04:02 predr

That's great snap-side. What about Flatpak?

pdureau avatar Feb 27 '20 12:02 pdureau

Fixed remaining issues, next step is changing snap visibility from unlisted to public. Before I do that @kivutar do you want snap ownership transferred to your name?

Edit: Switched to public because there is high demand for games right now. Let me know if you want ownership when you can.

predr avatar Feb 28 '20 07:02 predr

Hi all, I have initiated a flatpak manifest file which works well so far: https://github.com/pdureau/flatpak-manifests

I will use it as my main ludo instance next days. What would be the next steps?

pdureau avatar Aug 11 '20 17:08 pdureau

Cool, so we have both snap and flatpack working if I understand well?

kivutar avatar Sep 05 '20 17:09 kivutar

Snap is done. https://snapcraft.io/ludo

Flatpak still needs to be put in store. https://flathub.org/apps/search/ludo @RobLoach can help with that.

predr avatar Sep 05 '20 23:09 predr

Hello,

I am using my flatpak package for a few weeks and it seems to work well. However, he can't be submitted to Flathub yet because it miss some requirements:.

I will fix soon the easy ones:

  • Manifests should therefore refer to tarballs or git tags and not the tip of a branch.
  • Flathub always builds in the flatpak branchname "stable"
  • Unnecessary files should be added to cleanup, in order to ensure smaller package sizes.
  • Applications must provide appstream data
  • Applications must provide application icons in at least 64×64px and 128×128px sizes. > I am providing only a 128x128px SVG
  • If an application hardcodes a path in $HOME and you don’t grant home access you can use --persist.

However, one looks problematic:

  • "Accessing the network is not allowed during the build process, to download extra files, everything that an app requires must be included within the manifest." > Ludo download some stuff during the building.

Source: https://github.com/flathub/flathub/wiki/App-Requirements

pdureau avatar Sep 06 '20 07:09 pdureau

Thanks a lot guys for taking care of this.

@pdureau What about using the binary releases here? They are tarballs https://github.com/libretro/ludo/releases and already include all the files. Or flathub really insists on building from source?

kivutar avatar Sep 08 '20 03:09 kivutar

Nice work, all! Looks like a solid manifest. Is there a way to use the manifest without having to publish to flathub? Their workflow is pretty strict, and could hold us back on release cycles.

RobLoach avatar Sep 08 '20 04:09 RobLoach

@kivutar : I will check what is possible with binary releases.

@RobLoach : I already use the manifest locally publishing the flatpak in my local repo. As a first step, ludo code base may need to add the desktop & appdata files to its codebase.

pdureau avatar Sep 08 '20 14:09 pdureau

As a first step, ludo code base may need to add the desktop & appdata files to its codebase.

I'm OK to merge a PR that adds this

kivutar avatar Sep 16 '20 06:09 kivutar

Hi @pdureau Are you still interested in sending your flatpak to flathub?

kivutar avatar Jun 08 '21 04:06 kivutar

Hi @kivutar Sure I am. I hope I will less busy late summer to work on it.

pdureau avatar Jul 06 '21 06:07 pdureau

I added support for XDG, I hope it can help.

kivutar avatar Aug 16 '21 06:08 kivutar

@pdureau Flatpak support would be fantastic!

johnnyq avatar Jan 10 '22 16:01 johnnyq

was hoping to try this on my steam deck, need that flatpak!

dhitchcock avatar Jun 04 '22 16:06 dhitchcock