I am the main developer of Heroic Games Launcher and we have a Snap package available but it is not working fully because of some limitations of the confinement so I need help figuring out how to fix those or how to change it to use classic confinement since this one works just fine.
The current issues are:
Heroic comes with some binary files that are needed to deal with the stores integration, one of them, Legendary, which deals with the Epic games side, cannot write its configs. For some reason, even if it is called from inside Heroic, it doesn’t have permission to write inside Heroic’s folder. It needs to have access to the snap/../config/heroic/legendaryConfig folder. Without it, it is not possible to Log on to the Epic Games store, list games, install them, etc.
The second issue is that Heroic uses curl to download things like Wine, Proton, DXVK and VKD3D. Since it is confined it cannot use it. I tried using the layout feature to symlink /usr/bin/curl but that also does not work for some reason.
The latest issue is that Heroic needs to access some folders in the user’s home. Things like the .local/share/Steam folder so it can check for Proton versions and also add Heroic shortcuts to Steam. It also accesses .local/share/lutris folder to check for wine versions from it as well.
Other features that Heroic has and we were able to implement on Flatpak like Feral Gamemode and Gamescope I also don’t know how to do so I would need help figuring out on how to download and compile those files or some way to make them available to Heroic so users can use these features.
I am not familiar with how Snaps and Flatpaks are close or not but if it helps I can paste here the link to our manifest file.
I also think that the easiest fix would be to make it use the classic confinement so it would have access to those helpers and to the necessary files on the home folder when needed.
Hi!
I am using Electron-builder for that.
After installing the snap I know it stores the generated manifest somewhere but I dont remember the exact path.
Looks like the template YAML is located at node_modules/app-builder-lib/templates/snap/snapcraft.yaml. The actual YAML that is used for the installed version of Heroic can be found on your system at /snap/heroic/current/meta/snap.yaml.
Your third issue should be solved by adding a personal-files plug like we do on the Steam snap. I’ll look into the other problems some more.
Getting things like GameMode to work might be tricky, but I have some prior work on that for the Steam Snap (1, 2). GameMode specifically will likely need this PR that has yet to be merged to work in a Snap environment: https://github.com/flatpak/xdg-desktop-portal/pull/882.
Great!
I tried using the personal files and also creating a dot-config plug for the legendary config but they did not work, at least not with electron-builder. Not sure if its something wrong with this lib but I could see the plugs correctly on the YML so I am not sure anymore.
I also testing the snaps in Endeavour OS, should I test it on Ubuntu?
Testing on mainline Ubuntu would be a good baseline to test against, yes. If you do end up going the custom snapcraft.yaml route, I’d also recommend upgrading to core 22 (or at least core 20).
I think electron-builder is not supporting core 22 because I was having several errors when trying to build with it. Core 20 worked fine I believe. Will test again.
EDIT: I have Ubuntu 23.04 on my machine as well, I will try it on it as well.
It doesn’t look like electron-builder supports core 22, core 22 has quite a few syntax changes so it would probably require a custom YAML (which I’d probably recommend if you’re up for it, anyway). I’m taking a stab at writing one, too
I’d recommend not using electron-builder for this use case. It’s fine for more traditional electron apps, but heroic is a bit more complex. My recommendation would be to use a separate packaging repo for the snap that references the binary of heroic published on github releases page. We have plenty of prior art there which I think @ashtonn can dig up.
Like he said, it pulls the deb from the latest release on GitHub and builds the Snap from that. It still has some of the issues you’ve described, but it’d be a good place to start.
I believe curl is working correctly with that version, it at least is letting me download Proton and Wine versions it seems.
For your third issue, you should be able to add this to the plugs section of that YAML:
Hey, how can forcefully change the XDG_CONFIG_DIR? Even with a custom script before launching, the XDG_CONFIG_HOME again sets to $SNAP_USER_DATA/.config where as for heroic it should be in $SNAP_USER_COMMON/.config