forked from Authentura/codectrl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-build.sh
executable file
·63 lines (51 loc) · 1.83 KB
/
bootstrap-build.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
#!/usr/bin/env bash
source /etc/os-release
if [ $(id -u) -ne 0 ]; then
echo "Please run this script as root"
exit 1
fi
echo -e "\nInstalling dependencies for your distro...\n"
case $ID in
"debian" | "ubuntu" | "elementary")
apt update -y
apt install build-essential libfreetype-dev libfontconfig-dev cmake -y
;;
"fedora" | "rocky")
packages=(freetype-devel expat-devel fontconfig-devel cmake)
dnf="$(command -v dnf)"
$dnf update -y
if [ -f "$(command -v dnf5)" ]; then
dnf="$(command -v dnf5)"
sudo "$dnf" group install development-tools -y
else
$dnf groupinstall "Development Tools" -y
fi
if [[ ! "$ID" == "rocky" ]]; then
packages+=(g++)
fi
if [[ "$ID" == "rocky" && $(rpm -E %rhel) -ge 9 ]]; then
$dnf --enablerepo=crb --allowerasing install "${packages[@]}" -y
else
$dnf install "${packages[@]}" -y
fi
;;
"centos")
yum install epel-release -y
yum update -y
yum groupinstall "Development Tools" -y
yum install freetype-devel expat-devel fontconfig-devel cmake3 -y
ln -s /usr/bin/cmake3 /usr/bin/cmake
;;
"arch")
# TODO: Add Arch Linux packages
;;
*)
echo -e "Unknown distribution, please manually find and install the relevant packages for your distro.\n"
;;
esac
if [[ -z $(which rustup 2>/dev/null) ]]; then
echo "Installing rustup..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- --default-toolchain nightly -y
source $HOME/.cargo/env
fi
echo -e "\nIf you're inside a toolbox or distrobox, you need to install the necessary display drivers for your GPU *inside* the container otherwise you will run into OpenGL issues."