TruFont AppImage (Qt based) fails to run due to missing library
probonopd opened this issue · 4 comments
#! /bin/bash
sudo apt -y install git
export VERSION=$(wget -q "https://api.github.com/repos/trufont/trufont/commits?sha=master" -O - | grep sha | head -n 1 | cut -d '"' -f 4 | head -c 7
)
export APPNAME=trufont
export PIP_REQUIREMENTS="-e git+https://github.com/trufont/trufont#egg=$APPNAME fs"
# export CONDA_PACKAGES="$APPNAME" # Only use this if the app is in a Conda channel (e.g., conda-forge)
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget -c "https://raw.githubusercontent.com/TheAssassin/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh"
chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-conda.sh
rm -r AppDir || true
cat > $APPNAME.desktop <<EOF
[Desktop Entry]
Version=1.0
Name=TruFont
Exec=trufont %U
Terminal=false
Type=Application
Icon=$APPNAME
Categories=Graphics;
EOF
cat > AppRun <<\EOF
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
exec "$HERE/usr/conda/bin/python" "$HERE/usr/conda/bin/trufont" "$@"
EOF
chmod +x AppRun
wget -c "https://github.com/trufont/trufont/raw/master/Lib/trufont/resources/app.png"
convert app.png -resize 512x512 $APPNAME.png
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin conda -i $APPNAME.png -d $(readlink -f "$APPNAME.desktop") --custom-apprun AppRun --output appimage
results in
me@host:~$ ./TruFont-d1ef225-x86_64.AppImage
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
Aborted
on Xubuntu 18.04.4 LTS.
The culprit is that libxkbcommon-x11.so.0
is not being deployed, as are many other Qt dependencies.
So in this regard, Conda seems to be falling into the same trap as pip:
Despite pip installed a binary distribution of PyQt5 (wheel), the re-packaged AppImage does not work when moved to another system, e.g. CentOS 7. It fails due to missing dependencies (xcb) not packaged by PyQt5's wheel (actually this problem is related to libxkbcommon-x11 missing, see below)
https://github.com/niess/linuxdeploy-plugin-python/issues/27#issuecomment-597364202
Further reference:
srevinsaju/guiscrcpy#56 (comment)
Did you find a solution for this problem?
I have the same error as this issue and https://discourse.appimage.org/t/pyqt-not-building-please-help/1706/2
According to https://github.com/niess/linuxdeploy-plugin-python/issues/27#issuecomment-597364202, libxkbcommon-x11
(and potentially other dependencies) also need to be bundled. Supposedly https://github.com/niess/python-appimage can handle this, maybe you'd like to give it a try and post over at https://github.com/niess/python-appimage/issues in case you run into issues with it.