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

59 lines
1.2 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() {
if [[ $TRAVIS_OS_NAME = "linux" ]]; then
apt-get update
apt-get install -y --no-install-recommends \
binfmt-support qemu-user-static
fi
}
install_gist() {
gem install gist
2016-08-09 01:37:04 +00:00
}
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_gist
2016-08-09 01:37:04 +00:00
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