2014-06-25 23:31:57 +00:00
|
|
|
set -x
|
2014-06-18 20:36:49 +00:00
|
|
|
|
2014-06-25 23:31:57 +00:00
|
|
|
if [ "${TRAVIS_OS_NAME}" = "osx" ] || [ "${PLATFORM}" = "mac" ]; then
|
2014-06-19 22:27:12 +00:00
|
|
|
target=apple-darwin
|
2014-06-25 23:31:57 +00:00
|
|
|
elif [ "${OS}" = "Windows_NT" ] || [ "${PLATFORM}" = "win" ]; then
|
|
|
|
windows=1
|
2014-11-06 17:17:34 +00:00
|
|
|
else
|
2014-08-21 16:24:34 +00:00
|
|
|
target=unknown-linux-gnu
|
2014-06-25 23:31:57 +00:00
|
|
|
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
|
|
|
|
2014-09-12 03:06:39 +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.
|
2014-06-25 23:31:57 +00:00
|
|
|
if [ -z "${windows}" ]; then
|
2014-09-21 17:22:46 +00:00
|
|
|
rm -rf rustc *.tar.gz
|
2014-09-12 03:06:39 +00:00
|
|
|
curl -O https://$host/dist/rust-nightly-i686-$target.tar.gz
|
|
|
|
curl -O https://$host/dist/rust-nightly-x86_64-$target.tar.gz
|
2014-06-25 23:31:57 +00:00
|
|
|
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
|
|
|
|
2014-06-25 23:31:57 +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
|
|
|
|
2014-06-25 23:31:57 +00:00
|
|
|
./rust-nightly-$dst-$target/install.sh --prefix=rustc
|
|
|
|
rm -rf rust-nightly-$src-$target
|
|
|
|
rm -rf rust-nightly-$dst-$target
|
2014-09-12 03:06:39 +00:00
|
|
|
rm -f rust-nightly-i686-$target.tar.gz
|
|
|
|
rm -f rust-nightly-x86_64-$target.tar.gz
|
2014-06-25 23:31:57 +00:00
|
|
|
else
|
2014-09-21 17:22:46 +00:00
|
|
|
rm -rf rustc *.exe
|
2014-09-11 19:56:08 +00:00
|
|
|
if [ "${BITS}" = "64" ]; then
|
2014-11-03 01:54:06 +00:00
|
|
|
triple=x86_64-pc-windows-gnu
|
2014-09-11 19:56:08 +00:00
|
|
|
else
|
2014-11-03 01:54:06 +00:00
|
|
|
triple=i686-pc-windows-gnu
|
2014-09-11 19:56:08 +00:00
|
|
|
fi
|
2014-09-19 17:04:39 +00:00
|
|
|
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
|
2014-09-19 17:04:39 +00:00
|
|
|
rm -f rust-nightly-$triple.exe
|
2014-06-25 23:31:57 +00:00
|
|
|
fi
|
2014-06-19 22:27:12 +00:00
|
|
|
|
2014-06-25 23:31:57 +00:00
|
|
|
set +x
|