#!/bin/bash 

set -xeuo

if [ "$(uname)" == "Darwin" ]; then
    # Apparently the Home variable isn't set correctly
    export HOME="/Users/distiller"
    export HOME=`pwd`

    # According to https://github.com/rust-lang/cargo/issues/2422#issuecomment-198458960 remove circle ci default configuration solve cargo trouble
    #git config --global --unset url.ssh://git@github.com.insteadOf 
fi


# build statically linked binary with Rust
RUST_BACKTRACE=1 C_INCLUDE_PATH="${PREFIX}/include" LD_LIBRARY_PATH="${PREFIX}/lib" \
    cargo install --no-track --verbose --root "${PREFIX}" --path .
