2016-01-18 14:57:27 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# Install dependencies and configure the environment for CI build testing
|
|
|
|
|
2016-01-20 01:14:45 -04:00
|
|
|
set -ex
|
2016-01-18 14:57:27 -04:00
|
|
|
|
2016-05-17 02:16:42 -03:00
|
|
|
# Disable ccache for the configure phase, it's not worth it
|
|
|
|
export CCACHE_DISABLE="true"
|
|
|
|
|
2021-07-25 19:06:40 -03:00
|
|
|
ARM_ROOT="gcc-arm-none-eabi-10-2020-q4-major"
|
|
|
|
ARM_TARBALL="$ARM_ROOT-x86_64-linux.tar.bz2"
|
2016-01-18 14:57:27 -04:00
|
|
|
|
|
|
|
RPI_ROOT="master"
|
|
|
|
RPI_TARBALL="$RPI_ROOT.tar.gz"
|
|
|
|
|
2020-08-25 14:03:02 -03:00
|
|
|
MUSL_ROOT="arm-linux-musleabihf-cross"
|
|
|
|
MUSL_TBZ="$MUSL_ROOT.tgz"
|
|
|
|
|
2018-08-29 20:33:10 -03:00
|
|
|
CCACHE_ROOT="ccache-3.4.2"
|
2016-04-16 04:26:23 -03:00
|
|
|
CCACHE_TARBALL="$CCACHE_ROOT.tar.bz2"
|
|
|
|
|
2016-01-18 14:57:27 -04:00
|
|
|
mkdir -p $HOME/opt
|
2016-04-16 04:26:23 -03:00
|
|
|
pushd $HOME
|
2016-01-18 14:57:27 -04:00
|
|
|
|
2020-03-27 05:58:04 -03:00
|
|
|
# STM32 toolchain
|
2016-04-16 04:26:23 -03:00
|
|
|
dir=$ARM_ROOT
|
2018-08-29 20:33:10 -03:00
|
|
|
if [ ! -d "$HOME/opt/$dir" -o ! -x "$HOME/opt/$dir/bin/arm-none-eabi-g++" ]; then
|
2019-12-07 16:44:14 -04:00
|
|
|
wget https://firmware.ardupilot.org/Tools/STM32-tools/$ARM_TARBALL
|
2016-04-16 04:26:23 -03:00
|
|
|
tar -xf $ARM_TARBALL -C opt
|
2016-01-18 14:57:27 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# RPi/BBB toolchain
|
2016-04-16 04:26:23 -03:00
|
|
|
dir="tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64"
|
2018-08-29 20:33:10 -03:00
|
|
|
if [ ! -d "$HOME/opt/$dir" -o ! -x "$HOME/opt/$dir/bin/arm-linux-gnueabihf-g++" ]; then
|
2019-12-07 16:44:14 -04:00
|
|
|
wget https://firmware.ardupilot.org/Tools/Travis/NavIO/$RPI_TARBALL
|
2016-04-16 04:26:23 -03:00
|
|
|
tar -xf $RPI_TARBALL -C opt $dir
|
|
|
|
fi
|
|
|
|
|
2020-08-25 14:03:02 -03:00
|
|
|
# musl toolchain
|
|
|
|
dir=$MUSL_ROOT
|
|
|
|
if [ ! -d "$HOME/opt/$dir" -o ! -x "$HOME/opt/$dir/bin/arm-linux-musleabihf-g++" ]; then
|
|
|
|
wget https://musl.cc/$MUSL_TBZ
|
|
|
|
tar -xf $MUSL_TBZ -C opt
|
|
|
|
fi
|
|
|
|
|
2017-07-17 12:30:05 -03:00
|
|
|
# ccache
|
2016-04-16 04:26:23 -03:00
|
|
|
dir=$CCACHE_ROOT
|
|
|
|
if [ ! -d "$HOME/opt/$dir" ]; then
|
2018-08-29 20:33:10 -03:00
|
|
|
# if version 3.4 isn't there, try to remove older v3.3 folders from CI cache
|
|
|
|
rm -rf "$HOME/opt"/ccache-3.3*
|
2017-07-17 12:30:05 -03:00
|
|
|
|
2016-04-16 04:26:23 -03:00
|
|
|
wget https://www.samba.org/ftp/ccache/$CCACHE_TARBALL
|
|
|
|
tar -xf $CCACHE_TARBALL
|
|
|
|
pushd $CCACHE_ROOT
|
|
|
|
./configure --prefix="/tmp" --bindir="$HOME/opt/$dir"
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
popd
|
2016-01-18 14:57:27 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
mkdir -p $HOME/bin
|
|
|
|
|
2016-04-14 20:27:09 -03:00
|
|
|
# symlink to compiler versions
|
2018-09-19 13:04:14 -03:00
|
|
|
ln -s /usr/bin/clang-7 ~/bin/clang
|
|
|
|
ln -s /usr/bin/clang++-7 ~/bin/clang++
|
|
|
|
ln -s /usr/bin/llvm-ar-7 ~/bin/llvm-ar
|
2016-04-14 20:27:09 -03:00
|
|
|
|
|
|
|
mkdir -p $HOME/ccache
|
2016-01-20 00:53:46 -04:00
|
|
|
|
2016-04-14 20:27:09 -03:00
|
|
|
# configure ccache
|
2016-04-16 04:26:23 -03:00
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/g++
|
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/gcc
|
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/arm-none-eabi-g++
|
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/arm-none-eabi-gcc
|
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/arm-linux-gnueabihf-g++
|
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/arm-linux-gnueabihf-gcc
|
2020-08-25 14:03:02 -03:00
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/arm-linux-musleabihf-gcc
|
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/arm-linux-musleabihf-g++
|
2016-04-16 05:58:37 -03:00
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/clang++
|
|
|
|
ln -s ~/opt/$CCACHE_ROOT/ccache ~/ccache/clang
|
2016-04-14 20:27:09 -03:00
|
|
|
|
|
|
|
exportline="export PATH=$HOME/ccache"
|
|
|
|
exportline="${exportline}:$HOME/bin"
|
2016-10-13 13:45:18 -03:00
|
|
|
exportline="${exportline}:$HOME/.local/bin"
|
2021-07-25 19:06:40 -03:00
|
|
|
exportline="${exportline}:$HOME/opt/gcc-arm-none-eabi-10-2020-q4-major/bin"
|
2016-03-08 20:55:21 -04:00
|
|
|
exportline="${exportline}:$HOME/opt/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin"
|
2020-08-25 14:03:02 -03:00
|
|
|
exportline="${exportline}:$HOME/opt/arm-linux-musleabihf-cross/bin"
|
2016-05-17 02:16:42 -03:00
|
|
|
exportline="${exportline}:$HOME/opt/$CCACHE_ROOT"
|
2016-01-20 00:53:46 -04:00
|
|
|
exportline="${exportline}:\$PATH"
|
|
|
|
|
|
|
|
if grep -Fxq "$exportline" ~/.profile; then
|
2020-03-27 05:58:04 -03:00
|
|
|
echo "nothing to do";
|
2016-01-20 00:53:46 -04:00
|
|
|
else
|
|
|
|
echo $exportline >> ~/.profile;
|
|
|
|
fi
|
2016-01-18 14:57:27 -04:00
|
|
|
|
|
|
|
. ~/.profile
|
|
|
|
|
2023-01-09 07:17:13 -04:00
|
|
|
python -m pip install --progress-bar off --user -U argparse pyserial pexpect future lxml
|
|
|
|
python -m pip install --progress-bar off --user -U intelhex
|
|
|
|
python -m pip install --progress-bar off --user -U numpy
|
|
|
|
python -m pip install --progress-bar off --user -U edn_format
|
2023-12-02 20:47:37 -04:00
|
|
|
python -m pip install --progress-bar off --user -U empy==3.3.4
|