-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.sh
105 lines (85 loc) · 2.18 KB
/
build.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
93
94
95
96
97
98
99
100
101
102
103
104
set -e
ROOTDIR="$(pwd)"
DISTDIR="$ROOTDIR/dist"
SRCDIR="$ROOTDIR/src"
DESTDIR="$ROOTDIR/export"
if [ -z "$PYTHON" ]; then
PYTHON=python3
fi
build_engine()
{
cd "$SRCDIR/engine"
#$PYTHON waf configure -T release --64bits --single-binary --prefix="$DESTDIR"
$PYTHON waf configure -T release --64bits --prefix="$DESTDIR"
$PYTHON waf build
$PYTHON waf install
}
build_hlsdk()
{
cd "$SRCDIR/hlsdk"
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-D64BIT=ON \
-DSERVER_INSTALL_DIR=valve \
-DCLIENT_INSTALL_DIR=valve \
-DGAMEDIR="$DESTDIR/lib/xash3d"
cmake --build build
cmake --build build --target install
}
build_opforsdk()
{
cd "$SRCDIR/opfor-sdk"
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-D64BIT=ON \
-DSERVER_INSTALL_DIR=gearbox \
-DCLIENT_INSTALL_DIR=gearbox \
-DGAMEDIR="$DESTDIR/lib/xash3d"
cmake --build build
cmake --build build --target install
}
build_hlextract()
{
cd "$SRCDIR/hlextract"
cmake -B build \
-DCMAKE_BUILD_TYPE=Release
cmake --build build
}
build_wiseunpacker()
{
cd "$SRCDIR/wiseunpacker"
make
}
prepare_system()
{
mkdir "$DESTDIR"
cp -r "$ROOTDIR/system/"* "$DESTDIR"
chmod +x "$DESTDIR/bin/hl"
chmod +x "$DESTDIR/bin/opfor"
}
extract_valve()
{
cd "$DISTDIR"
# Recombine after the
# split -b 100M steaminstall_halflife.exe steaminstall_halflife.exe.
echo "Combining steaminstall_halflife.exe"
cat steaminstall_halflife.exe.aa > steaminstall_halflife.exe
cat steaminstall_halflife.exe.ab >> steaminstall_halflife.exe
cat steaminstall_halflife.exe.ac >> steaminstall_halflife.exe
echo "Extracting public Half-Life installer"
mono "$SRCDIR/wiseunpacker/WiseUnpacker.exe" steaminstall_halflife.exe
mv steaminstall_halflife/MAINDIR\\SteamApps\\half-life.gcf half-life.gcf
rm -rf steaminstall_halflife
mkdir -p "$DESTDIR/share/xash3d"
cd "$DESTDIR/share/xash3d"
"$SRCDIR/hlextract/build/hlextract" -p "$DISTDIR/half-life.gcf" -e valve -d .
#"$SRCDIR/hlextract/build/hlextract" -p "$DISTDIR/opposing force.gcf" -e gearbox -d .
cp -r "$SRCDIR/overlays/valve/"* "valve"
}
prepare_system
build_hlextract
build_wiseunpacker
extract_valve
build_engine
build_hlsdk
build_opforsdk