rust/library/compiler-builtins/ci/install.sh

62 lines
1.4 KiB
Bash
Raw Normal View History

2016-08-07 21:55:30 +00:00
set -ex
. $(dirname $0)/env.sh
2016-08-09 01:37:04 +00:00
install_qemu() {
case ${QEMU_ARCH:-$TRAVIS_OS_NAME} in
i386)
dpkg --add-architecture $QEMU_ARCH
2016-08-14 00:30:30 +00:00
apt-get update
2016-08-09 02:49:31 +00:00
apt-get install -y --no-install-recommends \
binfmt-support qemu-user-static:$QEMU_ARCH
2016-08-09 01:37:04 +00:00
;;
linux)
2016-08-10 16:50:41 +00:00
apt-get update
apt-get install -y --no-install-recommends \
binfmt-support qemu-user-static
2016-08-10 16:50:41 +00:00
;;
2016-08-09 01:37:04 +00:00
esac
}
2016-08-07 22:32:53 +00:00
install_binutils() {
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
brew install binutils
fi
2016-08-07 22:23:30 +00:00
}
2016-08-07 22:03:44 +00:00
install_rust() {
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=nightly
else
rustup default nightly
fi
2016-08-07 22:03:44 +00:00
rustc -V
cargo -V
}
2016-08-07 21:55:30 +00:00
2016-08-07 22:03:44 +00:00
add_rustup_target() {
2016-08-13 17:45:19 +00:00
if [[ $TARGET != $HOST && ${CARGO:-cargo} == "cargo" ]]; then
2016-08-07 22:03:44 +00:00
rustup target add $TARGET
fi
2016-08-07 21:55:30 +00:00
}
2016-08-13 16:32:52 +00:00
install_xargo() {
if [[ $CARGO == "xargo" ]]; then
2016-08-13 17:55:09 +00:00
curl -sf "https://raw.githubusercontent.com/japaric/rust-everywhere/master/install.sh" | \
bash -s -- --from japaric/xargo --at /root/.cargo/bin
2016-08-07 22:03:44 +00:00
fi
2016-08-07 21:55:30 +00:00
}
main() {
2016-08-13 22:24:52 +00:00
if [[ $TRAVIS_OS_NAME == "osx" || ${IN_DOCKER_CONTAINER:-n} == "y" ]]; then
2016-08-09 01:37:04 +00:00
install_qemu
install_binutils
install_rust
add_rustup_target
2016-08-13 16:32:52 +00:00
install_xargo
2016-08-09 01:37:04 +00:00
fi
2016-08-07 21:55:30 +00:00
}
main