Skip to content
Myr

install from source

This file

Path

test/installation_iojs/install from source

39 lines · 1.4 KiB

Last changed by

[Tests] run every remaining test file: exec bits, fixes; add `check-exec` to CIJordan Harbandbefore adoptionc7d5d77

History of this file

Take it

1#!/bin/sh23\. ../common.sh45die () { echo "$@" ; exit 1; }67\. ../../nvm.sh89set -ex1011# Compiling io.js requires a period toolchain: python 2 (its `configure`),12# and gcc <= 5 (its bundled V8). CI compiles it for real in a gcc:4.913# container job; on modern toolchains, this can only be skipped14# (`install from fake source` covers nvm's source pipeline everywhere).15GCC_MAJOR="$(gcc -dumpversion 2>/dev/null | command cut -d. -f1)"16if ! command -v python2 >/dev/null 2>&1 && ! python -V 2>&1 | command grep -q '^Python 2'; then17  echo 'python 2 is not available; skipping the io.js source install'18  exit 019fi20case "${GCC_MAJOR}" in21  '' | *[!0-9]*) echo 'gcc is not available; skipping the io.js source install'; exit 0 ;;22esac23if [ "${GCC_MAJOR}" -gt 5 ]; then24  echo "gcc <= 5 is required to compile io.js, got ${GCC_MAJOR}; skipping the io.js source install"25  exit 026fi2728NVM_TEST_VERSION='v3.3.1'29NVM_PREFIXED_TEST_VERSION="iojs-${NVM_TEST_VERSION}"3031# Remove the stuff we're clobbering.32nvm uninstall "${NVM_TEST_VERSION}" || echo 'not installed'3334# Install from source35(watch nvm install -s "${NVM_PREFIXED_TEST_VERSION}") || die "'nvm install -s ${NVM_PREFIXED_TEST_VERSION}' failed"3637# Check38nvm_is_version_installed "${NVM_PREFIXED_TEST_VERSION}" || die 'version not installed'39nvm run --silent "${NVM_PREFIXED_TEST_VERSION}" --version | grep "${NVM_TEST_VERSION}" || die "'nvm run ${NVM_PREFIXED_TEST_VERSION} --version | grep ${NVM_TEST_VERSION}' failed"