I am trying to build an AppImage for my PyQt app.
It requires Python 3
And Qt 5
I have put together a bash script to do the whole build process.
I’m concerned as the Conda plugin I am using seems to create files with hard-coded absolute paths, I have tried specifying paths that might work in my bootstrap file (which you can see in the build script below) file, with no luck
Am I missing something, or should I ask this elsewhere?
when I run it I see:
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Reinstalling the application may fix this problem.
/tmp/.mount_Blue_LjwovJA/AppRun: line 14: 2448 Aborted (core dumped) "$RUN_DIR/usr/conda/bin/python" "$RUN_DIR/usr/opt/blue-log-viewer/blue-log-viewer.py" $@
Here is my build script (the lines around the text “# get actual directory:” run inside the AppImage)
#!/usr/bin/env bash
# Stop on first error
set -e
TOOLS_DIR="$(dirname "$0")"
SOURCE_DIR="../"
BUILD_RIR="$SOURCE_DIR/build"
APP_DIR="$BUILD_RIR/AppDir"
BLV_DIR="$APP_DIR/usr/opt/blue-log-viewer"
APP_BIN_DIR="$APP_DIR/usr/bin"
APP_ARTWORK_DIR="$SOURCE_DIR/artwork"
cd "$TOOLS_DIR"
if [[ ! -f "linuxdeploy-plugin-conda.sh" ]]; then
wget -c "https://raw.githubusercontent.com/TheAssassin/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh"
chmod +x linuxdeploy-plugin-conda.sh
fi
if [[ ! -f "linuxdeploy-x86_64.AppImage" ]]; then
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod +x linuxdeploy-x86_64.AppImage
fi
export CONDA_PYTHON_VERSION=3.7.4
export CONDA_PACKAGES="pyqt==5.9.2"
./linuxdeploy-plugin-conda.sh --appdir "$APP_DIR"
mkdir -p "$BLV_DIR"
cp -Rfp "$SOURCE_DIR/blueLogViewer" "$BLV_DIR"
cp -Rfp "$SOURCE_DIR/blue-log-viewer.py" "$BLV_DIR"
cp -Rfp "$SOURCE_DIR/test" "$BLV_DIR"
mkdir -p "$APP_BIN_DIR"
echo '#!/usr/bin/env bash
# get actual directory
export RUN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUN_DIR/usr/conda/lib
export PATH="$PATH":"$RUN_DIR"/usr/bin
#source "$RUN_DIR/usr/bin/activate"
#source "$RUN_DIR/usr/bin/conda" activate "$@"
"$RUN_DIR/usr/conda/bin/python" "$RUN_DIR/usr/opt/blue-log-viewer/blue-log-viewer.py" $@
' > "$APP_BIN_DIR/blue-log-viewer"
chmod +x "$APP_BIN_DIR/blue-log-viewer"
../tools/linuxdeploy-x86_64.AppImage --appdir "$APP_DIR" \
-i "$APP_ARTWORK_DIR/blue-log-viewer.png" \
-d "$APP_ARTWORK_DIR/blue-log-viewer.desktop" \
--plugin conda \
--output appimage
#rm -R "$APP_DIR"
rm -r _temp_home
mv Blue_Log_Viewer-*-x86_64.AppImage "$BUILD_RIR"
reset
The resulting AppRun shows:
#!/usr/bin/env bash
# get actual directory
export RUN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUN_DIR/usr/conda/lib
export PATH="$PATH":"$RUN_DIR"/usr/bin
#source "$RUN_DIR/usr/bin/activate"
#source "$RUN_DIR/usr/bin/conda" activate "$@"
"$RUN_DIR/usr/conda/bin/python" "$RUN_DIR/usr/opt/blue-log-viewer/blue-log-viewer.py" $@