-
Notifications
You must be signed in to change notification settings - Fork 11
/
build-appimage.sh
executable file
·92 lines (76 loc) · 3.77 KB
/
build-appimage.sh
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
#/bin/sh
# get source code
# git clone https://github.com/tx00100xt/SeriousSamClassic.git
# cd SeriousSamClassic
rm -fr build
rm -fr build-xplus
# get linuxdeploy-x86_64.AppImage
wget -nv -c https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
# get croteam gro
wget -nv -c https://raw.githubusercontent.com/tx00100xt/serioussam-mods/main/gro/SE1_10.gro
# apply appimage patches
patch -p1 < appimage/patches/0001-AppImage-CMakeLists.txt.patch
patch -p1 < appimage/patches/0002-AppImage-Engine.cpp.patch
patch -p1 < appimage/patches/0003-AppImage-Engine.h.patch
patch -p1 < appimage/patches/0004-AppImage-Stream.patch
patch -p1 < appimage/patches/0005-AppImage-Menu.cpp.patch
patch -p1 < appimage/patches/0006-SeriousSam.cpp.patch
patch -p1 < appimage/patches/0007-Gfx_Vulkan.cpp.patch
patch -p1 < appimage/patches/0008-AppImage-Adapter.cpp.patch
# build game
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..
make -j4
make install DESTDIR=AppDir
cd ..
# build xplus
mkdir build-xplus && cd build-xplus
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DXPLUS=TRUE ..
make -j4
make install DESTDIR=AppDir
cd ..
# copy compiled stuff to main dir
cp -ax build/AppDir AppDir
cp -ax build-xplus/AppDir/usr/* AppDir/usr
# copy SE1_10.gro
cp -fr SE1_10.gro AppDir/usr/share/serioussam
# copy TFE metainfo and desktop files
mkdir AppDir/usr/share/metainfo
cp -fr appimage/serioussam/io.itch.tx00100xt.serioussam-vk.desktop AppDir/usr/share/applications
cp -fr appimage/serioussam/io.itch.tx00100xt.serioussam-vk.appdata.xml AppDir/usr/share/metainfo
# remove unused stuff
rm -fr AppDir/usr/bin/{serioussamse,serioussamse-ded,serioussamse-mkfont,serioussamse-texconv}
rm -fr AppDir/usr/bin/{serioussam-ded,serioussam-mkfont,serioussam-texconv}
rm -fr AppDir/usr/lib/{serioussamse,libEngineMP.so}
rm -fr AppDir/usr/share/applications/serioussam.desktop
rm -fr AppDir/usr/share/applications/serioussamse.desktop
rm -fr AppDir/usr/share/serioussamse
# create appimage for TFE
export LD_LIBRARY_PATH=AppDir/usr/lib
SIGN=1 ./linuxdeploy-x86_64.AppImage --executable AppDir/usr/bin/serioussam --desktop-file AppDir/usr/share/applications/io.itch.tx00100xt.serioussam-vk.desktop --icon-file AppDir/usr/share/icons/hicolor/128x128/apps/serioussam.png --appdir AppDir --output appimage
# copr compiled stuff to main dir
mv AppDir AppDirTFE
cp -ax build/AppDir AppDir
cp -ax build-xplus/AppDir/usr/* AppDir/usr
# copy SE1_10.gro
cp -fr SE1_10.gro AppDir/usr/share/serioussamse
# copy TSE metainfo and desktop files
mkdir AppDir/usr/share/metainfo
cp -fr appimage/serioussamse/io.itch.tx00100xt.serioussamse-vk.desktop AppDir/usr/share/applications
cp -fr appimage/serioussamse/io.itch.tx00100xt.serioussamse-vk.appdata.xml AppDir/usr/share/metainfo
# remove unused stuff
rm -fr AppDir/usr/bin/{serioussam,serioussam-ded,serioussam-mkfont,serioussam-texconv}
rm -fr AppDir/usr/bin/{serioussamse-ded,serioussamse-mkfont,serioussamse-texconv}
rm -fr AppDir/usr/lib/{serioussam,libEngine.so}
rm -fr AppDir/usr/share/applications/serioussam.desktop
rm -fr AppDir/usr/share/applications/serioussamse.desktop
rm -fr AppDir/usr/share/serioussam
# create appimage for TSE
export LD_LIBRARY_PATH=AppDir/usr/lib
SIGN=1 ./linuxdeploy-x86_64.AppImage --executable AppDir/usr/bin/serioussamse --desktop-file AppDir/usr/share/applications/io.itch.tx00100xt.serioussamse-vk.desktop --icon-file AppDir/usr/share/icons/hicolor/128x128/apps/serioussam.png --appdir AppDir --output appimage
# rename appimages
mv Serious_Sam_The_First_Encounter-x86_64.AppImage SeriousSamTFE-Vk-1.10.6d-x86_64.AppImage
chmod +x SeriousSamTFE-Vk-1.10.6d-x86_64.AppImage
mv Serious_Sam_The_Second_Encounter-x86_64.AppImage SeriousSamTSE-Vk-1.10.6d-x86_64.AppImage
chmod +x SeriousSamTSE-Vk-1.10.6d-x86_64.AppImage