Use linuxdeploy GTK plugin
authorColin Clark <colin.clark@cclark.uk>
Sat, 1 Jan 2022 15:59:52 +0000 (15:59 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sat, 1 Jan 2022 15:59:52 +0000 (15:59 +0000)
- 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
scripts/generate-appimage.sh

index 04200d5..984f70b 100644 (file)
@@ -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 <your working area>
 ```
 
 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  <target dir>/AppDir
 sudo rm -rf doc/html
 ```
 
 Create a fresh target directory:
+
 ```sh
 mkdir <target dir>/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.
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"