Search code examples
linuxdeploymentqt5appimagepythonqt

How to use appimage to deploy qt5 application


I'm using appimage http://appimage.org to pack my application in a standalone excutable.

I'm doint this on debian testing lenny.

My application uses a lot of opensource libraries (qt, python pythonqt fftw hdf4/5 gsl netpbm qwt) and everything was ok using Qt4. I can compile my app on debian and create an appdir image that run smoothly on mint (with xfce).

This stopped working when I switch to Qt5.

Now the appimage runs on debian, but not on mint, I get this error:

This application failed to start because it could not find or load the Qt platform plugin "xcb".

Available platform plugins are: eglfs, kms, linuxfb, minimal, minimalegl, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted

Notice that the messege is non-consistent: firts it says I lack xcb and than it maks as available.

I did copied the plugins directory in my app usr/lib tree. I have xcb installed on host apt-get install libx11-xcb1

My AppRun file looks like this:

#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
cd "${HERE}/usr/"
export LD_LIBRARY_PATH="${HERE}/usr/lib/:${LD_LIBRARY_PATH}"
export PATH="${HERE}/usr/bin:${PATH}"
export QT_PLUGIN_PATH="${HERE}/usr/lib"
exec "${HERE}/usr/bin/Neutrino" "$@"
cd -

What am I missing?


Solution

  • Many Qt5 applications such as Krita, Scribus, and Subsurface are being distributed as AppImages, so it is definitely possible.

    Probably you are missing some components that need to be bundled inside the AppImage. Especially, Qt plugins need to be bundled inside the AppImage for it to work.

    See here for an example of a Qt5.5 app being packaged as an AppImage.

    Note that it is generally recommended to use an old base system such as CentOS 6 for compiling, because the resulting AppImages will be compatible to more distributions rather than just the latest ones.

    If you post a link to your project or open an issue on https://github.com/probonopd/AppImages/issues I can possibly give you more detailed directions.