vp-build/common/build-style/go.sh

23 lines
458 B
Bash
Raw Normal View History

2015-02-21 13:38:37 +01:00
#
# This helper is for templates for Go packages.
#
do_build() {
if [[ "${go_get}" != "yes" ]]; then
2015-02-21 13:52:10 +01:00
local path="${GOPATH}/src/${go_import_path}"
2015-02-21 13:38:37 +01:00
mkdir -p "$(dirname ${path})"
ln -fs $PWD "${path}"
fi
go_package=${go_package:-$go_import_path}
cd "${GOPATH}/src/${go_package}"
go get -d "${go_package}"
go build -x "${go_package}"
2015-02-21 13:38:37 +01:00
}
do_install() {
go_package=${go_package:-$go_import_path}
cd "${GOPATH}/src/${go_package}"
2015-02-21 13:38:37 +01:00
vbin ${pkgname}
}