From e31243440a4bdf89bdac8c5f7dfe447c053a91d9 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sat, 1 Jan 2022 15:59:52 +0000 Subject: [PATCH] Use linuxdeploy GTK plugin - Include the GTK plugin in the linuxdeploy call - Update the README with the new requirements - Eliminate the problems shown by lint in both files --- appimages/README.md | 22 ++++++++++++++++++---- scripts/generate-appimage.sh | 15 +++++++-------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/appimages/README.md b/appimages/README.md index 04200d56..984f70b4 100644 --- a/appimages/README.md +++ b/appimages/README.md @@ -1,13 +1,19 @@ # How to create AppImages for Geeqie -## Download the required tools: +## Download the required tools + +Download the `linuxdeploy` tools. At the time of writing, these are: -Download the `linuxdeploy` tool. At the time of writing, this is: ```sh -wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +wget -c https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +chmod +x linuxdeploy-x86_64.AppImage +wget -c https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh +chmod +x linuxdeploy-plugin-gtk.sh +sudo apt install patchelf +sudo apt install librsvg2-dev ``` -Move this file to `$HOME/bin` or somewhere else in your `$PATH` and make executable. +The first two of these files must be in your `$PATH` environment variable. ## Generate the executable @@ -16,23 +22,27 @@ cd ``` Download Geeqie sources: + ```sh git clone git://www.geeqie.org/geeqie.git cd geeqie ``` If a run has already been made, remove any existing targets: + ```sh rm -r /AppDir sudo rm -rf doc/html ``` Create a fresh target directory: + ```sh mkdir /AppDir ``` Generate the Geeqie executable: + ```sh sudo make maintainer-clean ./autogen.sh --prefix="/usr/" @@ -48,14 +58,18 @@ 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` ``` ## Rename AppImage + If required, rename the AppImage executable - e.g.: + ```sh mv ./Geeqie-v1.6-x86_64.AppImage $(./Geeqie-v1.6-x86_64.AppImage -v | sed 's/git//' | sed 's/-.* /-/' | sed 's/ /-v/' | sed 's/-GTK3//').AppImage ``` ## Automation script + The script `./scripts/generate-appimage.sh` automates this process. diff --git a/scripts/generate-appimage.sh b/scripts/generate-appimage.sh index 43bc2f70..f5df698c 100755 --- a/scripts/generate-appimage.sh +++ b/scripts/generate-appimage.sh @@ -27,23 +27,20 @@ ## 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" -- 2.20.1