cargo/.travis.install.deps.sh
Alex Crichton ad19a31d9b Prepare for buildbot automation
* The installation script was modified to recognize when its running on windows,
  as well as tweaking how it downloads and installs snapshots. The goal here was
  to make the script runnable on buildbot for mac/linux/windows with 32/64 bit
  options on mac/linux.

* The installation script now install rustc to `rustc/bin` in the local
  directory to have parallel builds on buildbot.

* The tests now store all their temporary state locally in the build directory
  to enable parallel builds on buildbot.

* A shell test is ignored which assumed the presence of a TTY output.
2014-06-26 20:25:30 -07:00

50 lines
1.6 KiB
Bash
Executable file

set -x
if [ "${TRAVIS_OS_NAME}" = "osx" ] || [ "${PLATFORM}" = "mac" ]; then
target=apple-darwin
elif [ "${TRAVIS_OS_NAME}" = "linux" ] || [ "${PLATFORM}" = "linux" ]; then
target=unknown-linux-gnu
elif [ "${OS}" = "Windows_NT" ] || [ "${PLATFORM}" = "win" ]; then
target=pc-mingw32
windows=1
fi
if [ "${TRAVIS}" = "true" ] && [ "${target}" = "unknown-linux-gnu" ]; then
# Install a 32-bit compiler for linux
sudo apt-get update
sudo apt-get install gcc-multilib lib32stdc++6
fi
# Install both 64 and 32 bit libraries. Apparently travis barfs if you try to
# just install the right ones? This should enable cross compilation in the
# future anyway.
if [ -z "${windows}" ]; then
curl -O http://static.rust-lang.org/dist/rust-nightly-i686-$target.tar.gz
tar xfz rust-nightly-i686-$target.tar.gz
curl -O http://static.rust-lang.org/dist/rust-nightly-x86_64-$target.tar.gz
tar xfz rust-nightly-x86_64-$target.tar.gz
if [ "${BITS}" = "32" ]; then
src=x86_64
dst=i686
else
src=i686
dst=x86_64
fi
cp -r rust-nightly-$src-$target/lib/rustlib/$src-$target \
rust-nightly-$dst-$target/lib/rustlib
(cd rust-nightly-$dst-$target && \
find lib/rustlib/$src-$target/lib -type f >> \
lib/rustlib/manifest.in)
./rust-nightly-$dst-$target/install.sh --prefix=rustc
rm -rf rust-nightly-$src-$target
rm -rf rust-nightly-$dst-$target
else
rm -rf *.exe rustc
curl -O http://static.rust-lang.org/dist/rust-nightly-install.exe
innounp -y -x rust-nightly-install.exe
mv '{app}' rustc
fi
set +x