-
Notifications
You must be signed in to change notification settings - Fork 2
/
installer.sh
executable file
·122 lines (108 loc) · 2.54 KB
/
installer.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash -e
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) MACHINE=Linux;;
Darwin*) MACHINE=Mac;;
CYGWIN*) MACHINE=Cygwin;;
MINGW*) MACHINE=MinGw;;
*) MACHINE="UNKNOWN:${unameOut}"
esac
echo Machine identified as $MACHINE
if [ $MACHINE = Linux ]; then
USER=`whoami`
if [ $USER = "root" ]
then
echo "Running as ROOT"
else
echo "***********YOU ARE NOT ROOT************"
exit 1
fi
fi
DIR=`pwd`
function finish {
echo "Cleaning up..."
rm $DIR/pkgconfig.tgz || true
rm $DIR/SDL2-2.0.3.tar.gz || true
rm $DIR/freetype-2.8.tar.gz || true
rm $DIR/SDL2_ttf-2.0.12.tar.gz || true
rm $DIR/SDL2_image-2.0.0.tar.gz || true
rm $DIR/SDL2_mixer-2.0.0.tar.gz || true
rm -rf $DIR/pkg-config-0.28 || true
rm -rf $DIR/SDL2_image-2.0.0 || true
rm -rf $DIR/freetype-2.8 || true
rm -rf $DIR/SDL2_ttf-2.0.12 || true
rm -rf $DIR/SDL2-2.0.3 || true
rm -rf $DIR/SDL2_mixer-2.0.0 || true
rm -rf $DIR/glog || true
rm -rf $DIR/yaml-cpp || true
}
trap finish EXIT
#pkg-config
if [ $MACHINE = Mac ]; then
curl https://pkg-config.freedesktop.org/releases/pkg-config-0.28.tar.gz -o pkgconfig.tgz
tar -zxf pkgconfig.tgz && cd pkg-config-0.28
./configure --with-internal-glib && make install
fi
#SDL2.0
wget https://www.libsdl.org/release/SDL2-2.0.3.tar.gz
tar xzf SDL2-2.0.3.tar.gz
cd SDL2-2.0.3
./configure
make -j4
make install -j4
cd $DIR
#SDL2_ttf
wget -O freetype-2.8.tar.gz https://sourceforge.net/projects/freetype/files/freetype2/2.8/freetype-2.8.tar.gz/download
tar xzf freetype-2.8.tar.gz
cd freetype-2.8
./configure
make -j4
make install -j4
cd $DIR
wget https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.12.tar.gz
tar xzf SDL2_ttf-2.0.12.tar.gz
cd SDL2_ttf-2.0.12
./configure
make -j4
make install -j4
cd $DIR
#SDL2_image
wget https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.0.tar.gz
tar xzf SDL2_image-2.0.0.tar.gz
cd SDL2_image-2.0.0
./configure
make -j4
make install -j4
cd $DIR
#SDL2_mixer
wget https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.0.tar.gz
tar xzf SDL2_mixer-2.0.0.tar.gz
cd SDL2_mixer-2.0.0
#SMPEG
cd external/smpeg2-2.0.0
./configure
make -j4
make install -j4
cd ../../
./configure
make -j4
make install -j4
cd $DIR
# glog
git clone https://github.com/google/glog.git
cd glog
mkdir build
cd build
cmake ..
make -j4
make install -j4
cd $DIR
# yaml-cpp
git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
mkdir build
cd build
cmake ..
make -j4
make install -j4
cd $DIR