Browse Source

Tools: fix Arch environment installation

gps-1.3.1
Pierre Kancir 3 years ago committed by Peter Barker
parent
commit
8f04490a12
  1. 1
      .dockerignore
  2. 37
      Tools/environment_install/install-prereqs-arch.sh

1
.dockerignore

@ -26,4 +26,5 @@ mav.*
# include the setup script and completion # include the setup script and completion
!Tools/environment_install/install-prereqs-ubuntu.sh !Tools/environment_install/install-prereqs-ubuntu.sh
!Tools/environment_install/install-prereqs-arch.sh
!Tools/completion !Tools/completion

37
Tools/environment_install/install-prereqs-arch.sh

@ -5,12 +5,28 @@ set -x
CWD=$(pwd) CWD=$(pwd)
OPT="/opt" OPT="/opt"
BASE_PKGS="base-devel ccache git gsfonts tk wget" ASSUME_YES=false
SITL_PKGS="python2-pip python-pip wxpython opencv python2-numpy python2-scipy" QUIET=false
sep="##############################################"
OPTIND=1 # Reset in case getopts has been used previously in the shell.
while getopts "yq" opt; do
case "$opt" in
\?)
exit 1
;;
y) ASSUME_YES=true
;;
q) QUIET=true
;;
esac
done
BASE_PKGS="base-devel ccache git gsfonts tk wget gcc"
SITL_PKGS="python-pip python-setuptools python-wheel wxpython opencv python-numpy python-scipy"
PX4_PKGS="lib32-glibc zip zlib ncurses" PX4_PKGS="lib32-glibc zip zlib ncurses"
PYTHON2_PKGS="future lxml pymavlink MAVProxy argparse matplotlib pyparsing geocoder" PYTHON_PKGS="future lxml pymavlink MAVProxy argparse matplotlib pyparsing geocoder pyserial empy"
PYTHON3_PKGS="pyserial empy geocoder"
# GNU Tools for ARM Embedded Processors # GNU Tools for ARM Embedded Processors
# (see https://launchpad.net/gcc-arm-embedded/) # (see https://launchpad.net/gcc-arm-embedded/)
@ -21,20 +37,23 @@ ARM_TARBALL_URL="https://firmware.ardupilot.org/Tools/STM32-tools/$ARM_TARBALL"
# Ardupilot Tools # Ardupilot Tools
ARDUPILOT_TOOLS="ardupilot/Tools/autotest" ARDUPILOT_TOOLS="ardupilot/Tools/autotest"
function prompt_user() { function maybe_prompt_user() {
if $ASSUME_YES; then
return 0
else
read -p "$1" read -p "$1"
if [[ $REPLY =~ ^[Yy]$ ]]; then if [[ $REPLY =~ ^[Yy]$ ]]; then
return 0 return 0
else else
return 1 return 1
fi fi
fi
} }
sudo usermod -a -G uucp $USER sudo usermod -a -G uucp $USER
sudo pacman -Sy --noconfirm --needed $BASE_PKGS $SITL_PKGS $PX4_PKGS sudo pacman -Sy --noconfirm --needed $BASE_PKGS $SITL_PKGS $PX4_PKGS
pip2 -q install --user -U $PYTHON2_PKGS pip3 -q install --user -U $PYTHON_PKGS
pip3 -q install --user -U $PYTHON3_PKGS
( (
cd /usr/lib/ccache cd /usr/lib/ccache
@ -57,7 +76,7 @@ fi
exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH"; exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH";
if ! grep -Fxq "$exportline" ~/.bashrc ; then if ! grep -Fxq "$exportline" ~/.bashrc ; then
if prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [N/y]?" ; then if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [N/y]?" ; then
echo "$exportline" >> ~/.bashrc echo "$exportline" >> ~/.bashrc
. ~/.bashrc . ~/.bashrc
else else
@ -67,7 +86,7 @@ fi
exportline2="export PATH=$CWD/$ARDUPILOT_TOOLS:\$PATH"; exportline2="export PATH=$CWD/$ARDUPILOT_TOOLS:\$PATH";
if ! grep -Fxq "$exportline2" ~/.bashrc ; then if ! grep -Fxq "$exportline2" ~/.bashrc ; then
if prompt_user "Add $CWD/$ARDUPILOT_TOOLS to your PATH [N/y]?" ; then if maybe_prompt_user "Add $CWD/$ARDUPILOT_TOOLS to your PATH [N/y]?" ; then
echo "$exportline2" >> ~/.bashrc echo "$exportline2" >> ~/.bashrc
. ~/.bashrc . ~/.bashrc
else else

Loading…
Cancel
Save