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

Please provide an AppImage for Linux #44

Closed
probonopd opened this issue Jun 4, 2019 · 38 comments
Closed

Please provide an AppImage for Linux #44

probonopd opened this issue Jun 4, 2019 · 38 comments
Labels
help wanted Extra attention is needed

Comments

@probonopd
Copy link

If a Snap app, PPA, or an AppImage should pop up after I publish this, do let me know so I can add it in.

https://www.omgubuntu.co.uk/2019/05/foliate-ebook-reader-linux

Providing an AppImage would have, among others, these advantages:

  • Applications packaged as an AppImage can run on many distributions (including Ubuntu, Fedora, openSUSE, CentOS, elementaryOS, Linux Mint, and others)
  • One app = one file = super simple for users: just download one AppImage file, make it executable, and run
  • No unpacking or installation necessary
  • No root needed
  • No system libraries changed
  • Works out of the box, no installation of runtimes needed
  • Optional desktop integration with appimaged
  • Optional binary delta updates, e.g., for continuous builds (only download the binary diff) using AppImageUpdate
  • Can optionally GPG2-sign your AppImages (inside the file)
  • Works on Live ISOs
  • Can use the same AppImages when dual-booting multiple distributions
  • Can be listed in the AppImageHub central directory of available AppImages
  • Can double as a self-extracting compressed archive with the --appimage-extract parameter
  • No repositories needed. Suitable/optimized for air-gapped (offline) machines
  • Decentralized

Here is an overview of projects that are already distributing upstream-provided, official AppImages.

If you have questions, AppImage developers are on #AppImage on irc.freenode.net.

@johnfactotum
Copy link
Owner

I'm interested in providing an AppImage, but I'm also at a complete loss as to how to make one.

Foliate uses Meson and follows the GJS Application Packaging Specification. With Flatpak, this pretty much just works, which is why I was able to get it on Flathub very quickly and easily. Making Snaps, debs, and AppImages is much more involved, particularly because there aren't any templates that I can follow and also of the fact that I don't use Ubuntu personally, and I'm not very familiar with it.

I'd appreciate it if anyone can provide any help with this.

@johnfactotum johnfactotum added the help wanted Extra attention is needed label Jun 5, 2019
@itprojects
Copy link
Contributor

@johnfactotum Since this thread is under "help wanted", the following bash script has been made. It produces binary .deb files which have been tested and work. Minimal effort required!
package.deb.sh.txt

@itprojects
Copy link
Contributor

@probonopd Can you make a Debian/Ubuntu PPA with the script in the comment above?

@johnfactotum
Copy link
Owner

Is it possible to build a source package instead? I think the -- whatever tool you'd use to make debs -- does support Meson? Or maybe configure Meson to install things inside a directory and then build the deb from there? Redoing all what's currently done by Meson by hand seems a bit unsatisfactory to me.

@itprojects
Copy link
Contributor

itprojects commented Jul 1, 2019

-- whatever tool you'd use to make debs --
Do you mean the package.deb.sh? It has a (file)name, you know...

If the meson can produce the folder (and it possibly can) than packaging should be easy.

Work on deb source will require a veteran debian maintainer...

@johnfactotum
Copy link
Owner

Do you mean the package.deb.sh? It has a (file)name, you know...

No, I mean like Debhelper, or maybe other related tools.

@itprojects
Copy link
Contributor

Those ones we might not need. Meson should be able to handle it entirely.

@johnfactotum
Copy link
Owner

@probonopd Foliate should now be able to build and run on Bionic without any problem. I've also added the debian/ directory for building .debs. I know that ideally we should try and make it work on Xenial, but maybe we can target Bionic first and go from there?

@probonopd
Copy link
Author

Hello @johnfactotum please always build on the oldest, not the newest, operating system releases that your users might be running. We recommend no newer than the oldest still-supported LTS release of Ubuntu, which at this time is xenial. Otherwise the AppImage will not run on all still-supported LTS releases of Ubuntu, and will fail the automated tests on https://github.com/AppImage/appimage.github.io.

So I suggest to first make it build on xenial, then I can help you with turning it into an AppImage.

@johnfactotum
Copy link
Owner

Understood. Thanks for the clarification.

@itprojects
Copy link
Contributor

itprojects commented Jul 1, 2019

Can you add the following Debian/Ubuntu instructions:

Prepare the environment:

sudo apt-get install meson gettext build-essential devscripts libglib2.0-dev debhelper

Download foliate form github

Unarchive foliate-master.zip

cd foliate-master

dpkg-buildpackage -us -uc -nc

Package is found in foliate-master:

com.github.johnfactotum.foliate_1.3.1_amd64.deb

Install with:

sudo dpkg -i ./com.github.johnfactotum.foliate_1.3.1_amd64.deb

@probonopd
Copy link
Author

Did you test this in xenial @itprojects?

@itprojects
Copy link
Contributor

Tested with Ubuntu 19.04

@probonopd
Copy link
Author

Can you please test with Ubuntu 16.04? That is what it needs to build on if we want to make an AppImage that runs on all still-supported Ubuntu versions.

@itprojects
Copy link
Contributor

itprojects commented Jul 1, 2019

Attempted to test on Ubuntu 16.04. Failed.

16.04 has:
meson version = 0.29.0 (Required meson_version: '>= 0.40.0')
gjs = 1.44.0 (bigger problem!)

@itprojects
Copy link
Contributor

Attempted to test on Ubuntu 18.04 (Bionic). Success.

@probonopd
Copy link
Author

That's exactly the experience I'm having with Meson all the time. Someone needs to ensure it works on anything but the latest bleeding edge systems.

@itprojects
Copy link
Contributor

For Ubuntu 16.04, the support left seems to be for security patches, not new packages. To make it worse that version of Ubuntu does not use the gnome-shell by default, that's bad.

@itprojects
Copy link
Contributor

@probonopd Do you know how to make an AppImage for Bionic?

@probonopd
Copy link
Author

probonopd commented Jul 2, 2019

Build on xenial. The resulting AppImage will also run on bionic and subsequent versions.

@TheAssassin
Copy link

TheAssassin commented Jul 10, 2019

I'd just build on bionic, and move on from there. As in, get something to work on a vast majority of systems, then try to make it work on older systems. Being annoying at first and preventing someone from building something that works for the vast majority of systems is counterproductive.

I hadn't heard of GJS before, but I guess it should be fairly easy to create a linuxdeploy plugin, if there's a need for one. Does GJS need a special runtime, or does meson automatically produce a binary that "just runs"? If the latter applies, then a simple meson install (or however that works) into a DESTDIR (CMake/autotools term) followed by an appimagetool call should bring you somewhere already.

The tests @probonopd mentions are only relevant if you want your AppImage listed in his AppImageHub. @probonopd is quite picky on where AppImages need to be able to run, e.g., to make sure only AppImages that run fine on the oldest Ubuntu LTS are listed.
As a start, however, there's no need to get in there yet. Just get going. You can always then work on your CI/CD workflow. I guess you just need to build meson and perhaps some of GJS yourself to get things to work.

@TheAssassin
Copy link

@itprojects @johnfactotum feel free to pass by on IRC, #appimage on Freenode, where we can interactively help you. Also see https://docs.appimage.org for more information (no specific GJS information (yet, if you want to make one, be our guest), but lots of other useful information).

@johnfactotum
Copy link
Owner

johnfactotum commented Jul 11, 2019

@TheAssassin Thanks a lot for the help! To be honest the documentation is a bit confusing to me, and there's very little on GTK apps.

There's no binary for Foliate itself, per se. It's really just a script that will be run by GJS. I suppose to make an AppImage one has to bundle GJS with all the GTK libs that it depends on? And then also WebKitGTK, which is the other runtime dependency.

I see there's an open issue on creating a GTK plugin for linuxdeploy? Because Foliate is really just a pretty standard GTK application. Well, maybe except the fact that it uses GJS. But there are plenty of GNOME apps that use GJS, notably Polari and Gnome Maps, among several others, and they all use Meson and follow the same standard package specification. So it'd be great if there's some tool that will "just work" for creating AppImages for these apps.

@TheAssassin
Copy link

@johnfactotum the issue you mention is about evaluating whether there's a need for a plugin to bundle resources aside from shared object libraries, which are already bundled just fine. We're making AppImages for many GTK based software already, a recent example is Xournal++ (using appimagecraft).

For GJS, as you say, a runtime must be bundled as well. Therefore, there is the need for a specific plugin. If it's only one program that needs to be bundled with the libraries it depends on, it's really really simple.

As a first attempt, we could try to write a bundling script that uses linuxdeploy to create an AppDir and bundle GJS's binary, then copy in your scripts and call linuxdeploy a second time to make the AppImage.

I'm happy to help you, I'll be on IRC for the next hours (I guess at least ~6 hours from now), with minor interruptions. I can write the script quickly but I will need some input from you during the process.

@johnfactotum
Copy link
Owner

Thanks! I've actually never used IRC before, but I guess there's a first time for everything.

@TheAssassin
Copy link

It's still very popular among free software communities. You can just use the webchat, or get a real client.

@stevenpusser
Copy link

stevenpusser commented Sep 1, 2019

If you do still want a proper way to build deb packages with debhelper, there's my OBS repo:

https://build.opensuse.org/project/show/home:stevenpusser:Foliate

You can get the source files here: https://download.opensuse.org/repositories/home:/stevenpusser:/Foliate/xUbuntu_18.04/

The OBS also has some mechanism to create AppImages, but I can't figure that out.

Fedora has also been packaging it--is there some way to create AppImages from their builds?

https://repology.org/project/foliate/versions

@probonopd
Copy link
Author

The OBS also has some mechanism to create AppImages, but I can't figure that out.

Please check https://docs.appimage.org/packaging-guide/hosted-services/opensuse-build-service.html

If you have questions, AppImage developers are on #AppImage on irc.freenode.net.

@chromer030
Copy link

Any update on this ?

@Moonbase59
Copy link

Moonbase59 commented Jan 3, 2022

Just a quick +1 from me: Many Linuxers will prefer an AppImage over Snap or FlatPak anytime! (Although I currently use the PPA .deb on my Linux Mint machines.)

@sdwolfz
Copy link

sdwolfz commented Feb 19, 2022

Does anybody actually have an example of a gjs application that's successfully packaged as an AppImage to showcase for inspiration?

I'm trying to build one but failing, between the segfaults I'm getting and the different behavior in Ubuntu 20.04 vs Manjaro; I don't really see how this can be done in practice....

@karam72
Copy link

karam72 commented Mar 12, 2022

Any updates?

The only way to use without root password is to have AppImage. On my company they don't allow use to have root password. So ı can not install Foliate.

Also AppImage allow to run multiple version of Foliate on the same OS user without installing/re-installing the app.

@gerardbm
Copy link

+1 for the AppImage.

@johnfactotum
Copy link
Owner

Closing this as at this point it's not really planned anymore.

Note that if you do have a system that runs a recent enough version of GNOME, you can definitely run Foliate without root. In the stable version you can install to a local directory, and with new gtk4 branch you can even run directly from the source tree, no build step necessary.

If you run an old LTS system, I'm guessing that it might not be easy or possible to run a recent enough GNOME stack, even with AppImage. At any rate it seems to be against AppImage's philosophy to use the latest platform libraries. So in this case — since I'm not planning on supporting these older platforms — you would probably do better with a containerized solution like Flatpak.

Alternatively, if you have a recent enough web browser, you could try the new online reader: https://johnfactotum.github.io/foliate-js/reader.html. It's currently very lacking in features but it does work for opening and reading e-books, without having to install or download any software.

@johnfactotum johnfactotum closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
@probonopd
Copy link
Author

probonopd commented Mar 7, 2023

At any rate it seems to be against AppImage's philosophy to use the latest platform libraries.

Well, I'd say it's best practice for developing anything to target not the latest and greatest, but older target systems - those your users are likely to have. But if your application needs the latest and greatest, you could to bundle these things privately inside the AppImage. Because you cannot assume that all users will already have the latest versions of everything.

@johnfactotum
Copy link
Owner

That's fair. But at this point I honestly couldn't be bothered anymore to try to figure out what can or cannot run on all these different systems, much less figuring out what and how to bundle.

Compare this to Flatpak, where you're only developing against one environment, which will run the same way everywhere, on old and new systems alike. And in Foliate's case, everything is already included in the GNOME runtime, so the app literally builds and runs with zero configuration!

It would certainly be great if Foliate could be made available as an AppImage. But personally, I would rather just spend time developing the app itself instead.

@sid-the-sloth
Copy link

too bad, it's a great app, lots of people would have used the AppImage, but the vision (dev to dev opinion here) is rather limited (gnome, flatpak... latest & greatest)... so then -- "goodbye and thanks for all the fish!"

will continue using calibre.

@WojciechMigda
Copy link

FYI, due to dependency on meson >= 0.59 foliate 2.6.1 is the latest that builds on xenial. (Kudos to @itprojects for step-by-step tutorial!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests