set Go env vars in environment

This way, a template can overwrite do_build but still have good defaults
for GOPATH, GOARCH and GOARM.
This commit is contained in:
Dominik Honnef 2015-02-21 14:34:03 +01:00
parent 92c77a10ec
commit a62f407007
3 changed files with 14 additions and 21 deletions

View file

@ -3,22 +3,13 @@
#
do_build() {
case "$XBPS_TARGET_MACHINE" in
armv6*) export GOARCH=arm; export GOARM=6;;
armv7*) export GOARCH=arm; export GOARM=7;;
i686*) export GOARCH=386;;
x86_64*) export GOARCH=amd64;;
esac
export GOPATH="$(mktemp -d --tmpdir="${wrksrc}")"
if [[ "${go_get}" != "yes" ]]; then
local path="${GOPATH}/src/${go_import_path}"
mkdir -p "$(dirname ${path})"
ln -fs $PWD "${path}"
fi
go get -d -v "${go_import_path}"
go get -d "${go_import_path}"
go build -x "${go_import_path}"
}