foliate icon indicating copy to clipboard operation
foliate copied to clipboard

Please provide an AppImage for Linux

Open probonopd opened this issue 5 years ago • 32 comments

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.

probonopd avatar Jun 04 '19 17:06 probonopd

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 avatar Jun 05 '19 01:06 johnfactotum

@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 avatar Jun 30 '19 23:06 itprojects

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

itprojects avatar Jul 01 '19 09:07 itprojects

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.

johnfactotum avatar Jul 01 '19 10:07 johnfactotum

-- 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...

itprojects avatar Jul 01 '19 11:07 itprojects

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

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

johnfactotum avatar Jul 01 '19 11:07 johnfactotum

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

itprojects avatar Jul 01 '19 12:07 itprojects

@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?

johnfactotum avatar Jul 01 '19 16:07 johnfactotum

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.

probonopd avatar Jul 01 '19 16:07 probonopd

Understood. Thanks for the clarification.

johnfactotum avatar Jul 01 '19 16:07 johnfactotum

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

itprojects avatar Jul 01 '19 17:07 itprojects

Did you test this in xenial @itprojects?

probonopd avatar Jul 01 '19 17:07 probonopd

Tested with Ubuntu 19.04

itprojects avatar Jul 01 '19 17:07 itprojects

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.

probonopd avatar Jul 01 '19 18:07 probonopd

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 avatar Jul 01 '19 18:07 itprojects

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

itprojects avatar Jul 01 '19 19:07 itprojects

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.

probonopd avatar Jul 01 '19 22:07 probonopd

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 avatar Jul 02 '19 08:07 itprojects

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

itprojects avatar Jul 02 '19 09:07 itprojects

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

probonopd avatar Jul 02 '19 17:07 probonopd

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 avatar Jul 10 '19 17:07 TheAssassin

@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).

TheAssassin avatar Jul 10 '19 17:07 TheAssassin

@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.

johnfactotum avatar Jul 11 '19 07:07 johnfactotum

@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.

TheAssassin avatar Jul 11 '19 15:07 TheAssassin

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

johnfactotum avatar Jul 11 '19 15:07 johnfactotum

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

TheAssassin avatar Jul 11 '19 15:07 TheAssassin

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

stevenpusser avatar Sep 01 '19 00:09 stevenpusser

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.

probonopd avatar Sep 04 '19 06:09 probonopd

Any update on this ?

chromer030 avatar Jul 03 '21 08:07 chromer030

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.)

Moonbase59 avatar Jan 03 '22 11:01 Moonbase59