Skip to content

Commit e021a1c

Browse files
authored
Tools: Update macos dependencies (#25361)
* tools: macos.sh update cross-compiler * tools: editor styleguide for bash scripts --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com>
1 parent 50fce15 commit e021a1c

File tree

3 files changed

+36
-14
lines changed

3 files changed

+36
-14
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ max_line_length = 120
1212
[*.yaml, *.yml]
1313
indent_style = space
1414
indent_size = 2
15+
16+
[*.sh]
17+
indent_style = tab
18+
indent_size = 2
19+
insert_final_newline = true
20+
trim_trailing_whitespace = true
21+
# Not in the official standard, but supported by many editors
22+
max_line_length = 80

.github/workflows/compile_macos.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ jobs:
3636
- name: setup
3737
run: |
3838
./Tools/setup/macos.sh
39-
./Tools/setup/macos.sh
40-
brew unlink gcc-arm-none-eabi
41-
brew tap osx-cross/arm
42-
brew install arm-gcc-bin@13
43-
brew link --force arm-gcc-bin@13
4439
4540
- name: Prepare ccache timestamp
4641
id: ccache_cache_timestamp

Tools/setup/macos.sh

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#! /usr/bin/env bash
22

3+
## Basch script to setup the PX4 development environment on macOS
4+
## Works for Intel and Arm based Apple hardware
5+
##
6+
## Installs:
7+
## - Common dependencies and tools for building PX4
8+
## - Cross compilers for building hardware targets using NuttX
9+
## - Can also install the default simulation provided by the px4-sim homebrew
10+
## Formula
11+
##
12+
## For more information regarding the Homebrew Formulas see:
13+
## https://github.com/PX4/homebrew-px4/
14+
##
15+
316
# script directory
417
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
518

@@ -18,37 +31,43 @@ do
1831
fi
1932
done
2033

34+
echo "[macos.sh] Installing the development dependencies for the PX4 Autopilot"
35+
2136
if ! command -v brew &> /dev/null
2237
then
2338
# install Homebrew if not installed yet
39+
echo "[macos.sh] Installing Homebrew"
2440
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
2541
fi
2642

2743
# Install px4-dev formula
2844
if [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
29-
echo "Re-installing PX4 general dependencies (homebrew px4-dev)"
45+
echo "[macos.sh] Re-installing dependencies (homebrew px4-dev)"
3046

3147
# confirm Homebrew installed correctly
3248
brew doctor
3349

50+
brew tap osx-cross/arm
3451
brew tap PX4/px4
52+
3553
brew reinstall px4-dev
36-
brew install ncurses
37-
brew install python-tk
54+
brew link --overwrite --force arm-gcc-bin@13
3855
else
3956
if brew ls --versions px4-dev > /dev/null; then
40-
echo "px4-dev already installed"
57+
echo "[macos.sh] px4-dev already installed"
4158
else
42-
echo "Installing PX4 general dependencies (homebrew px4-dev)"
59+
echo "[macos.sh] Installing general dependencies (homebrew px4-dev)"
60+
61+
brew tap osx-cross/arm
4362
brew tap PX4/px4
63+
4464
brew install px4-dev
45-
brew install ncurses
46-
brew install python-tk
65+
brew link --overwrite --force arm-gcc-bin@13
4766
fi
4867
fi
4968

5069
# Python dependencies
51-
echo "Installing PX4 Python3 dependencies"
70+
echo "[macos.sh] Installing Python3 dependencies"
5271
# We need to have future to install pymavlink later.
5372
python3 -m pip install future
5473
python3 -m pip install --user -r ${DIR}/requirements.txt
@@ -62,4 +81,4 @@ if [[ $INSTALL_SIM == "--sim-tools" ]]; then
6281
fi
6382
fi
6483

65-
echo "All set! PX4 toolchain installed!"
84+
echo "[macos.sh] All set! The PX4 Autopilot toolchain was installed."

0 commit comments

Comments
 (0)