11install_autoref () {
2- autoref_commit=b30660b78728c3ce159de8ae096181a1ec52e9ba
3- wget -N https://github.com/TIGERs-Mannheim/AutoReferee/archive/${autoref_commit} .zip -O /tmp/tbots_download_cache/autoReferee.zip
4- unzip -q -o -d /tmp/tbots_download_cache/ /tmp/tbots_download_cache/autoReferee.zip
2+ if is_darwin $1 ; then
3+ autoref_version=1.5.5
4+ curl -L https://github.com/TIGERs-Mannheim/AutoReferee/releases/download/${autoref_version} /autoReferee.zip -o /tmp/tbots_download_cache/autoReferee.zip
5+ unzip -q -o -d /tmp/tbots_download_cache/ /tmp/tbots_download_cache/autoReferee.zip
56
6- /tmp/tbots_download_cache/AutoReferee-${autoref_commit} /./gradlew installDist -p /tmp/tbots_download_cache/AutoReferee-${autoref_commit} -Dorg.gradle.java.home=/opt/tbotspython/bin/jdk
7- mv /tmp/tbots_download_cache/AutoReferee-${autoref_commit} /build/install/autoReferee /opt/tbotspython/
8- rm -rf /tmp/tbots_download_cache/autoReferee.zip /tmp/tbots_download_cache/AutoReferee-${autoref_commit}
7+ sudo mv /tmp/tbots_download_cache/autoReferee /opt/tbotspython/
8+ rm -rf /tmp/tbots_download_cache/autoReferee.zip
9+ else
10+ autoref_commit=b30660b78728c3ce159de8ae096181a1ec52e9ba
11+ wget -N https://github.com/TIGERs-Mannheim/AutoReferee/archive/${autoref_commit} .zip -O /tmp/tbots_download_cache/autoReferee.zip
12+ unzip -q -o -d /tmp/tbots_download_cache/ /tmp/tbots_download_cache/autoReferee.zip
13+
14+ /tmp/tbots_download_cache/AutoReferee-${autoref_commit} /./gradlew installDist -p /tmp/tbots_download_cache/AutoReferee-${autoref_commit} -Dorg.gradle.java.home=/opt/tbotspython/bin/jdk
15+ mv /tmp/tbots_download_cache/AutoReferee-${autoref_commit} /build/install/autoReferee /opt/tbotspython/
16+ rm -rf /tmp/tbots_download_cache/autoReferee.zip /tmp/tbots_download_cache/AutoReferee-${autoref_commit}
17+ fi
918}
1019
1120install_bazel () {
@@ -25,25 +34,47 @@ install_clang_format() {
2534
2635install_cross_compiler () {
2736 file_name=aarch64-tbots-linux-gnu-for-aarch64
28- if is_x86 $1 ; then
29- file_name=aarch64-tbots-linux-gnu-for-x86
37+ if is_darwin $1 ; then
38+ full_file_name=$file_name .tar.xz
39+ curl -L " https://raw.githubusercontent.com/UBC-Thunderbots/Software-External-Dependencies/refs/heads/main/toolchain/$full_file_name " \
40+ -o /tmp/tbots_download_cache/$full_file_name
41+ tar -xf /tmp/tbots_download_cache/$full_file_name -C /tmp/tbots_download_cache/
42+ sudo mv /tmp/tbots_download_cache/aarch64-tbots-linux-gnu /opt/tbotspython
43+ rm /tmp/tbots_download_cache/$full_file_name
44+ else
45+ if is_x86 $1 ; then
46+ file_name=aarch64-tbots-linux-gnu-for-x86
47+ fi
48+ full_file_name=$file_name .tar.xz
49+ wget https://raw.githubusercontent.com/UBC-Thunderbots/Software-External-Dependencies/refs/heads/main/toolchain/$full_file_name -O /tmp/tbots_download_cache/$full_file_name
50+ tar -xf /tmp/tbots_download_cache/$full_file_name -C /tmp/tbots_download_cache/
51+ sudo mv /tmp/tbots_download_cache/aarch64-tbots-linux-gnu /opt/tbotspython
52+ rm /tmp/tbots_download_cache/$full_file_name
3053 fi
31- full_file_name=$file_name .tar.xz
32- wget https://raw.githubusercontent.com/UBC-Thunderbots/Software-External-Dependencies/refs/heads/main/toolchain/$full_file_name -O /tmp/tbots_download_cache/$full_file_name
33- tar -xf /tmp/tbots_download_cache/$full_file_name -C /tmp/tbots_download_cache/
34- sudo mv /tmp/tbots_download_cache/aarch64-tbots-linux-gnu /opt/tbotspython
35- rm /tmp/tbots_download_cache/$full_file_name
3654}
3755
3856install_gamecontroller () {
39- arch=arm64
40- if is_x86 $1 ; then
41- arch=amd64
42- fi
57+ if is_darwin $1 ; then
58+ curl -L https://github.com/RoboCup-SSL/ssl-game-controller/archive/refs/tags/v3.17.0.zip -o /tmp/tbots_download_cache/ssl-game-controller.zip
59+ unzip -q -o -d /tmp/tbots_download_cache/ /tmp/tbots_download_cache/ssl-game-controller.zip
60+ cd /tmp/tbots_download_cache/ssl-game-controller-3.17.0
61+ make install
62+ go build cmd/ssl-game-controller/main.go
63+ sudo mv main /opt/tbotspython/gamecontroller
64+ sudo chmod +x /opt/tbotspython/gamecontroller
65+
66+ cd -
67+ sudo rm -rf /tmp/tbots_download_cache/ssl-game-controller-3.17.0 /tmp/tbots_download_cache/go /tmp/tbots_download_cache/go.tar.gz /tmp/tbots_download_cache/ssl-game-controller.zip
68+ else
69+ arch=arm64
70+ if is_x86 $1 ; then
71+ arch=amd64
72+ fi
4373
44- wget https://github.com/RoboCup-SSL/ssl-game-controller/releases/download/v3.16.1/ssl-game-controller_v3.16.1_linux_${arch} -O /tmp/tbots_download_cache/gamecontroller
45- sudo mv /tmp/tbots_download_cache/gamecontroller /opt/tbotspython/gamecontroller
46- sudo chmod +x /opt/tbotspython/gamecontroller
74+ wget https://github.com/RoboCup-SSL/ssl-game-controller/releases/download/v3.16.1/ssl-game-controller_v3.16.1_linux_${arch} -O /tmp/tbots_download_cache/gamecontroller
75+ sudo mv /tmp/tbots_download_cache/gamecontroller /opt/tbotspython/gamecontroller
76+ sudo chmod +x /opt/tbotspython/gamecontroller
77+ fi
4778}
4879
4980install_java () {
@@ -90,6 +121,11 @@ install_python_dev_cross_compile_headers() {
90121 rm -rf /tmp/tbots_download_cache/python-3.12.0.tar.xz
91122}
92123
124+ install_python_toolchain_headers () {
125+ sudo mkdir -p /opt/tbotspython/py_headers/include/
126+ sudo ln -sfn " $( python3.12-config --includes | awk ' {for(i=1;i<=NF;++i) if ($i ~ /^-I/) print substr($i, 3)}' | head -n1) " /opt/tbotspython/py_headers/include/
127+ }
128+
93129is_x86 () {
94130 if [[ $1 == " x86_64" ]]; then
95131 return 0
@@ -98,6 +134,14 @@ is_x86() {
98134 fi
99135}
100136
137+ is_darwin () {
138+ if [[ $1 == " Darwin" ]]; then
139+ return 0
140+ else
141+ return 1
142+ fi
143+ }
144+
101145print_status_msg () {
102146 echo " ================================================================"
103147 echo $1
0 commit comments