github.com/karalabe/go-ethereum@v0.8.5/install.sh (about)

     1  #!/bin/sh
     2  
     3  if [ "$1" == "" ]; then
     4  	echo "Usage $0 executable branch"
     5  	echo "executable    ethereum | mist"
     6  	echo "branch        develop | master"
     7  	exit
     8  fi
     9  
    10  exe=$1
    11  path=$exe
    12  branch=$2
    13  
    14  if [ "$branch" == "develop" ]; then
    15  	path="cmd/$exe"
    16  fi
    17  
    18  # Test if go is installed
    19  command -v go >/dev/null 2>&1 || { echo >&2 "Unable to find 'go'. This script requires go."; exit 1; }
    20  
    21  # Test if $GOPATH is set
    22  if [ "$GOPATH" == "" ]; then
    23  	echo "\$GOPATH not set"
    24  	exit
    25  fi
    26  
    27  echo "changing branch to $branch"
    28  cd $GOPATH/src/github.com/ethereum/go-ethereum
    29  git checkout $branch
    30  
    31  # installing package dependencies doesn't work for develop
    32  # branch as go get always pulls from master head
    33  # so build will continue to fail, but this installs locally
    34  # for people who git clone since go install will manage deps
    35  
    36  #echo "go get -u -d github.com/ethereum/go-ethereum/$path"
    37  #go get -v -u -d github.com/ethereum/go-ethereum/$path
    38  #if [ $? != 0 ]; then
    39  #	echo "go get failed"
    40  #	exit
    41  #fi
    42  
    43  cd $GOPATH/src/github.com/ethereum/go-ethereum/$path
    44  
    45  if [ "$exe" == "mist" ]; then
    46  	echo "Building Mist GUI. Assuming Qt is installed. If this step"
    47  	echo "fails; please refer to: https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go)"
    48  else
    49  	echo "Building ethereum CLI."
    50  fi
    51  
    52  go install
    53  echo "done. Please run $exe :-)"