AppImageCommunity / libappimage

Implements functionality for dealing with AppImage files
https://appimage.org
Other
46 stars 29 forks source link

Add support for zstd compression #193

Open probonopd opened 1 week ago

probonopd commented 1 week ago

We are trying to standardize on zstd (no pun intended). So if libappiage doesn't support it yet, it would be highly appreciated if someone could add it.

@philmb3487 over at https://github.com/AppImage/appimagetool/issues/68#issuecomment-2365232487:

Some people are generating AppImages with zstd compression, and that is not supported out of the box by libappimage. Now, that is fine for executing AppImages, but file thumbnailers such as KDE's Dolphin use libappimage.so directly to peek at the .DirIcon information, which fails for zstd images.

Would it be possible to add this support?

Arch Linux seems to enable fuse to get that support, squashfuse then needs to be compiled with zstd support turned on. That's a lot of switches that might or might not be enabled, depending on the distribution, and I think thumbnails should always be available in any case.

See my findings here, https://github.com/ivan-hc/Steam-appimage/issues/27#issuecomment-2365229961

So, I propose either,

1) better zstd support out of the box, 2) document what needs to be done if Thumbnails cannot be shown on some appimages (out of the box it would be fine with xz, zip images,

Squashfs image uses (null) compression, this version supports only xz, zlib.
ERROR: appimage_read_file_into_buffer_following_symlinks : sqfs_open_image error: /home/phil/Applications/Steam-1.0.0.81-2-3-x86_64.appimage
probonopd commented 1 week ago

There is a pull request that did not get merged so far, maybe it can be reactivated:

probonopd commented 1 week ago

Currently we are using https://github.com/vasi/squashfuse/commit/1f98030 from 2016. We should probably use a more recent version.

The changes would need to be made around here:

https://github.com/AppImageCommunity/libappimage/blob/e56c21b5387fde92cbb91c835e7aa16ab60b3879/cmake/dependencies.cmake#L85-L104

and

https://github.com/AppImageCommunity/libappimage/blob/e56c21b5387fde92cbb91c835e7aa16ab60b3879/ci/install-deps.sh#L56

It seems that @TheAssassin had invested a lot of time to think about internal vs. external building (rather than my typical style of coding "linearly" to make it work in exactly one "known good" configuration), so I'll leave it up to him to add zstd support in order not to inadvertently break this flexibility.