Use linuxdeploy GTK plugin
[geeqie.git] / scripts / generate-appimage.sh
index 43bc2f7..f5df698 100755 (executable)
 ## will be created.
 ##
 
-
 if [[ ! -f geeqie.spec.in ]] || [[ ! -d .git ]]
 then
        echo "This is not a Geeqie folder"
        exit 1
 fi
 
-target_dir=$(realpath "$1")
-
-if [[ $? -ne 0 ]]
+if ! target_dir=$(realpath "$1");
 then
        echo "No target dir specified"
        exit 1
 fi
 
 rm -rf "$target_dir"/AppDir
-mkdir "$target_dir"/AppDir
+mkdir "$target_dir"/AppDir || { echo "Cannot make $target_dir/AppDir"; exit 1; }
 
 sudo rm -rf doc/html
 
@@ -52,14 +49,16 @@ sudo make maintainer-clean
 make -j
 make install DESTDIR="$target_dir"/AppDir
 
-export VERSION=$(git tag | tail -1)
+VERSION=$(git tag | tail -1)
+export VERSION
 
-cd "$target_dir"
+cd "$target_dir" || { echo "Cannot cd to $target_dir"; exit 1; }
 
 linuxdeploy-x86_64.AppImage \
        --appdir ./AppDir --output appimage \
        --desktop-file ./AppDir/usr/share/applications/geeqie.desktop \
        --icon-file ./AppDir/usr/share/pixmaps/geeqie.png \
+       --plugin gtk \
        --executable ./AppDir/usr/bin/geeqie
 
-mv "./Geeqie-$VERSION-x86_64.AppImage" "$(./Geeqie-$VERSION-x86_64.AppImage -v | sed 's/git//' | sed 's/-.* /-/' | sed 's/ /-v/' | sed 's/-GTK3//').AppImage"
+mv "./Geeqie-$VERSION-x86_64.AppImage" "$(./Geeqie-"$VERSION"-x86_64.AppImage -v | sed 's/git//' | sed 's/-.* /-/' | sed 's/ /-v/' | sed 's/-GTK3//').AppImage"