From cfccbceb8e33e1dd3a025bb88b9bb8502dee229d Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Tue, 3 Feb 2026 17:01:25 +0200 Subject: [PATCH] Adjust AppImage AppDir layout and AppRun script Update the Linux CI AppImage build to copy the cx_Freeze output directly into AppDir root (so 'lib' sits next to the 'ytsage' binary) to avoid ModuleNotFoundError: encodings. Fix the .desktop Exec path, add .DirIcon, and replace the previous symlink with an AppRun script that sets LD_LIBRARY_PATH and execs the bundled binary. --- .github/workflows/build-linux.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index efb1737..0811f77 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -279,19 +279,31 @@ jobs: wget -q -O appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x appimagetool - # Setup AppDir structure + # Setup AppDir structure (Root layout matches cx_Freeze build output exactly) rm -rf AppDir - mkdir -p AppDir/usr/bin + mkdir -p AppDir - # Copy trimmed build content (preserving relative paths for cx_Freeze libs) - cp -r "$build_dir"/* AppDir/usr/bin/ + # Copy trimmed build content DIRECTLY to AppDir root + # This keeps 'lib' adjacent to 'ytsage', preventing 'ModuleNotFoundError: encodings' + cp -r "$build_dir"/* AppDir/ # Setup metadata cp ytsage.desktop AppDir/ + # Fix Exec path for AppImage context (binary is in root, not /usr/bin) + sed -i 's|Exec=/usr/bin/ytsage|Exec=ytsage|g' AppDir/ytsage.desktop cp branding/icons/icon.png AppDir/ytsage.png + # .DirIcon for file managers + cp branding/icons/icon.png AppDir/.DirIcon - # Create AppRun symlink - ln -s usr/bin/ytsage AppDir/AppRun + # Create AppRun as a script to correctly set environment + cat > AppDir/AppRun <<'APPRUN' + #!/bin/sh + SELF=$(readlink -f "$0") + HERE=$(dirname "$SELF") + export LD_LIBRARY_PATH="$HERE/lib:$LD_LIBRARY_PATH" + exec "$HERE/ytsage" "$@" + APPRUN + chmod +x AppDir/AppRun # Build AppImage (using --appimage-extract-and-run to avoid FUSE issues in CI) # We explicitly set ARCH for appimagetool