-
Notifications
You must be signed in to change notification settings - Fork 32
/
make-oneshot-linux.sh
executable file
·77 lines (64 loc) · 2.31 KB
/
make-oneshot-linux.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
#!/bin/sh
set -e
cd `dirname $0`
# User-configurable variables.
linux_version="0.1.0"
make_threads=8
oneshot_id=420530
ONESHOT_PATH=$HOME/.local/share/Steam/steamapps/common/OneShot
STEAMWORKS_PATH=$(realpath ..)/steamworks
# Colors.
white="\033[0;37m" # White - Regular
bold="\033[1;37m" # White - Bold
cyan="\033[1;36m" # Cyan - Bold
green="\033[1;32m" # Green - Bold
color_reset="\033[0m" # Reset Colors
echo -e "${white}Compiling ${bold}SyngleChance v${linux_version} ${white}engine for Linux...${color_reset}\n"
# Generate makefile.
echo -e "-> ${cyan}Generate makefile...${color_reset}"
export MRIVERSION=$(echo "puts RUBY_VERSION.split('.').slice(0, 2).join('.')" | ruby)
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
qmake mkxp.pro > oneshot.qmake.out
# Compile OneShot.
echo -e "-> ${cyan}Compile engine...${color_reset}"
make -j${make_threads} > oneshot.make.out
# Compile steamshim.
echo -e "-> ${cyan}Compile steamshim...${color_reset}"
cd steamshim_parent
mkdir build
cd build
cmake -DSTEAMWORKS_PATH=${STEAMWORKS_PATH} .. > steamshim.cmake.out
cp "$STEAMWORKS_PATH/redistributable_bin/linux64/libsteam_api.so" .
make -j${make_threads} > steamshim.make.out
cd ../..
# Compile Journal.
echo -e "-> ${cyan}Compile journal...${color_reset}"
pyinstaller journal/unix/journal.spec --windowed
# Compile scripts.
echo -e "-> ${cyan}Compile xScripts.rxdata...${color_reset}"
ruby rpgscript.rb ./scripts "$ONESHOT_PATH" > rpgscript.out
# Copy results.
echo -e "-> ${cyan}Install OneShot apps to Steam directory...${color_reset}"
yes | cp -r dist/_______/* "$ONESHOT_PATH"
yes | cp oneshot "$ONESHOT_PATH"
yes | cp steamshim_parent/build/steamshim "$ONESHOT_PATH"
echo "$oneshot_id" > "$ONESHOT_PATH/steam_appid.txt"
# Copy libraries.
echo -e "-> ${cyan}Install OneShot libraries to Steam directory...${color_reset}"
mkdir libs
ldd oneshot | ruby libraries.rb
ldd steamshim_parent/build/steamshim | ruby libraries.rb
yes | cp libs/* "$ONESHOT_PATH"
# Cleanup.
echo -e "-> ${cyan}Cleanup files...${color_reset}"
rm -rf journal/unix/__pycache__
rm -rf build
rm -rf dist
rm -rf steamshim_parent/build
rm -rf libs
make clean > clean.out
rm -f *.out
rm Makefile
rm oneshot
rm .qmake.stash
echo -e "\n${green}Complete! ${white}Please report any issues to https://github.com/GooborgStudios/synglechance/issues${color_reset}"