Repository navigation
Expand file tree
/
Copy pathapplyFixesAndOverride.sh
More file actions
executable file
·44 lines (32 loc) · 1.95 KB
/
Copy pathapplyFixesAndOverride.sh
File metadata and controls
executable file
·44 lines (32 loc) · 1.95 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
#!/bin/bash
SED=sed
if [[ "$(uname -s)" = "Darwin" ]]; then SED=gsed; fi
pushd .
cd "$(dirname "${0}")/..";
#Fix winsock letter case (For cross-compiling client for Windows on Linux)
$SED -i 's/<Winsock.h>/<winsock.h>/' minorGems/network/win32/SocketClientWin32.cpp;
$SED -i 's/<Winsock.h>/<winsock.h>/' minorGems/network/win32/SocketServerWin32.cpp;
#Obsolete values.h is replaced by float.h (For cross-compiling server for Windows on Linux)
$SED -i 's/<values.h>/<float.h>/' OneLife/server/map.cpp;
#Fix winsock letter case (For cross-compiling server for Windows on Linux)
$SED -i 's/<Winsock.h>/<winsock.h>/' minorGems/network/unix/SocketPollUnix.cpp;
popd
cd override && rsync -vr . ../..
cd ..
#Make sure it has Unix EOL
find ../OneLife -type f \( -name 'configure' \) -exec $SED -i 's/\r//g' {} +
find ../OneLife -type f \( -name '*.sh' \) -exec $SED -i 's/\r//g' {} +
find ../OneLife -type f \( -name 'Makefile*' \) -exec $SED -i 's/\r//g' {} +
#libpng depends on zlib, the order of linking flag matters
$SED -i 's/PLATFORM_LIBPNG_FLAG = -lz -lpng/PLATFORM_LIBPNG_FLAG = -lpng -lz/' ../minorGems/game/platforms/SDL/Makefile.MinGWCross
#Fix to make SDL statically linked
$SED -i '/ -static `sdl-config --static-libs`$/! s/^PLATFORM_LIBPNG_FLAG .*$/& -static `sdl-config --static-libs`/' ../minorGems/game/platforms/SDL/Makefile.MinGWCross
#New versions of imagemagick flips images after conversion
im_version=`convert -list configure | $SED '/^LIB_VERSION_NUMBER */!d; s//,/; s/,/,0/g; s/,0*\([0-9][0-9]\)/\1/g' | head -n 1`
if [ "$im_version" -ge "06091075" ]; then
$SED -i 's/convert $< -type truecolormatte $@/convert -auto-orient $< -type truecolormatte $@/' ../minorGems/game/platforms/SDL/Makefile.all
fi
# fix include windows.h letter case in discord_sdk (For cross-compiling client for Windows on Linux)
if [ -f ../dependencies/discord_game_sdk/c/discord_game_sdk.h ]; then
$SED -i 's/<Windows.h>/<windows.h>/' ../dependencies/discord_game_sdk/c/discord_game_sdk.h;
fi