-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·158 lines (129 loc) · 3.73 KB
/
run.sh
File metadata and controls
executable file
·158 lines (129 loc) · 3.73 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#/bin/bash
# Check OS
# Red HAT
if [[ -d "/etc/dnf" ]] && [[ -f "/usr/bin/dnf" ]]; then
USER_DISTRO="RED_HAT"
fi
cat /etc/os-release | grep -i "redhat" > /dev/null;
if [[ "$?" -eq 0 ]]; then
USER_DISTRO="RED_HAT";
fi
# Debian
if [[ -d "/etc/apt" ]] && [[ -f "/usr/bin/apt" ]]; then
USER_DISTRO="Debian"
fi
cat /etc/os-release | grep -i "debian" > /dev/null;
if [[ "$?" -eq 0 ]]; then
USER_DISTRO="Debian";
fi
# Arch
if [[ -f "/usr/bin/pacman" ]]; then
USER_DISTRO="Arch"
fi
cat /etc/os-release | grep -i "arch" > /dev/null;
if [[ "$?" -eq 0 ]]; then
USER_DISTRO="Arch";
fi
echo "Distro based on : $USER_DISTRO";
case "$USER_DISTRO" in
RED_HAT)
# Verif G++
if [[ -f "/usr/bin/g++" ]]
then
echo "Compiler G++ installed";
else
echo "G++ not installed";
sudo dnf install g++ -y;
fi
# Verif CMake
rpm --query cmake > /dev/null;
if [[ "$?" -eq 0 ]]
then
echo "CMake installed"
else
echo "CMake not installed"
sudo dnf install cmake -y
fi
# Verif conan
if [[ -f "/usr/bin/conan" ]]
then
echo "Package manager conan installed";
else
echo "conan not installed";
sudo dnf install conan;
fi
# Install christfetch
conan profile detect --force;
conan install . --output-folder=build --build=missing;
cd build;
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release;
cmake --build .
;;
Debian)
# Verif G++
if [[ -f "/usr/bin/g++" ]]
then
echo "Compiler G++ installed";
else
echo "G++ not installed";
sudo apt install g++ -y;
fi
# Verif CMake
apt show cmake 2> /dev/null | grep -i "APT-Manual-Installed: yes" > /dev/null
if [[ "$?" -eq 0 ]]
then
echo "CMake installed"
else
echo "CMake not installed"
sudo apt install cmake -y
fi
# Verif conan
if [[ -f "/usr/bin/conan" ]]
then
echo "Packet manager conan installed";
else
echo "conan not installed";
wget https://github.com/conan-io/conan/releases/download/2.14.0/conan-2.14.0-amd64.deb && sudo dpkg -i conan-2.14.0-amd64.deb && rm conan-2.14.0-amd64.deb;
fi
# Install christfetch
conan profile detect --force;
conan install . --output-folder=build --build=missing;
cd build;
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release;
cmake --build .;
;;
Arch)
# Verif G++
if [[ -f "/usr/bin/g++" ]]
then
echo "Compiler G++ installed";
else
echo "G++ not installed";
sudo pacman -Syu g++ -y;
fi
# Verif Fastfetch
pacman -Q cmake > /dev/null
if [[ "$?" -eq 0 ]]
then
echo "Cmake installed"
else
echo "Cmake not installed"
sudo pacman -Syu cmake;
fi
# Verif G++
if [[ -f "/usr/bin/conan" ]]
then
echo "Packet manager conan installed";
else
echo "Conan not installed";
git clone https://github.com/conan-io/conan && cd conan && sudo python3 setup.py install;
cd ..;
fi
# Install Conan
conan profile detect --force
# Install christfetch
conan install . --output-folder=build --build=missing;
cd build;
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release;
cmake --build .;
esac