aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2017-07-16 10:02:02 -0700
committerSteven Fackler <[email protected]>2017-07-16 14:15:09 -0700
commit3a7ca9c2ff607b65e0db2ea4bb167c1304da86e8 (patch)
tree7665b2f07eec21f461b6e55456bc8f04aa8a7858 /test
parentTell docs.rs to build with all features (diff)
downloadrust-openssl-3a7ca9c2ff607b65e0db2ea4bb167c1304da86e8.tar.xz
rust-openssl-3a7ca9c2ff607b65e0db2ea4bb167c1304da86e8.zip
Switch over Linux tests to CircleCI
Diffstat (limited to 'test')
-rwxr-xr-xtest/add_target.sh32
-rwxr-xr-xtest/build_openssl.sh55
2 files changed, 87 insertions, 0 deletions
diff --git a/test/add_target.sh b/test/add_target.sh
new file mode 100755
index 00000000..1f74b4cf
--- /dev/null
+++ b/test/add_target.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -e
+
+case "${TARGET}" in
+"x86_64-unknown-linux-gnu")
+ exit 0
+ ;;
+"i686-unknown-linux-gnu")
+ apt-get install -y --no-install-recommends gcc-multilib
+ ;;
+"arm-unknown-linux-gnueabihf")
+ echo "deb http://emdebian.org/tools/debian/ jessie main" \
+ > /etc/apt/sources.list.d/crosstools.list
+ curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
+ dpkg --add-architecture armhf
+ apt-get update
+ apt-get install -y --no-install-recommends \
+ gcc-arm-linux-gnueabihf \
+ libc6-dev:armhf
+ ;;
+esac
+
+OUT=/tmp/std.tar.gz
+curl -o ${OUT} https://static.rust-lang.org/dist/rust-std-${RUST_VERSION}-${TARGET}.tar.gz
+
+WORKDIR=/tmp/std
+mkdir -p ${WORKDIR}
+cd ${WORKDIR}
+
+tar --strip-components=1 -xzf ${OUT}
+
+./install.sh
diff --git a/test/build_openssl.sh b/test/build_openssl.sh
new file mode 100755
index 00000000..124eabc9
--- /dev/null
+++ b/test/build_openssl.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+set -e
+
+if [ -d ~/openssl ]; then
+ exit 0
+fi
+
+case "${LIBRARY}" in
+"libressl")
+ URL1="http://ftp3.usa.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz"
+ URL2="http://ftp.eu.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz"
+ ;;
+"openssl")
+ URL1="https://openssl.org/source/openssl-${VERSION}.tar.gz"
+ URL2="http://mirrors.ibiblio.org/openssl/source/openssl-${VERSION}.tar.gz"
+ ;;
+esac
+
+case "${TARGET}" in
+"x86_64-unknown-linux-gnu")
+ OS_COMPILER=linux-x86_64
+ ;;
+"i686-unknown-linux-gnu")
+ OS_COMPILER=linux-elf
+ OS_FLAGS=-m32
+ ;;
+"arm-unknown-linux-gnueabihf")
+ OS_COMPILER=linux-armv4
+ export AR=arm-linux-gnueabihf-ar
+ export CC=arm-linux-gnueabihf-gcc
+ ;;
+esac
+
+mkdir -p /tmp/build
+cd /tmp/build
+
+OUT=/tmp/openssl.tgz
+MAX_REDIRECTS=5
+curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} ${URL1} \
+ || curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} ${URL2}
+
+tar --strip-components=1 -xzf ${OUT}
+
+PREFIX=${HOME}/openssl
+case "${LIBRARY}" in
+"openssl")
+ ./Configure --prefix=${PREFIX} ${OS_COMPILER} -fPIC ${OS_FLAGS} no-shared
+ ;;
+"libressl")
+ ./configure --prefix=${PREFIX} --disable-shared --with-pic
+ ;;
+esac
+
+make -j$(nproc)
+make install