Include arm64 AppImages
authorColin Clark <colin.clark@cclark.uk>
Sun, 16 Oct 2022 08:52:35 +0000 (09:52 +0100)
committerColin Clark <colin.clark@cclark.uk>
Sun, 16 Oct 2022 08:52:35 +0000 (09:52 +0100)
README.md
scripts/generate-appimage.sh

index cf1f6a1..d7ef84e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -99,7 +99,7 @@ Geeqie is available:
 
 * as a [flatpak](https://flathub.org/apps/details/org.geeqie.Geeqie) from the [Flathub site](https://flathub.org/home).
 
-* as an [AppImage](https://www.geeqie.org/AppImage/index.html) (Generated from the latest sources).
+* as an [AppImage](https://www.geeqie.org/AppImage/index.html) - x86_64 and arm64 (Generated from the latest sources).
 
 * as a [Homebrew](https://formulae.brew.sh/formula/geeqie) or [MacPorts](https://ports.macports.org/port/geeqie) package for macOS.
 
index bfb4782..f34b803 100755 (executable)
 ## will be created.
 ##
 
+x86_64()
+{
+       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
+}
+
+## @FIXME arm AppImage of linuxdeploy does not yet exist
+## Compile from sources
+aarch64()
+{
+       linuxdeploy \
+               --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
+
+       appimagetool-aarch64.AppImage ./AppDir/ ./Geeqie-aarch64.AppImage
+}
+
 if [ ! -f geeqie.spec.in ] || [ ! -d .git ]
 then
        printf '%s\n' "This is not a Geeqie folder"
        exit 1
 fi
 
-if ! target_dir=$(realpath "$1");
+if ! target_dir=$(realpath "$1")
 then
        printf '%s\n' "No target dir specified"
        exit 1
@@ -41,7 +65,10 @@ fi
 
 rm -rf ./build-appimge
 rm -rf "$target_dir"/AppDir
-mkdir "$target_dir"/AppDir || { printf '%s\n' "Cannot make $target_dir/AppDir"; exit 1; }
+mkdir "$target_dir"/AppDir || {
+       printf '%s\n' "Cannot make $target_dir/AppDir"
+       exit 1
+}
 
 meson setup build-appimage
 meson configure build-appimage -Dprefix="/usr/"
@@ -50,13 +77,25 @@ DESTDIR=/"$target_dir"/AppDir ninja -C build-appimage install
 VERSION=$(git tag | tail -1)
 export VERSION
 
-cd "$target_dir" || { printf '%s\n' "Cannot cd to $target_dir"; exit 1; }
+cd "$target_dir" || {
+       printf '%s\n' "Cannot cd to $target_dir"
+       exit 1
+}
+
+case $(uname -m) in
+       "x86_64")
+               x86_64
+
+               mv "./Geeqie-$VERSION-x86_64.AppImage" "$(./Geeqie-"$VERSION"-x86_64.AppImage -v | sed 's/git//' | sed 's/-.* /-/' | sed 's/ /-v/' | sed 's/-GTK3//')-x86_64.AppImage"
+               ;;
+
+       "aarch64")
+               aarch64
 
-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-aarch64.AppImage" "$(./Geeqie-aarch64.AppImage -v | sed 's/git//' | sed 's/-.* /-/' | sed 's/ /-v/' | sed 's/-GTK3//')-aarch64.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"
+       *)
+               printf "Architecture unknown"
+               ;;
+esac