forked from UBC-Thunderbots/Software
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_software_mac.sh
More file actions
executable file
·90 lines (70 loc) · 2.69 KB
/
setup_software_mac.sh
File metadata and controls
executable file
·90 lines (70 loc) · 2.69 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
#!/bin/bash
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# UBC Thunderbots macOS Software Setup
#
# This script will install all required libraries and dependencies to build
# and run the Thunderbots codebase on macOS, including the AI and unit tests.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Save the parent dir of this script
CURR_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
cd "$CURR_DIR" || exit
source util.sh
# Since we only support MacOS Arm chips (M series), we can use "Darwin" as the identifier
# for mac setup procedures and ignore the architecture for now.
sys=$(uname -s)
print_status_msg "Installing Utilities and Dependencies"
# Update Homebrew
brew update
# Install required packages
host_software_packages=(
cmake@4
python@3.12
bazelisk
openjdk@21
pyqt@6
qt@6
node@20
go@1.24
clang-format@20
)
for pkg in "${host_software_packages[@]}"; do
if ! brew list "$pkg" &>/dev/null; then
print_status_msg "Installing $pkg..."
brew install "$pkg"
else
print_status_msg "$pkg already installed, skipping..."
fi
done
# Set up cache
mkdir /tmp/tbots_download_cache
# Set up Python
print_status_msg "Setting Up Python Environment"
# Create virtual environment
sudo python3.12 -m venv /opt/tbotspython
chmod
source /opt/tbotspython/bin/activate
# Install Python dependencies
sudo pip install --upgrade pip
sudo pip install -r macos_requirements.txt
print_status_msg "Done Setting Up Python Environment"
print_status_msg "Fetching game controller"
install_gamecontroller $sys
print_status_msg "Setting up TIGERS AutoRef"
install_autoref $sys
sudo chmod +x "$CURR_DIR/../src/software/autoref/run_autoref.sh"
sudo cp "$CURR_DIR/../src/software/autoref/DIV_B.txt" "/opt/tbotspython/autoReferee/config/geometry/DIV_B.txt"
print_status_msg "Finished setting up AutoRef"
print_status_msg "Setting up cross compiler for robot software"
install_cross_compiler $sys
print_status_msg "Done setting up cross compiler for robot software"
print_status_msg "Setting Up Python Development Headers"
install_python_toolchain_headers
print_status_msg "Done Setting Up Python Development Headers"
print_status_msg "Granting Permissions to /opt/tbotspython"
sudo chown -R $(id -u):$(id -g) /opt/tbotspython
print_status_msg "Done Granting Permissions to /opt/tbotspython"
print_status_msg "Set up ansible-lint"
/opt/tbotspython/bin/ansible-galaxy collection install ansible.posix
print_status_msg "Finished setting up ansible-lint"
print_status_msg "Software Setup Complete"
print_status_msg "Note: Some changes require a new terminal session to take effect"