Added AppImage building script

This commit is contained in:
Observer KRypt0n_ 2022-07-28 20:17:58 +02:00
parent 9ff00c7085
commit 3e413064da
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
6 changed files with 79 additions and 0 deletions

3
.gitignore vendored
View file

@ -1,3 +1,6 @@
/target /target
/assets/ui/.dist /assets/ui/.dist
Cargo.lock Cargo.lock
/scripts/appimage/dist
/scripts/appimage/*.AppImage

View file

@ -32,3 +32,10 @@ cargo run
```sh ```sh
cargo build --release cargo build --release
``` ```
### Building AppImage
```
cd scripts/appimage
./build_appimage.sh
```

View file

@ -0,0 +1,7 @@
[Desktop Entry]
Name=An Anime Game Launcher
Icon=icon
Exec=AppRun
Type=Application
Categories=Game
Terminal=false

View file

@ -0,0 +1,41 @@
#!/bin/bash
linuxdeploy="linuxdeploy-x86_64.AppImage"
appimagetool="appimagetool-x86_64.AppImage"
version="0.3.1"
if [ ! -f $linuxdeploy ];
then
echo "Downloading LinuxDeploy..."
curl -s -L -o $linuxdeploy https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x $linuxdeploy
fi
if [ ! -f $appimagetool ];
then
echo "Downloading AppImageTool..."
curl -s -L -o $appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x $appimagetool
fi
if [ -d dist ];
then
rm -rf dist
fi
mkdir dist
cp "../../target/release/anime-game-launcher" "dist/anime-game-launcher"
echo "Executing LinuxDeploy..."
./$linuxdeploy --appdir dist -d anime-game-launcher.desktop --custom-apprun run.sh -i icon.png -o appimage
echo "Executing AppImageTool..."
VERSION=$version ./$appimagetool dist

BIN
scripts/appimage/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

21
scripts/appimage/run.sh Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
if [ -z "$APPDIR" ] ; then
path="$(dirname "$(readlink -f "${THIS}")")"
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
APPDIR="$path"
fi
export PATH="${APPDIR}:${APPDIR}/usr/sbin:${PATH}"
export XDG_DATA_DIRS="./share/:/usr/share/gnome:/usr/local/share/:/usr/share/:${XDG_DATA_DIRS}"
export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
export XDG_DATA_DIRS="${APPDIR}"/usr/share/:"${XDG_DATA_DIRS}":/usr/share/gnome/:/usr/local/share/:/usr/share/
export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"
cd "$APPDIR"
exec "$APPDIR/anime-game-launcher" $@