Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(linux): make the AppImage .DirIcon relative to the AppDir (#9124)

Akarshan Biswas98c3b84a5a21
diff --git a/src-tauri/build-utils/buildAppImage.sh b/src-tauri/build-utils/buildAppImage.sh
index d81bed384..816db5557 100755
--- a/src-tauri/build-utils/buildAppImage.sh
+++ b/src-tauri/build-utils/buildAppImage.sh
@@ -20,6 +20,18 @@ fi
# bundle additional resources in the AppDir without pulling in their dependencies
cp ./src-tauri/resources/bin/bun $APP_DIR/usr/bin/bun
+# tauri-cli before 2.11.4 (tauri-apps/tauri#15596) links .DirIcon to the icon's
+# absolute build-host path, which dangles inside the mounted AppImage. appimagetool
+# keeps it because it resolves here, so re-point it relative to the AppDir root.
+DIR_ICON="$APP_DIR/.DirIcon"
+if [[ "$(readlink "$DIR_ICON")" == /* ]]; then
+ ln -sfn "$(basename "$(readlink "$DIR_ICON")")" "$DIR_ICON"
+fi
+if [ ! -f "$DIR_ICON" ] || [[ "$(readlink "$DIR_ICON")" == /* ]]; then
+ echo ".DirIcon in $APP_DIR is missing or not relative to the AppDir."
+ exit 1
+fi
+
# remove appimage generated by tauri build
APP_IMAGE=./src-tauri/target/release/bundle/appimage/$(ls ./src-tauri/target/release/bundle/appimage/ | grep AppImage | head -1)
echo $APP_IMAGE