mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-11-21 12:26:00 +03:00
Added AppImage building script
This commit is contained in:
parent
9ff00c7085
commit
3e413064da
6 changed files with 79 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,3 +1,6 @@
|
|||
/target
|
||||
/assets/ui/.dist
|
||||
Cargo.lock
|
||||
|
||||
/scripts/appimage/dist
|
||||
/scripts/appimage/*.AppImage
|
||||
|
|
|
@ -32,3 +32,10 @@ cargo run
|
|||
```sh
|
||||
cargo build --release
|
||||
```
|
||||
|
||||
### Building AppImage
|
||||
|
||||
```
|
||||
cd scripts/appimage
|
||||
./build_appimage.sh
|
||||
```
|
||||
|
|
7
scripts/appimage/anime-game-launcher.desktop
Normal file
7
scripts/appimage/anime-game-launcher.desktop
Normal file
|
@ -0,0 +1,7 @@
|
|||
[Desktop Entry]
|
||||
Name=An Anime Game Launcher
|
||||
Icon=icon
|
||||
Exec=AppRun
|
||||
Type=Application
|
||||
Categories=Game
|
||||
Terminal=false
|
41
scripts/appimage/build_appimage.sh
Executable file
41
scripts/appimage/build_appimage.sh
Executable 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
BIN
scripts/appimage/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 274 KiB |
21
scripts/appimage/run.sh
Normal file
21
scripts/appimage/run.sh
Normal 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" $@
|
Loading…
Reference in a new issue