forked from setghm/space-invaders
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport-linux.sh
More file actions
executable file
·67 lines (45 loc) · 1.49 KB
/
export-linux.sh
File metadata and controls
executable file
·67 lines (45 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
#
# This file generates an AppImage file for Linux.
#
APPNAME=SpaceInvaders
LINUXDEPLOY=/opt/linuxdeploy
APPIMAGETOOL=/opt/appimagetool
# Clean previous build.
rm -rf installed dist cmake-build-release
mkdir dist
mkdir installed
mkdir cmake-build-release
# Compile.
cmake -S . -B cmake-build-release \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang
# Uncomment this to debug the AppImage file:
#cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS='-DBUILD_APPIMAGE'
cmake --build cmake-build-release
cmake --install cmake-build-release
# Create AppDir.
APPDIR=installed/$APPNAME.AppDir
mkdir $APPDIR
# Copy resources into AppDir.
RESDIR=res/linux
ICONSDIR=$APPDIR/usr/share/icons/hicolor
mkdir -p $ICONSDIR
mkdir -p $APPDIR/usr/share/applications
mkdir -p $APPDIR/usr/bin
cp -r installed/assets $APPDIR/usr/share
cp installed/$APPNAME $APPDIR/usr/bin/$APPNAME
ln -s usr/bin/$APPNAME $APPDIR/AppRun
cp $RESDIR/$APPNAME.desktop $APPDIR/usr/share/applications
ln -s usr/share/applications/$APPNAME.desktop $APPDIR/$APPNAME.desktop
cp $RESDIR/icon256.png $APPDIR/$APPNAME.png
for size in 256 128 64 32 16; do
mkdir -p $ICONSDIR/${size}x${size}/apps
cp $RESDIR/icon${size}.png $ICONSDIR/${size}x${size}/apps/$APPNAME.png
done
# Get dependencies with linux deploy.
$LINUXDEPLOY --appdir $APPDIR \
--desktop-file $APPDIR/$APPNAME.desktop \
--icon-file $APPDIR/$APPNAME.png
# Create AppImage file.
$APPIMAGETOOL $APPDIR dist/$APPNAME.AppImage