Dero Web Wallet derosuite. This repo contains changes required for webwallet. With this changes any Dero daemon can become web wallet. All changes are related to daemon rpc server and wallet to make it light and faster.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.5KB

  1. #!/usr/bin/env bash
  2. package=$1
  3. package_split=(${package//\// })
  4. package_name=${package_split[-1]}
  5. CURDIR=`/bin/pwd`
  6. BASEDIR=$(dirname $0)
  7. ABSPATH=$(readlink -f $0)
  8. ABSDIR=$(dirname $ABSPATH)
  9. PLATFORMS="darwin/amd64" # amd64 only as of go1.5
  10. PLATFORMS="$PLATFORMS windows/amd64 windows/386" # arm compilation not available for Windows
  11. PLATFORMS="$PLATFORMS linux/amd64 linux/386"
  12. #PLATFORMS="$PLATFORMS linux/ppc64le" is it common enough ??
  13. #PLATFORMS="$PLATFORMS linux/mips64le" # experimental in go1.6 is it common enough ??
  14. PLATFORMS="$PLATFORMS freebsd/amd64 freebsd/386"
  15. PLATFORMS="$PLATFORMS netbsd/amd64" # amd64 only as of go1.6
  16. PLATFORMS="$PLATFORMS openbsd/amd64" # amd64 only as of go1.6
  17. PLATFORMS="$PLATFORMS dragonfly/amd64" # amd64 only as of go1.5
  18. #PLATFORMS="$PLATFORMS plan9/amd64 plan9/386" # as of go1.4, is it common enough ??
  19. # solaris disabled due to badger error below
  20. #vendor/github.com/dgraph-io/badger/y/mmap_unix.go:57:30: undefined: syscall.SYS_MADVISE
  21. #PLATFORMS="$PLATFORMS solaris/amd64" # as of go1.3
  22. #PLATFORMS_ARM="linux freebsd netbsd"
  23. PLATFORMS_ARM="linux freebsd"
  24. type setopt >/dev/null 2>&1
  25. SCRIPT_NAME=`basename "$0"`
  26. FAILURES=""
  27. CURRENT_DIRECTORY=${PWD##*/}
  28. OUTPUT="$package_name" # if no src file given, use current dir name
  29. for PLATFORM in $PLATFORMS; do
  30. GOOS=${PLATFORM%/*}
  31. GOARCH=${PLATFORM#*/}
  32. OUTPUT_DIR="${ABSDIR}/build/dero_${GOOS}_${GOARCH}"
  33. BIN_FILENAME="${OUTPUT}-${GOOS}-${GOARCH}"
  34. echo mkdir -p $OUTPUT_DIR
  35. if [[ "${GOOS}" == "windows" ]]; then BIN_FILENAME="${BIN_FILENAME}.exe"; fi
  36. CMD="GOOS=${GOOS} GOARCH=${GOARCH} go build -o $OUTPUT_DIR/${BIN_FILENAME} $package"
  37. echo "${CMD}"
  38. eval $CMD || FAILURES="${FAILURES} ${PLATFORM}"
  39. done
  40. # ARM64 builds only for linux
  41. if [[ $PLATFORMS_ARM == *"linux"* ]]; then
  42. GOOS="linux"
  43. GOARCH="arm64"
  44. OUTPUT_DIR="${ABSDIR}/build/dero_${GOOS}_${GOARCH}"
  45. CMD="GOOS=linux GOARCH=arm64 go build -o $OUTPUT_DIR/${OUTPUT}-linux-arm64 $package"
  46. echo "${CMD}"
  47. eval $CMD || FAILURES="${FAILURES} ${PLATFORM}"
  48. fi
  49. for GOOS in $PLATFORMS_ARM; do
  50. GOARCH="arm"
  51. # build for each ARM version
  52. for GOARM in 7 6 5; do
  53. OUTPUT_DIR="${ABSDIR}/build/dero_${GOOS}_${GOARCH}${GOARM}"
  54. BIN_FILENAME="${OUTPUT}-${GOOS}-${GOARCH}${GOARM}"
  55. CMD="GOARM=${GOARM} GOOS=${GOOS} GOARCH=${GOARCH} go build -o $OUTPUT_DIR/${BIN_FILENAME} $package"
  56. echo "${CMD}"
  57. eval "${CMD}" || FAILURES="${FAILURES} ${GOOS}/${GOARCH}${GOARM}"
  58. done
  59. done
  60. # eval errors
  61. if [[ "${FAILURES}" != "" ]]; then
  62. echo ""
  63. echo "${SCRIPT_NAME} failed on: ${FAILURES}"
  64. exit 1
  65. fi