-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcreate_linux_appimage.sh
More file actions
executable file
·112 lines (88 loc) · 3.28 KB
/
Copy pathcreate_linux_appimage.sh
File metadata and controls
executable file
·112 lines (88 loc) · 3.28 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# //////////////////////////////////////////////////
# // //
# // Emu64 //
# // von Thorsten Kattanek //
# // //
# // #file: create_linux_appimage.sh //
# // //
# // Dieser Sourcecode ist Copyright geschützt! //
# // Geistiges Eigentum von Th.Kattanek //
# // //
# // www.emu64-projekt.de //
# // //
# //////////////////////////////////////////////////
#!/bin/bash
set -euo pipefail
usage() {
echo "Usage: $0 --qt <QT_ROOT>" >&2
echo " Beispiel: $0 --qt \"/usr/lib/qt6\"" >&2
echo " oder: QT_ROOT=\"$HOME/Qt/6.6.2/gcc_64\" $0" >&2
}
QT_ROOT="${QT_ROOT:-}"
# --qt <path> aus Argumenten lesen (optional)
if [[ ${1:-} == "--qt" ]]; then
QT_ROOT="${2:-}"
shift 2 || true
elif [[ ${1:-} == "-h" || ${1:-} == "--help" ]]; then
usage
exit 0
fi
if [[ -z "$QT_ROOT" ]]; then
echo "WARNUNG: Kein QT_ROOT angegeben." >&2
usage
exit 1
fi
# Validierung
if [[ ! -d "$QT_ROOT/bin" ]]; then
echo "WARNUNG: Ungültiger QT_ROOT (bin fehlt): $QT_ROOT" >&2
exit 1
fi
if [[ ! -x "$QT_ROOT/bin/qmake" && ! -x "$QT_ROOT/bin/qt-cmake" ]]; then
echo "WARNUNG: Kein qmake/qt-cmake in $QT_ROOT/bin gefunden: $QT_ROOT" >&2
exit 1
fi
# Qt nur für dieses Skript aktivieren
export PATH="$QT_ROOT/bin:$PATH"
export CMAKE_PREFIX_PATH="$QT_ROOT${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}"
# Version
ARCH=x86_64
VERSION=$(git describe --always --tags)
# check and create a appimage dir
if [ ! -d ./appimage ]; then
mkdir ./appimage;
else
rm -rf ./appimage/AppDir
fi
cd appimage
MYDIR="`cd $0; pwd`"
echo "MYDIR is: " $MYDIR
mkdir build
cd build
qmake ../.. APPIMAGE_PATH="$MYDIR/AppDir"
make -j24
make install
cd ..
rm -rf build
cp ../src/AppRun ./AppDir
cp ../src/emu64.desktop ./AppDir
cp ../grafik/emu64.png ./AppDir
# linuxdeploy
if [ ! -f ./linuxdeploy-x86_64.AppImage ]; then
wget "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod u+x ./linuxdeploy-x86_64.AppImage
fi
# linuxdeploy qt plugin
if [ ! -f ./linuxdeploy-plugin-qt-x86_64.AppImage ]; then
wget "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
chmod u+x ./linuxdeploy-plugin-qt-x86_64.AppImage
fi
# ohne Qt
# ARCH=$ARCH VERSION=$VERSION ./linuxdeploy-x86_64.AppImage --appdir ./AppDir --output appimage
# mit libc im appimage
# ARCH=$ARCH VERSION=$VERSION ./linuxdeploy-x86_64.AppImage --appdir ./AppDir -l /lib/x86_64-linux-gnu/libc.so.6 -l /lib/x86_64-linux-gnu/libm.so.6 -l /lib/x86_64-linux-gnu/libstdc++.so.6 -l /lib/x86_64-linux-gnu/libgcc_s.so.1 --plugin qt --output appimage
ARCH=$ARCH VERSION=$VERSION ./linuxdeploy-x86_64.AppImage --appdir ./AppDir --plugin qt --output appimage
rm -rf AppDir
tar -cvzf emu64_"$VERSION"_linux_appimage_"$ARCH".tar.gz Emu64-"$VERSION"-"$ARCH".AppImage
rm Emu64-"$VERSION"-"$ARCH".AppImage
# SHA512 Hashwert erzeugen
sha512sum -b emu64_"$VERSION"_linux_appimage_"$ARCH".tar.gz >> emu64_"$VERSION"_linux_appimage_"$ARCH".tar.gz.sha512