#!/bin/bash# install stuff needed for the `script` phase# Where rustup gets installed.exportPATH="$PATH:$HOME/.cargo/bin"set-ex."$(dirname$0)/utils.sh"install_rustup(){curl https://sh.rustup.rs -sSf\
|sh -s -- -y --default-toolchain="$TRAVIS_RUST_VERSION"rustc -Vcargo -V}install_targets(){if[$(host)!="$TARGET"];thenrustup target add $TARGETfi}install_osx_dependencies(){if!is_osx;thenreturnfibrew install asciidoc docbook-xsl}configure_cargo(){localprefix=$(gcc_prefix)if[-n"${prefix}"];thenlocalgcc_suffix=if[-n"$GCC_VERSION"];thengcc_suffix="-$GCC_VERSION"filocalgcc="${prefix}gcc${gcc_suffix}"# information about the cross compiler"${gcc}" -v# tell cargo which linker to use for cross compilationmkdir -p .cargocat>>.cargo/config <<EOF
[target.$TARGET]
linker = "${gcc}"
EOFfi}main(){install_osx_dependenciesinstall_rustupinstall_targetsconfigure_cargo}main