diff --git a/Makefile b/Makefile index d2a920d..9fed5dc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Jahway603 & The Hush Developers +# Copyright (c) 2021-2022 Jahway603 & The Hush Developers # Released under the GPLv3 # # Hush Lightwalletd Makefile diff --git a/cmd/server/main_test.go b/cmd/server/main_test.go index 77cf485..0709c4e 100644 --- a/cmd/server/main_test.go +++ b/cmd/server/main_test.go @@ -1,4 +1,4 @@ -// Copyright 2021 The Hush developers +// Copyright 2021-2022 The Hush developers // Released under the GPLv3 package main diff --git a/util/build-debian-package-SBC.sh b/util/build-debian-package-SBC.sh index ffbd5cc..5deba16 100755 --- a/util/build-debian-package-SBC.sh +++ b/util/build-debian-package-SBC.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2021 The Hush developers +# Copyright (c) 2021-2022 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html # diff --git a/util/build-debian-package.sh b/util/build-debian-package.sh index 6681111..ec4c5bc 100755 --- a/util/build-debian-package.sh +++ b/util/build-debian-package.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2021 The Hush developers +# Copyright (c) 2021-2022 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html # diff --git a/util/build.sh b/util/build.sh index 9e634c8..a87a0b2 100755 --- a/util/build.sh +++ b/util/build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2021 The Hush Developers +# Copyright 2021-2022 The Hush Developers # Distributed under the GPLv3 software license, see the accompanying # file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -36,7 +36,14 @@ echo "" echo "You have at least go 1.13.0 installed, so starting to compile Hush lightwalletd for you..." cd `pwd`/cmd/server go build -o lightwalletd main.go -mv lightwalletd `pwd`/../../lightwalletd -echo "" -echo "Hush lightwalletd is now compiled for you. Enjoy and reach out if you need support." -echo "For options, run ./lightwalletd --help" +# check if compile was success +if [ $? -ne 0 ]; then + echo "" + echo 'Error: Something went wrong and lightwalletd did not build successfully... Please reach out if you need support.' >&2 + exit 1 +else + mv lightwalletd `pwd`/../../lightwalletd + echo "" + echo "Hush lightwalletd is now compiled for you. Enjoy and reach out if you need support." + echo "For options, run ./lightwalletd --help" +fi diff --git a/util/build_arm.sh b/util/build_arm.sh index 63ddd79..4c034f1 100755 --- a/util/build_arm.sh +++ b/util/build_arm.sh @@ -1,15 +1,24 @@ #!/usr/bin/env bash -# Copyright 2021 The Hush Developers +# Copyright 2021-2022 The Hush Developers # Distributed under the GPLv3 software license, see the accompanying # file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html # # Purpose: Script to build the ARM or aarch64 architecture, # which is what the PinePhone boards are running +# Check if go is installed on system... +v=`go version | { read _ _ v _; echo ${v#go}; }` +function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } # Check if go is installed on system and exits if it is not if ! [ -x "$(command -v go)" ]; then echo 'Error: go is not installed. Install go and try again.' >&2 exit 1 +# If go is installed, then check system for at least version 1.13.0 +elif [ $(version $v) -lt $(version "1.13.0") ]; then + echo 'Error: the go version you have installed requires at least version 1.13, which your system does not have installed. Install a newer version of go and try again.' >&2 + echo '' + echo "Try out gobrew to install a newer version than what your OS package manager supplies." + exit 1 fi echo "" @@ -24,11 +33,19 @@ echo "+------'+------'+------'+------'+------'+------'+------'+------'+------'+- # now to compiling... echo "" -echo "You have go installed, so starting to compile Hush lightwalletd for you..." +echo "You have at least go 1.13.0 installed, so starting to compile Hush lightwalletd for you..." cd `pwd`/cmd/server env GOOS=linux GOARCH=arm64 go build -o lightwalletd_aarch64 main.go -mv lightwalletd_aarch64 lightwalletd -mv lightwalletd `pwd`/../../lightwalletd -echo "" -echo "Hush lightwalletd is now compiled for your ARM farm or Pine Rock64. Enjoy and reach out if you need support." -echo "For options, run ./lightwalletd --help" +# check if compile was success +if [ $? -ne 0 ]; then + echo "" + echo 'Error: Something went wrong and lightwalletd did not build successfully... Please reach out if you need support.' >&2 + exit 1 +else + mv lightwalletd_aarch64 lightwalletd + mv lightwalletd `pwd`/../../lightwalletd + echo "" + echo "Hush lightwalletd is now compiled for your ARM farm or Pine Rock64. Enjoy and reach out if you need support." + echo "For options, run ./lightwalletd --help" +fi +