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

Flatpack, AppImage, Docker #356

Open
sciurius opened this issue Mar 21, 2024 · 6 comments
Open

Flatpack, AppImage, Docker #356

sciurius opened this issue Mar 21, 2024 · 6 comments

Comments

@sciurius
Copy link
Collaborator

This isssue is for discussing everything with regard to a flatpack image for ChordPro.

@sciurius sciurius changed the title Flapack Flatpack Mar 21, 2024
@sciurius
Copy link
Collaborator Author

As originally reported by Luke:

I don't know a great deal about flatpak packaging or distribution, but have managed to put together a rough proof of concept that builds a chordpro flatpak (not wxchordpro, can't get wx to install from cpan).  The shell script is just to show the steps I used, all the work is done by the flatpak-builder tool and the manifest file (org.chordpro.chordpro.yml).  The manifest file has a number of comments that might be useful

This isn't a request for a flatpak, I'm happy using a CPAN install, this was just to see if it was possible to flatpak chordpro and to share that it is indeed possible.  I haven't looked into any of the work required for publishing the flatpak on flathub ( https://docs.flathub.org/docs/for-app-authors/submission/ ) or github pages ( https://github.com/andyholmes/flatter ).

chordpro-flatpack.zip

@sciurius
Copy link
Collaborator Author

sciurius commented Mar 21, 2024

That a ready-to-run binary image has interesting advantages for certain users is beyond discussion.
Currently we have pre-built packages for Debian and Fedora, and for Microsoft Windows and MacOS.
There's also a docker image and an (still experimental) AppImage for x86_64 linux.

What would be the benefits of flatpack over appimage and docker?

@sciurius sciurius changed the title Flatpack Flatpack, AppImage, Docker Mar 22, 2024
@lpinner
Copy link
Contributor

lpinner commented Mar 25, 2024

I'm a (moderately tech-savvy) end user not a software developer/packager, so comments below are from that perspective, not a technical comparison. Apologies in advance for rambling.

Flatpak

For a general end-user, flatpak is probably the simplest Linux software distribution method. Most new distributions support flatpak out of the box. I like flatpak for its integration into my distributions software centre which means software can be found in one place, notifications about updates are available and I can view, add and remove flatpak repositories via the software centre GUI. Ubuntu is a bit of an exception as users need to install and use the Gnome Software application instead of Ubuntu's snap based app store. Flatpak applications will work with any Linux distribution as they don't rely on host system libraries.

However...

Flatpak may not be the best option for chordpro. Flatpak is mostly geared towards desktop GUI applications with app menu launching (click to run) not commandline executables. wxchordpro is a GUI application and fits this paradigm, however CLIs are a bit unwieldy to use e.g flatpak run org.chordpro.chordpro unless you alias chordpro='flatpak run org.chordpro.chordpro'.

Flatpak is supposed to enable developers/packagers to easily provide software for many distributions as a single format. This is the case if software the developer relies on is available in the runtime. But Perl is not well supported by flatpaks and is not available in either the freedesktop or Gnome platform runtimes so it has to be built and included in any flatpak that requires perl. I haven't been able to get wxperl to install when building chordpro proof of concept flatpak, though I haven't expended any effort to resolve as I don't use or need wxchordpro. I have a simple workflow that uses a text editor with chordpro syntax highlighting and ability to run CLI chordpro for text to chordpro and pdf output.

AppImage

I don't like lack of integration into desktop for discovery, install and update. Ideally AppImage should work with any distribution, though seems like this isn't always the case in practice. Might be possible to get chordpro AppImage working on any distro by building on an older distro - https://docs.appimage.org/reference/best-practices.html#binaries-compiled-on-old-enough-base-system https://discourse.appimage.org/t/will-a-new-appimage-run-on-older-distributions/84

Docker

I found docker difficult to set up/use initially and it seems geared towards services/devops/cloud deployments. It's another technology to learn rather than just downloading an AppImage file or installing a Flatpak via an app store. I found the docker image works fine for the CLI chordpro, but fails when running wxchordpro. Could be because I used podman (opensource container software) which supposedly is a drop in replacement for docker. I didn't submit an issue as wxchordpro is not something I use.

CPAN

I struggled for a while and made a mess of things trying to install chordpro and dependencies with CPAN a few years ago before I found out about cpanimus and Local::Lib. Now I'm happy enough with using it for chordpro, but it's not really a simple installation method for new users.

Conclusion...?

I think AppImage or Flatpak are better for your average end-user. I built the flatpak just as a proof of concept and you are welcome to reuse any of that if you want to go down that path, but it seems like it would be a big pain to get wxwidgets and wxperl working in a flatpak so might be a better use of time to get the AppImage working. Perhaps try an old distro for building the AppImage.

@lpinner
Copy link
Contributor

lpinner commented Mar 25, 2024

Re: "Perhaps try an old distro for building the AppImage." if you point me at your AppImage build script, I can attempt to build on an older Ubuntu VM.

@sciurius
Copy link
Collaborator Author

The problem that I encountered with AppImage is that Perl uses libcrypt. This is implemented as libcrypt.so.2 on some platforms, and libcrypt.so.1 on other platforms.
Another issue is that modern Debian system provide statically linked Perl binaries and libraries.

In the dev branch there are two directories, pp/linux and pp/debian. The first is basically a generic Linux that links dynamically. The second links statically. You should be able to build them with make after adding appimagetool to your PATH.

@lpinner
Copy link
Contributor

lpinner commented Mar 27, 2024

I've submitted a work in progress PR #362

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

No branches or pull requests

2 participants