install.sh 1.3 KB

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