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

TruFont AppImage (Qt based) fails to run due to missing library #33

Open
probonopd opened this issue May 2, 2020 · 4 comments
Open

Comments

@probonopd
Copy link
Contributor

probonopd commented May 2, 2020

#! /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.

@probonopd
Copy link
Contributor Author

The culprit is that libxkbcommon-x11.so.0 is not being deployed, as are many other Qt dependencies.

@probonopd
Copy link
Contributor Author

probonopd commented May 2, 2020

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)

@aghamir
Copy link
Contributor

aghamir commented May 28, 2020

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

@probonopd
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants