diff options
author | Till Höppner | 2016-03-17 13:15:37 +0100 |
---|---|---|
committer | Till Höppner | 2016-03-17 13:45:37 +0100 |
commit | 435db78809fb7b22bbcdbd9df45dded44e500510 (patch) | |
tree | 32baeaea0dfc5f58ebaf67d6a3ab9bebb89e6bbe /ci/install.sh | |
parent | 155971b36c100c0c146492375d5580ef0c5ac572 (diff) | |
download | ilc-435db78809fb7b22bbcdbd9df45dded44e500510.tar.gz ilc-435db78809fb7b22bbcdbd9df45dded44e500510.tar.xz ilc-435db78809fb7b22bbcdbd9df45dded44e500510.zip |
Update CI from japaric/rust-everywhere
Diffstat (limited to 'ci/install.sh')
-rw-r--r-- | ci/install.sh | 66 |
1 files changed, 40 insertions, 26 deletions
diff --git a/ci/install.sh b/ci/install.sh index e4bd198..9d56f57 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -2,32 +2,49 @@ set -ex -case $TARGET in - # Install standard libraries needed for cross compilation - arm-unknown-linux-gnueabihf | \ - i686-apple-darwin | \ - i686-unknown-linux-gnu | \ - x86_64-unknown-linux-musl) - if [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then - # information about the cross compiler - arm-linux-gnueabihf-gcc -v - - # tell cargo which linker to use for cross compilation - mkdir -p .cargo - cat >.cargo/config <<EOF +# Install multirust +git clone https://github.com/brson/multirust +pushd multirust +./build.sh +./install.sh --prefix=~/multirust +multirust default $CHANNEL +rustc -V +cargo -V +popd + +case "$TRAVIS_OS_NAME" in + linux) + host=x86_64-unknown-linux-gnu + ;; + osx) + host=x86_64-apple-darwin + ;; +esac + +# Install standard libraries needed for cross compilation +if [ "$host" != "$TARGET" ]; then + if [ "$TARGET" = "arm-unknown-linux-gnueabihf" ]; then + # information about the cross compiler + arm-linux-gnueabihf-gcc -v + + # tell cargo which linker to use for cross compilation + mkdir -p .cargo + cat >>.cargo/config <<EOF [target.$TARGET] linker = "arm-linux-gnueabihf-gcc" EOF + fi + + if [ "$CHANNEL" = "nightly" ]; then + multirust add-target nightly $TARGET + else + if [ "$CHANNEL" = "stable" ]; then + # e.g. 1.6.0 + version=$(rustc -V | cut -d' ' -f2) + else + version=beta fi - # e.g. 1.6.0 - # doesn't work for nightly - # version=$(rustc -V | cut -d' ' -f2) - version=$(rustc -V | cut -d' ' -f2 | cut -d'-' -f2) - - if [ "$TARGET" = "x86_64-unknown-linux-musl" ]; then - version="nightly" - fi tarball=rust-std-${version}-${TARGET} curl -Os http://static.rust-lang.org/dist/${tarball}.tar.gz @@ -38,10 +55,7 @@ EOF rm -r ${tarball} rm ${tarball}.tar.gz - ;; - # Nothing to do for native builds - *) - ;; -esac + fi +fi # TODO if you need to install extra stuff add it here |