travis-racket/install-racket.sh
Greg Hendershott c3a5f7e085 Add RACKET_EDITION to install-racket.sh
Note: I'm committing this without also updating the example .travis.yml,
in order to test the case where RACKET_EDITION is not specified at
all (e.g. for backward compatability with existing .travis.yml files).
In that case it should act like RACKET_EDITION=FULL.
2015-05-18 14:23:33 -04:00

68 lines
2.4 KiB
Bash
Executable File

# IMPORTANT: Your .travis.yml must pipe this to bash (not to sh)!
# In the Travis CI environment a #!/bin/bash shebang here won't help.
set -e
if [[ "$RACKET_EDITION" = "" ]]; then
RACKET_EDITION = "FULL"
fi
if [[ "$RACKET_VERSION" = "HEAD" ]]; then
if [[ "$RACKET_EDITION" = "MINIMAL" ]]; then
URL="http://plt.eecs.northwestern.edu/snapshots/current/installers/min-racket-current-x86_64-linux-precise.sh"
else
URL="http://plt.eecs.northwestern.edu/snapshots/current/installers/racket-test-current-x86_64-linux-precise.sh"
fi
elif [[ "$RACKET_VERSION" = "SCOPE_SNAPSHOT" ]]; then
URL="http://www.cs.utah.edu/~mflatt/tmp/scope-snapshot/installers/racket-6.2.900.3-x86_64-linux.sh"
elif [[ "$RACKET_VERSION" = 5.9* ]]; then
if [[ "$RACKET_EDITION" = "MINIMAL" ]]; then
URL="http://mirror.racket-lang.org/installers/${RACKET_VERSION}/racket-minimal-${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh"
else
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-quantal.sh"
fi
elif [[ "$RACKET_VERSION" = 6.* ]]; then
if [[ "$RACKET_EDITION" = "MINIMAL" ]]; then
URL="http://mirror.racket-lang.org/installers/${RACKET_VERSION}/racket-minimal-${RACKET_VERSION}-x86_64-linux-ubuntu-precise.sh"
else
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket-${RACKET_VERSION}-x86_64-linux-ubuntu-precise.sh"
fi
else
if [[ "$RACKET_EDITION" = "MINIMAL" ]]; then
URL="http://mirror.racket-lang.org/installers/${RACKET_VERSION}/racket-textual/racket-textual-${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh"
else
URL="http://download.racket-lang.org/installers/${RACKET_VERSION}/racket/racket-${RACKET_VERSION}-bin-x86_64-linux-debian-squeeze.sh"
fi
fi
# Older .travis.yml files don't set $RACKET_DIR (the Racket install
# directory) explicitly and expect it to be /usr/racket.
if [[ "$RACKET_DIR" = "" ]]; then
RACKET_DIR=/usr/racket
fi
INSTALLER="./racket-${RACKET_VERSION}.sh"
echo "Downloading $URL to $INSTALLER:"
curl -L -o $INSTALLER $URL
echo "Making $INSTALLER executable:"
chmod u+rx "$INSTALLER"
# Only use sudo if installing to /usr
if [[ "$RACKET_DIR" = /usr* ]]; then
RUN_INSTALLER="sudo ${INSTALLER}"
else
RUN_INSTALLER="${INSTALLER}"
fi
echo "Running $RUN_INSTALLER to install Racket:"
$RUN_INSTALLER <<EOF
no
"$RACKET_DIR"
EOF
exit 0