-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·137 lines (117 loc) · 2.73 KB
/
install.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
# $1 = -y
# $2 = installation path from root
# $3 = silent mode (true/false)
confirm=$1
if [ "$2" == "" ]; then
path2out="toolchain"
else
path2out=$2
fi
silent=$3
source ~/.bashrc
project="shut"
log="install_$project.log"
red='\033[1;31m'
green='\033[1;32m'
yellow='\033[1;33m'
reset='\033[0m' # No Color
gcc_min_version="7.3.0"
cmake_min_version="3.12.1"
echo -e "${yellow}Installing $project dependecies:${reset}"
echo " - (Conda) Python3"
source ./bash/install_python.sh
echo " - g++ (> $gcc_min_version)"
source ./bash/install_g++.sh
echo " - make"
source ./bash/install_make.sh
echo " - cmake (> $cmake_min_version)"
source ./bash/install_cmake.sh
echo " - ninja-build"
source ./bash/install_7zip.sh
source ./bash/install_ninja.sh
echo -e "Installation path : ${green}${path2out}${reset}"
pushd $HOME > /dev/null
mkdir -p $path2out
cd $path2out
echo "Looking for packages..."
# clean old log file
rm -f $log
echo "Installing Python3"
if [ $silent ]; then
install_python true $confirm >> $log
else
install_python true $confirm
fi
source ~/.bashrc
echo "Installing g++"
if [ $silent ]; then
install_g++ true $confirm true >> $log
else
install_g++ true $confirm true
fi
source ~/.bashrc
#### TOO SLOW FOR CI
#if [ ! -z $(which g++) ]; then
# gcc_ver=$(echo $(g++ --version) | cut -d' ' -f 4)
# gcc_ver=$(echo "${gcc_ver//./}")
# gcc_min_version=$(echo "${gcc_min_version//./}")
# if [ $gcc_ver -lt $gcc_min_version ]; then
# if [ $silent ]; then
# install_g++ true $confirm false >> $log
# else
# install_g++ true $confirm false
# fi
# fi
# source ~/.bashrc
#fi
echo "Installing Make"
if [ $silent ]; then
install_make true $confirm >> $log
else
install_make true $confirm
fi
source ~/.bashrc
echo "Installing CMake"
if [ $silent ]; then
install_cmake true $confirm true >> $log
else
install_cmake true $confirm true
fi
source ~/.bashrc
if [ ! -z $(which cmake) ]; then
cmake_ver=$(echo $(cmake --version) | cut -d' ' -f 3)
cmake_ver=$(echo "${cmake_ver//./}")
cmake_min_version=$(echo "${cmake_min_version//./}")
if [ $cmake_ver -lt $cmake_min_version ]; then
if [ $silent ]; then
install_cmake true $confirm false >> $log
else
install_cmake true $confirm false
fi
fi
source ~/.bashrc
fi
echo "Installing 7zip"
if [ $silent ]; then
install_7zip true $confirm >> $log
else
install_7zip true $confirm
fi
source ~/.bashrc
echo "Installing ninja-build"
if [ $silent ]; then
install_ninja true $confirm >> $log
else
install_ninja true $confirm
fi
source ~/.bashrc
popd > /dev/null
echo -e "${green}Build prerequisites [done]${reset}"
# Build project
#echo -e "${yellow}Build ${project}${reset}""
#if [ $silent ]; then
# sh ./build.sh >> $log
#else
# sh ./build.sh
#fi