Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions .github/workflows/compile_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 28 additions & 9 deletions Tools/setup/macos.sh
Original file line number Diff line number Diff line change
@@ -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 )

Expand All @@ -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
Expand All @@ -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."
Loading