mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
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.
This commit is contained in:
+24
-32
@@ -11,11 +11,11 @@ INSTALL_SIM=""
|
|||||||
# Parse arguments
|
# Parse arguments
|
||||||
for arg in "$@"
|
for arg in "$@"
|
||||||
do
|
do
|
||||||
if [[ $arg == "--reinstall" ]]; then
|
if [[ $arg == "--reinstall" ]]; then
|
||||||
REINSTALL_FORMULAS=$arg
|
REINSTALL_FORMULAS=$arg
|
||||||
elif [[ $arg == "--sim-tools" ]]; then
|
elif [[ $arg == "--sim-tools" ]]; then
|
||||||
INSTALL_SIM=$arg
|
INSTALL_SIM=$arg
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# install Homebrew
|
# install Homebrew
|
||||||
@@ -23,42 +23,34 @@ done
|
|||||||
|
|
||||||
# Install px4-dev formula
|
# Install px4-dev formula
|
||||||
if [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
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
|
# confirm Homebrew installed correctly
|
||||||
brew doctor
|
brew doctor
|
||||||
|
|
||||||
brew tap PX4/px4
|
brew tap PX4/px4
|
||||||
brew reinstall px4-dev ccache
|
brew reinstall px4-dev
|
||||||
|
|
||||||
# python dependencies
|
|
||||||
brew install python3
|
|
||||||
sudo -H python3 -m pip install --upgrade pip
|
|
||||||
else
|
else
|
||||||
if brew ls --versions px4-dev > /dev/null; then
|
if brew ls --versions px4-dev > /dev/null; then
|
||||||
echo "px4-dev already installed"
|
echo "px4-dev already installed"
|
||||||
else
|
else
|
||||||
echo "Installing PX4 general dependencies (homebrew px4-dev)"
|
echo "Installing PX4 general dependencies (homebrew px4-dev)"
|
||||||
brew tap PX4/px4
|
brew tap PX4/px4
|
||||||
brew install px4-dev ccache
|
brew install px4-dev
|
||||||
|
fi
|
||||||
# python dependencies
|
|
||||||
brew install python3
|
|
||||||
sudo -H python3 -m pip install --upgrade pip
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Python3 dependencies
|
# Python dependencies
|
||||||
echo "Installing PX4 Python3 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:
|
# Optional, but recommended additional simulation tools:
|
||||||
if [[ $INSTALL_SIM == "--sim-tools" ]]; then
|
if [[ $INSTALL_SIM == "--sim-tools" ]]; then
|
||||||
if brew ls --versions px4-sim > /dev/null; then
|
if brew ls --versions px4-sim > /dev/null; then
|
||||||
brew install px4-sim
|
brew install px4-sim
|
||||||
elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
||||||
brew reinstall px4-sim
|
brew reinstall px4-sim
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "All set! PX4 toolchain installed!"
|
echo "All set! PX4 toolchain installed!"
|
||||||
|
|||||||
Reference in New Issue
Block a user