# 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
```
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/"
--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.
## 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
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"