2015-02-08 06:59:58 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# install dependencies for travis build testing
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -v
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
OPT="$HOME/opt"
|
2015-04-05 14:57:17 -03:00
|
|
|
echo "PATH=$PATH"
|
2015-02-08 06:59:58 -04:00
|
|
|
|
|
|
|
BASE_PKGS="gawk make git arduino-core curl"
|
2015-02-13 21:31:49 -04:00
|
|
|
SITL_PKGS="g++ python-pip python-matplotlib python-serial python-wxgtk2.8 python-scipy python-opencv python-numpy python-pyparsing ccache python-empy"
|
2015-02-08 06:59:58 -04:00
|
|
|
AVR_PKGS="gcc-avr binutils-avr avr-libc"
|
2015-03-12 03:27:17 -03:00
|
|
|
PYTHON_PKGS="pymavlink MAVProxy catkin_pkg"
|
2015-02-08 06:59:58 -04:00
|
|
|
PX4_PKGS="python-serial python-argparse openocd flex bison libncurses5-dev \
|
|
|
|
autoconf texinfo build-essential libftdi-dev libtool zlib1g-dev \
|
|
|
|
zip genromfs"
|
2015-04-13 10:38:52 -03:00
|
|
|
UBUNTU64_PKGS="libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 gcc-multilib"
|
2015-02-08 06:59:58 -04:00
|
|
|
|
|
|
|
# GNU Tools for ARM Embedded Processors
|
|
|
|
# (see https://launchpad.net/gcc-arm-embedded/)
|
|
|
|
ARM_ROOT="gcc-arm-none-eabi-4_7-2014q2"
|
|
|
|
ARM_TARBALL="$ARM_ROOT-20140408-linux.tar.bz2"
|
|
|
|
ARM_TARBALL_URL="http://firmware.diydrones.com/Tools/PX4-tools/$ARM_TARBALL"
|
|
|
|
|
2015-04-23 08:47:58 -03:00
|
|
|
RPI_ROOT="master"
|
|
|
|
RPI_TARBALL="$RPI_ROOT.tar.gz"
|
|
|
|
RPI_TARBALL_URL="http://firmware.diydrones.com/Tools/Travis/NavIO/$RPI_TARBALL"
|
|
|
|
|
2015-02-08 06:59:58 -04:00
|
|
|
# Ardupilot Tools
|
|
|
|
ARDUPILOT_TOOLS="ardupilot/Tools/autotest"
|
|
|
|
|
|
|
|
APT_GET="sudo apt-get -qq --assume-yes"
|
|
|
|
|
|
|
|
$APT_GET update
|
|
|
|
$APT_GET install $BASE_PKGS $SITL_PKGS $PX4_PKGS $UBUNTU64_PKGS $AVR_PKGS
|
2015-03-12 20:54:59 -03:00
|
|
|
sudo pip install --upgrade pip || {
|
2015-03-12 03:27:17 -03:00
|
|
|
echo "pip upgrade failed"
|
|
|
|
}
|
2015-03-12 20:54:59 -03:00
|
|
|
sudo pip install --upgrade setuptools || {
|
2015-02-11 06:18:35 -04:00
|
|
|
echo "setuptools upgrade failed"
|
|
|
|
}
|
2015-02-08 07:06:13 -04:00
|
|
|
for pkg in $PYTHON_PKGS; do
|
|
|
|
echo "Installing $pkg"
|
2015-03-12 20:54:59 -03:00
|
|
|
sudo pip -q install $pkg || echo "FAILED INSTALL OF $pkg"
|
2015-02-08 07:06:13 -04:00
|
|
|
done
|
2015-02-08 06:59:58 -04:00
|
|
|
|
2015-03-11 00:09:27 -03:00
|
|
|
# install some extra packages (for later AVR compiler)
|
|
|
|
rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages
|
2015-03-12 03:25:35 -03:00
|
|
|
sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS"
|
2015-03-11 00:09:27 -03:00
|
|
|
|
2015-04-05 13:43:57 -03:00
|
|
|
# try to upgrade to g++ 4.8. See https://github.com/travis-ci/travis-ci/issues/1379
|
|
|
|
(sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test &&
|
|
|
|
sudo apt-get -qq update &&
|
|
|
|
sudo apt-get -qq install g++-4.8 &&
|
|
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90) || {
|
|
|
|
echo "upgrade to gcc 4.8 failed"
|
|
|
|
}
|
|
|
|
|
2015-02-08 06:59:58 -04:00
|
|
|
|
|
|
|
if [ ! -d PX4Firmware ]; then
|
|
|
|
git clone https://github.com/diydrones/PX4Firmware.git
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d PX4NuttX ]; then
|
|
|
|
git clone https://github.com/diydrones/PX4NuttX.git
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d uavcan ]; then
|
|
|
|
git clone https://github.com/diydrones/uavcan.git
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d VRNuttX ]; then
|
|
|
|
git clone https://github.com/virtualrobotix/vrbrain_nuttx.git VRNuttX
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p $OPT
|
|
|
|
|
2015-04-05 16:24:54 -03:00
|
|
|
cd $OPT
|
2015-04-05 14:57:17 -03:00
|
|
|
wget $ARM_TARBALL_URL
|
|
|
|
tar xjf ${ARM_TARBALL}
|
|
|
|
rm -f ${ARM_TARBALL}
|
2015-02-08 06:59:58 -04:00
|
|
|
|
2015-04-23 08:47:58 -03:00
|
|
|
cd $OPT
|
|
|
|
wget $RPI_TARBALL_URL
|
|
|
|
tar xzf ${RPI_TARBALL}
|
|
|
|
rm -f ${RPI_TARBALL}
|
|
|
|
|
2015-02-08 06:59:58 -04:00
|
|
|
exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH";
|
2015-04-05 14:57:17 -03:00
|
|
|
echo $exportline >> ~/.profile
|
2015-02-08 06:59:58 -04:00
|
|
|
|
|
|
|
exportline2="export PATH=$CWD/$ARDUPILOT_TOOLS:\$PATH";
|
2015-04-05 14:57:17 -03:00
|
|
|
echo $exportline2 >> ~/.profile
|
2015-04-05 16:24:54 -03:00
|
|
|
|
2015-04-23 08:47:58 -03:00
|
|
|
exportline3="export PATH=$OPT/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH";
|
|
|
|
echo $exportline3 >> ~/.profile
|
|
|
|
|
2015-04-05 16:24:54 -03:00
|
|
|
. ~/.profile
|
|
|
|
echo $PATH
|
|
|
|
ls -l $OPT/$ARM_ROOT/bin
|
2015-04-13 10:38:52 -03:00
|
|
|
$OPT/$ARM_ROOT/bin/arm-none-eabi-gcc --version
|
2015-04-23 08:47:58 -03:00
|
|
|
|
|
|
|
echo "Compiler for NavIO"
|
|
|
|
arm-linux-gnueabihf-gcc --version
|