-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·54 lines (46 loc) · 1.68 KB
/
bootstrap.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
#!/bin/bash
# Get super user privileges
if [[ $EUID != 0 ]]; then
sudo -E "$0" "$@"
fi
if [[ $EUID == 0 ]]; then
apt update
apt install --no-install-recommends -y \
git build-essential wget python-pip curl autoconf automake libtool unzip pkg-config ca-certificates nasm
invalid_cmake_version=false
if command -v cmake > /dev/null ; then
cmake_version=`cmake --version | grep -o -E "([0-9]{1,}\.)+[0-9]{1,}"`
cmake_version=(`echo $cmake_version | tr . ' '`)
if [ ${cmake_version[1]} -lt 10 ]; then
echo "|>>| cmake 3.10+ required"
invalid_cmake_version=true
fi;
fi
if [[ -z `command -v cmake` ]] || [[ $invalid_cmake_version == true ]]; then
echo "|>>| installing cmake...";
wget https://cmake.org/files/v3.11/cmake-3.11.1-Linux-x86_64.sh
mkdir -p /opt/cmake
sh cmake-3.11.1-Linux-x86_64.sh --skip-license --prefix=/opt/cmake
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
rm cmake-3.11.1-Linux-x86_64.sh
fi
if ! command -v ninja > /dev/null; then
echo "|>>| installing ninja...";
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
unzip ninja-linux.zip
rm ninja-linux.zip
mv -u ninja /usr/bin
fi
echo "|>>| Installing and upgrading conan...";
pip install conan conan_package_tools --upgrade
fi
if [[ $EUID != 0 ]]; then
if ! conan remote list | grep -q "is:"; then
echo "|>>| Adding 'is' remote";
conan remote add is https://api.bintray.com/conan/labviros/is
fi
if ! conan remote list | grep -q "bincrafters:"; then
echo "|>>| Adding 'bincrafters' remote";
conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
fi
fi