cargo/.travis.install.deps.sh

66 lines
1.9 KiB
Bash
Raw Normal View History

set -x
2014-06-18 20:36:49 +00:00
if [ "${TRAVIS_OS_NAME}" = "osx" ] || [ "${PLATFORM}" = "mac" ]; then
2014-06-19 22:27:12 +00:00
target=apple-darwin
elif [ "${OS}" = "Windows_NT" ] || [ "${PLATFORM}" = "win" ]; then
windows=1
else
target=unknown-linux-gnu
fi
if [ "${TRAVIS}" = "true" ] && [ "${target}" = "unknown-linux-gnu" ]; then
2014-06-19 22:27:12 +00:00
# Install a 32-bit compiler for linux
sudo apt-get update
2014-09-02 18:51:39 +00:00
if [ "${BITS}" = "32" ]; then
sudo apt-get install libssl-dev:i386
fi
2014-07-22 15:08:55 +00:00
sudo apt-get install g++-multilib lib32stdc++6
2014-06-19 22:27:12 +00:00
fi
2014-06-18 20:36:49 +00:00
host=static-rust-lang-org.s3.amazonaws.com
2014-06-18 20:36:49 +00:00
# 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
rm -rf rustc *.tar.gz
curl -O https://$host/dist/rust-nightly-i686-$target.tar.gz
curl -O https://$host/dist/rust-nightly-x86_64-$target.tar.gz
tar xfz rust-nightly-i686-$target.tar.gz
tar xfz rust-nightly-x86_64-$target.tar.gz
2014-06-18 20:36:49 +00:00
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)
2014-06-19 22:27:12 +00:00
./rust-nightly-$dst-$target/install.sh --prefix=rustc
rm -rf rust-nightly-$src-$target
rm -rf rust-nightly-$dst-$target
rm -f rust-nightly-i686-$target.tar.gz
rm -f rust-nightly-x86_64-$target.tar.gz
else
rm -rf rustc *.exe
if [ "${BITS}" = "64" ]; then
2014-11-03 01:54:06 +00:00
triple=x86_64-pc-windows-gnu
else
2014-11-03 01:54:06 +00:00
triple=i686-pc-windows-gnu
fi
curl -O http://$host/dist/rust-nightly-$triple.exe
innounp -y -x rust-nightly-$triple.exe
mv '{app}' rustc
2014-09-22 18:18:18 +00:00
# Don't use the bundled gcc, see rust-lang/rust#17442
rm -rf rustc/bin/rustlib/$triple/gcc
rm -f rust-nightly-$triple.exe
fi
2014-06-19 22:27:12 +00:00
set +x