This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathSetup.sh
executable file
·56 lines (47 loc) · 1.55 KB
/
Setup.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
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if git rev-parse 4.13-UETorch > /dev/null 2>&1; then
if [ $(git rev-parse 4.13-UETorch^1) != $(git rev-parse 4.13) ]; then
echo "git branch 4.13-UETorch already exists and has your commits on it. If you really want to re-run setup, you'll need to clean up and delete this branch yourself."
exit 1
fi
git checkout 4.13
git branch -D 4.13-UETorch
fi
echo "=== Checking out the baseline UE4 commit... ==="
git checkout 4.13
echo "=== Patching UE4 ==="
cd $DIR/../../..
git branch 4.13-UETorch
git checkout 4.13-UETorch
git apply $DIR/UnrealEngine.patch
git add -u
git commit -m "UETorch patches"
echo "=== Setting up Lua... === "
### alternative approach: download lua-5.2.4
# cd $DIR/../ScriptPlugin/Source/Lua
# curl -R -O http://www.lua.org/ftp/lua-5.2.4.tar.gz
# tar zxf lua-5.2.4.tar.gz
# cd lua-5.2.4
# make CFLAGS='-fPIC -DLUA_USE_LINUX' linux test
# find Lua
LUA=`which lua`
echo "LUA= $LUA"
if [ $? != 0 ]; then
echo "Couldn't find Lua. Did you forget to install torch and run torch-activate?"
exit 1
fi
# check Lua version
LUA_VERSION=$($LUA -v | cut -c -7)
if [ "$LUA_VERSION" != "Lua 5.2" ]; then
echo "Expected Lua 5.2, but your Lua version is $LUA_VERSION, which is not supported."
exit 1
fi
TORCH_BIN=`dirname $LUA`
if [ ! -f "$TORCH_BIN/../include/lua.h" ]; then
echo "Couldn't find lua.h relative to lua. Did you forget to install torch and run torch-activate?"
exit 1
fi
cd $DIR/../ScriptPlugin/Source/Lua
ln -sfT $TORCH_BIN/.. install