diff --git a/Dockerfile.release b/Dockerfile.release index 390bb848350e..3990fde82592 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -11,4 +11,4 @@ RUN \ WORKDIR /opt/crystal -CMD ["bash"] +CMD ["sh"] diff --git a/Makefile b/Makefile index a4b2281dc141..a6b2f5d1d43f 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,8 @@ SOURCES := $(shell find src -name '*.cr') SPEC_SOURCES := $(shell find spec -name '*.cr') FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static ) SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) ) -EXPORTS := $(if $(release),,CRYSTAL_CONFIG_PATH=`pwd`/src) -SHELL = bash +EXPORTS := $(if $(release),,CRYSTAL_CONFIG_PATH=$PWD/src) +SHELL = sh LLVM_CONFIG_FINDER := \ [ -n "$(LLVM_CONFIG)" ] && command -v "$(LLVM_CONFIG)" || \ command -v llvm-config-4.0 || command -v llvm-config40 || \ @@ -118,7 +118,7 @@ $(O)/crystal: $(DEPS) $(SOURCES) $(BUILD_PATH) $(EXPORTS) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr -D without_openssl -D without_zlib $(LLVM_EXT_OBJ): $(LLVM_EXT_DIR)/llvm_ext.cc - $(CXX) -c $(CXXFLAGS) -o $@ $< `$(LLVM_CONFIG) --cxxflags` + $(CXX) -c $(CXXFLAGS) -o $@ $< $(shell $(LLVM_CONFIG) --cxxflags) $(LIB_CRYSTAL_TARGET): $(LIB_CRYSTAL_OBJS) $(AR) -rcs $@ $^ diff --git a/Vagrantfile b/Vagrantfile index 83bcf8c3cec7..859f682dbf2a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -15,7 +15,7 @@ Vagrant.configure("2") do |config| c.vm.box = "ubuntu/#{box_name}" c.vm.provision :shell, inline: %( - curl -s https://dist.crystal-lang.org/apt/setup.sh | bash + curl -s https://dist.crystal-lang.org/apt/setup.sh | sh apt-get install -y crystal git libgmp3-dev zlib1g-dev libedit-dev libxml2-dev libssl-dev libyaml-dev libreadline-dev g++ curl -s https://crystal-lang.s3.amazonaws.com/llvm/llvm-3.5.0-1-linux-`uname -m`.tar.gz | tar xz -C /opt echo 'export LIBRARY_PATH="/opt/crystal/embedded/lib"' > /etc/profile.d/crystal.sh diff --git a/bin/ci b/bin/ci index bb6f327795ca..8606b3a0ddaa 100755 --- a/bin/ci +++ b/bin/ci @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh fail() { echo "${@}" >&2 @@ -90,8 +90,8 @@ build() { } deploy() { - export CURRENT_TAG=`git describe --tags --exact-match 2> /dev/null` - export GIT_VERSION=`git describe --tags --long --always 2>/dev/null` + export CURRENT_TAG=$(git describe --tags --exact-match 2> /dev/null) + export GIT_VERSION=$(git describe --tags --long --always 2>/dev/null) on_deploy 'echo $GIT_VERSION > docs/revision.txt' on_deploy aws s3 sync docs/ s3://crystal-api/api/$TRAVIS_BRANCH @@ -162,32 +162,34 @@ with_build_env() { on_linux docker run \ --rm -t \ -u $(id -u) \ - -v $(pwd):/mnt \ + -v $PWD:/mnt \ -w /mnt \ -e LIBRARY_PATH="${ARCH_LIBRARY_PATH:-/usr/lib/crystal/lib/}" \ -e CRYSTAL_CACHE_DIR="/tmp/crystal" \ "jhass/crystal-build-$ARCH" \ - "$ARCH_CMD" /bin/bash -c "'$command'" + "$ARCH_CMD" /bin/sh -c "'$command'" on_osx PATH="/usr/local/opt/llvm/bin:\$PATH" \ CRYSTAL_CACHE_DIR="/tmp/crystal" \ - /bin/bash -c "'$command'" + /bin/sh -c "'$command'" } usage() { - echo -e "bin/ci [-h|--help] command [parameter ...]" - echo -e "" - echo -e "Helper script to prepare and run the testsuite on Travis CI." - echo -e "" - echo -e "Commands:" - echo -e " prepare_system setup any necessaries repositories etc." - echo -e " prepare_build download and extract any dependencies needed for the build" - echo -e " build run specs, build crystal, run format check, build samples, build the docs" - echo -e " deploy deploy the docs" - echo -e " with_build_env command run command in the build environment" - echo -e " help display this" - echo -e "" + cat < /dev/null -then +elif ! command -v crystal > /dev/null; then __error_msg 'You need to have a crystal executable in your path!' exit 1 -elif [ "$(command -v crystal)" = "$SCRIPT_PATH" ] || [ "$(command -v crystal)" = "bin/crystal" ] -then +elif [ "$(command -v crystal)" = "$SCRIPT_PATH" ] || [ "$(command -v crystal)" = "bin/crystal" ]; then export PATH="$(remove_path_item "$(remove_path_item "$PATH" "$SCRIPT_ROOT")" "bin")" exec "$SCRIPT_PATH" "$@" else