From 42dde6f6a792c4194c649d2d85d0723b93e62b34 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sun, 16 Oct 2022 09:52:35 +0100 Subject: [PATCH] Include arm64 AppImages --- README.md | 2 +- scripts/generate-appimage.sh | 59 ++++++++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cf1f6a15..d7ef84e8 100644 --- 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. diff --git a/scripts/generate-appimage.sh b/scripts/generate-appimage.sh index bfb47828..f34b8038 100755 --- a/scripts/generate-appimage.sh +++ b/scripts/generate-appimage.sh @@ -27,13 +27,37 @@ ## 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 -- 2.20.1