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
417DIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd )
518
1831 fi
1932done
2033
34+ echo " [macos.sh] Installing the development dependencies for the PX4 Autopilot"
35+
2136if ! command -v brew & > /dev/null
2237then
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) "
2541fi
2642
2743# Install px4-dev formula
2844if [[ $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
3855else
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
4867fi
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.
5372python3 -m pip install future
5473python3 -m pip install --user -r ${DIR} /requirements.txt
@@ -62,4 +81,4 @@ if [[ $INSTALL_SIM == "--sim-tools" ]]; then
6281 fi
6382fi
6483
65- echo " All set! PX4 toolchain installed! "
84+ echo " [macos.sh] All set! The PX4 Autopilot toolchain was installed. "
0 commit comments