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>
This commit is contained in:
Ramon Roche
2025-08-04 19:15:30 -07:00
committed by GitHub
parent 50fce15a75
commit e021a1c946
3 changed files with 36 additions and 14 deletions

View File

@@ -12,3 +12,11 @@ max_line_length = 120
[*.yaml, *.yml]
indent_style = space
indent_size = 2
[*.sh]
indent_style = tab
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
# Not in the official standard, but supported by many editors
max_line_length = 80

View File

@@ -36,11 +36,6 @@ jobs:
- name: setup
run: |
./Tools/setup/macos.sh
./Tools/setup/macos.sh
brew unlink gcc-arm-none-eabi
brew tap osx-cross/arm
brew install arm-gcc-bin@13
brew link --force arm-gcc-bin@13
- name: Prepare ccache timestamp
id: ccache_cache_timestamp

View File

@@ -1,5 +1,18 @@
#! /usr/bin/env bash
## Basch script to setup the PX4 development environment on macOS
## Works for Intel and Arm based Apple hardware
##
## Installs:
## - Common dependencies and tools for building PX4
## - Cross compilers for building hardware targets using NuttX
## - Can also install the default simulation provided by the px4-sim homebrew
## Formula
##
## For more information regarding the Homebrew Formulas see:
## https://github.com/PX4/homebrew-px4/
##
# script directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
@@ -18,37 +31,43 @@ do
fi
done
echo "[macos.sh] Installing the development dependencies for the PX4 Autopilot"
if ! command -v brew &> /dev/null
then
# install Homebrew if not installed yet
echo "[macos.sh] Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
# Install px4-dev formula
if [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
echo "Re-installing PX4 general dependencies (homebrew px4-dev)"
echo "[macos.sh] Re-installing dependencies (homebrew px4-dev)"
# confirm Homebrew installed correctly
brew doctor
brew tap osx-cross/arm
brew tap PX4/px4
brew reinstall px4-dev
brew install ncurses
brew install python-tk
brew link --overwrite --force arm-gcc-bin@13
else
if brew ls --versions px4-dev > /dev/null; then
echo "px4-dev already installed"
echo "[macos.sh] px4-dev already installed"
else
echo "Installing PX4 general dependencies (homebrew px4-dev)"
echo "[macos.sh] Installing general dependencies (homebrew px4-dev)"
brew tap osx-cross/arm
brew tap PX4/px4
brew install px4-dev
brew install ncurses
brew install python-tk
brew link --overwrite --force arm-gcc-bin@13
fi
fi
# Python dependencies
echo "Installing PX4 Python3 dependencies"
echo "[macos.sh] Installing Python3 dependencies"
# We need to have future to install pymavlink later.
python3 -m pip install future
python3 -m pip install --user -r ${DIR}/requirements.txt
@@ -62,4 +81,4 @@ if [[ $INSTALL_SIM == "--sim-tools" ]]; then
fi
fi
echo "All set! PX4 toolchain installed!"
echo "[macos.sh] All set! The PX4 Autopilot toolchain was installed."