From aed114465e9e62125ada00ccc15c2d075d4a418d Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 15 Jul 2020 10:53:12 +0200 Subject: [PATCH] setup: clean up macOS setup script - Spaces -> tabs. - Remove "brew install python" because it's already a dependency of the px4-dev tap. - Remove "brew install ccache" as we can also add it to the px4-dev tap. - Don't try to update pip installation, it works fine as is. - Install pip dependencies as user, no need for system-wide install. --- Tools/setup/OSX.sh | 56 ++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/Tools/setup/OSX.sh b/Tools/setup/OSX.sh index eef3129311..94c01b5f44 100755 --- a/Tools/setup/OSX.sh +++ b/Tools/setup/OSX.sh @@ -11,11 +11,11 @@ INSTALL_SIM="" # Parse arguments for arg in "$@" do - if [[ $arg == "--reinstall" ]]; then - REINSTALL_FORMULAS=$arg - elif [[ $arg == "--sim-tools" ]]; then - INSTALL_SIM=$arg - fi + if [[ $arg == "--reinstall" ]]; then + REINSTALL_FORMULAS=$arg + elif [[ $arg == "--sim-tools" ]]; then + INSTALL_SIM=$arg + fi done # install Homebrew @@ -23,42 +23,34 @@ done # Install px4-dev formula if [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then - echo "Re-installing PX4 general dependencies (homebrew px4-dev)" + echo "Re-installing PX4 general dependencies (homebrew px4-dev)" - # confirm Homebrew installed correctly - brew doctor + # confirm Homebrew installed correctly + brew doctor - brew tap PX4/px4 - brew reinstall px4-dev ccache - - # python dependencies - brew install python3 - sudo -H python3 -m pip install --upgrade pip + brew tap PX4/px4 + brew reinstall px4-dev else - if brew ls --versions px4-dev > /dev/null; then - echo "px4-dev already installed" - else - echo "Installing PX4 general dependencies (homebrew px4-dev)" - brew tap PX4/px4 - brew install px4-dev ccache - - # python dependencies - brew install python3 - sudo -H python3 -m pip install --upgrade pip - fi + if brew ls --versions px4-dev > /dev/null; then + echo "px4-dev already installed" + else + echo "Installing PX4 general dependencies (homebrew px4-dev)" + brew tap PX4/px4 + brew install px4-dev + fi fi -# Python3 dependencies +# Python dependencies echo "Installing PX4 Python3 dependencies" -sudo -H python3 -m pip install -r ${DIR}/requirements.txt +pip3 install --user -r ${DIR}/requirements.txt # Optional, but recommended additional simulation tools: if [[ $INSTALL_SIM == "--sim-tools" ]]; then - if brew ls --versions px4-sim > /dev/null; then - brew install px4-sim - elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then - brew reinstall px4-sim - fi + if brew ls --versions px4-sim > /dev/null; then + brew install px4-sim + elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then + brew reinstall px4-sim + fi fi echo "All set! PX4 toolchain installed!"