forked from uotalkie/dol-kr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.sh
More file actions
executable file
·82 lines (74 loc) · 2.01 KB
/
compile.sh
File metadata and controls
executable file
·82 lines (74 loc) · 2.01 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
#!/usr/bin/env bash
output=/dev/stdout
#display an error message
function echoError() {
echo -e "\033[0;31m$*\033[0m"
}
#display message
function echoMessage() {
echo "$1" >"${output}"
}
function compile() {
export TWEEGO_PATH=devTools/tweego/storyFormats
if [ -z ${FORCE_VERSION+true} ]; then
VERSION="$(git describe --tags --always --dirty)"
else
VERSION="$FORCE_VERSION"
fi
if [ -z "${VERSION}" ]; then
TARGET="Degrees of Lewdity.html"
else
TARGET="Degrees of Lewdity $VERSION.html"
fi
TWEEGO_EXE="tweego"
if [ ! -f "$(command -v tweego)" ]; then
case "$(uname -m)" in
x86_64 | amd64)
echoMessage "x64 arch"
if [ "$(uname -s)" = "Darwin" ]; then
TWEEGO_EXE="./devTools/tweego/tweego_osx64"
elif [ "$OSTYPE" = "msys" ]; then
TWEEGO_EXE="./devTools/tweego/tweego_win64"
else
TWEEGO_EXE="./devTools/tweego/tweego_linux64"
fi
;;
x86 | i[3-6]86)
echoMessage "x86 arch"
if [ "$(uname -s)" = "Darwin" ]; then
TWEEGO_EXE="./devTools/tweego/tweego_osx86"
elif [ "$OSTYPE" = "msys" ]; then
TWEEGO_EXE="./devTools/tweego/tweego_win86"
else
TWEEGO_EXE="./devTools/tweego/tweego_linux86"
fi
;;
arm64)
echoMessage "arm64 arch"
if [ "$(uname -s)" = "Darwin" ]; then
TWEEGO_EXE="./devTools/tweego/tweego_m1" #for mac m1 and m2
#else
#not linux arm
fi
;;
*)
echoError "No system tweego binary found, and no precompiled binary for your platform available."
echoError "Please compile tweego and put the executable in PATH."
exit 2
;;
esac
fi
$TWEEGO_EXE "$@" -f sugarcube-2-ko -o "$TARGET" --head "devTools/head.html" --module "modules" game/ || build_failed="true"
if [ "$build_failed" = "true" ]; then
echoError "Build failed."
exit 1
else
if [ "$TARGET" != "Degrees of Lewdity.html" ]; then
# android builder expects to find a file by this name. this is a symbolic link, not a full copy
ln -fs "$TARGET" "Degrees of Lewdity.html";
fi
echo "Done: \"$TARGET\""
exit 0
fi
}
compile "$@"