chrismaltby / gb-studio

A quick and easy to use drag and drop retro game creator for your favourite handheld video game system
https://www.gbstudio.dev
MIT License
8.52k stars 469 forks source link

Consider Providing A Flatpak Image #21

Closed CuriousTommy closed 4 weeks ago

CuriousTommy commented 5 years ago

It would be nice to have a flatpak image, so that it is easy to install on any Linux distro.

thomas-alrek commented 5 years ago

Maybe this could be achieved through electron-installer-flatpak?

CuriousTommy commented 5 years ago

@thomas-alrek That could work, but we also need to make sure that the required libraries for those binary files are also included.

chrismaltby commented 5 years ago

I was looking at electron-installer-flatpak while working out how I should distribute, the app is using Electron Forge so adding flatpak is actually just a one line add to the package.json.

The problem I found though is I can't find a way to build that version from my Mac, for Windows builds I've got that working with Wine / Mono, for deb and rpm builds you can install all the dependencies to build cross platform from a Mac. So with the current setup I can just run npm make:all and come back a little later and they're all ready to distribute. If possible I don't want to have to run a different build process running a Linux VM for doing a prod build.

I've heard another possibility would be using a CI server to make the builds instead, just preferably one I don't need to pay for :-)

thomas-alrek commented 5 years ago

CircleCI offers free containers for open source projects. So you could test it locally through Docker, and then port that config over to CircleCI.

I use CircleCI through my job daily, and can help you set it up

chrismaltby commented 5 years ago

Ah I use CircleCI at work too, it's great! Not used it to do electron builds though but looks like there's quite a bit of info out there for it

https://dev.to/kontrollanten/super-fast-electron-builds-with-circleci--5ghn https://github.com/protonmail-desktop/application/blob/7289770d44f8f8acdda69f878643d354928e406e/.circleci/config.yml

thomas-alrek commented 5 years ago

111

barthalion commented 4 years ago

Submitted a draft pull request at https://github.com/flathub/flathub/pull/1553

One of Flathub's technical requirements is offline build and unfortunately electron-forge makes it virtually impossible, ignoring environment variables to re-use predownloaded yarn cache, so it repackages deb package instead. Additionally at least metainfo file should be maintained here instead of Flathub repo.

Please have a look when you have some time, @chrismaltby.

soredake commented 4 years ago

No progress on this?

lunarcloud commented 3 years ago

FWIW: an AppImage would be far simpler than a flatpak for users, is portable, and works with the itch app

hadess commented 3 years ago

FWIW: an AppImage would be far simpler than a flatpak for users, is portable, and works with the itch app

Maybe you should create a separate issue if that's something you want to discuss.

merwok commented 3 years ago

The comment is not off-topic on this issue though. The topic is distributing applications for many operating systems based on linux, which is always a discussion of relative merits of snap vs flatpak vs appimage. A personal preference for flatpak (which I share!) shouldn’t mean rude dismissal of other people’s comments.

hadess commented 3 years ago

The topic is distributing applications for many operating systems based on linux

Is it though? The whole discussion is about how to use Electron Forge to create said Flatpak.

A personal preference for flatpak (which I share!) shouldn’t mean rude dismissal of other people’s comments.

I don't think it was rude, but I certainly intended it to cut short any discussion of the merits of other packaging systems, especially when it's not one of the "makers" Electron Forge supports: https://www.electronforge.io/config/makers

lunarcloud commented 3 years ago

Totally sorry. I just meant if this issue became something that wouldn't move forward, an alternative solution. It's been a while, but I've written scripts to create appimages before and had good luck with them ( I had bad luck making flatpaks ). Can totally ignore my comment if it derails proper work/progress though.

hadess commented 3 years ago

The main problem with making Flatpaks is one that's shared by many distributions' builders, for security and reproducibility reasons: no network access. Fixing that would help with building in any other packaging system/build system with similar characteristics.

Electron Forge uses https://www.npmjs.com/package/electron-installer-flatpak to do the "Flatpak'ing", but it actually just creates an installed tree with the binaries, same as for creating DEB or RPM, and bundles that up. Not much to do there other than file a bug against electron-forge and explain the exact details of the problems encountered.

In the meanwhile, and rather than tilting at windmills, @chrismaltby can use @barthalion's work and use the Debian package as a starting point for the offline packaging. If the Flatpak distribution of gb-studio is hosted on Flathub, then the package gets built and distributed there. That would avoid having to invest in CIs.

JakobDev commented 1 year ago

I had opened a new PR