aboutsummaryrefslogtreecommitdiff
path: root/ci/install.sh
diff options
context:
space:
mode:
authorTill Höppner2016-02-23 17:00:53 +0100
committerTill Höppner2016-02-24 18:36:04 +0100
commitf01c278a26e0f248d188c10bdb852b0859b98b3b (patch)
tree3e729bf243011111a20b84f24aea3fbcb9f595f5 /ci/install.sh
parent815f31f5cef61709c50087c9f7601ea330929bb7 (diff)
downloadilc-f01c278a26e0f248d188c10bdb852b0859b98b3b.tar.gz
ilc-f01c278a26e0f248d188c10bdb852b0859b98b3b.tar.xz
ilc-f01c278a26e0f248d188c10bdb852b0859b98b3b.zip
Test CI
Diffstat (limited to 'ci/install.sh')
-rw-r--r--ci/install.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/ci/install.sh b/ci/install.sh
new file mode 100644
index 0000000..81ff38c
--- /dev/null
+++ b/ci/install.sh
@@ -0,0 +1,43 @@
+# `install` phase: install stuff needed for the `script` phase
+
+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
+[target.$TARGET]
+linker = "arm-linux-gnueabihf-gcc"
+EOF
+ 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)
+ tarball=rust-std-${version}-${TARGET}
+
+ curl -Os http://static.rust-lang.org/dist/${tarball}.tar.gz
+
+ tar xzf ${tarball}.tar.gz
+
+ ${tarball}/install.sh --prefix=$(rustc --print sysroot)
+
+ rm -r ${tarball}
+ rm ${tarball}.tar.gz
+ ;;
+ # Nothing to do for native builds
+ *)
+ ;;
+esac
+
+# TODO if you need to install extra stuff add it here