void-packages/common/build-style/go.sh

26 lines
600 B
Bash
Raw Normal View History

2015-02-21 12:38:37 +00:00
#
# This helper is for templates for Go packages.
#
do_configure() {
# This isn't really configuration, but its needed by packages
# that do unusual things with the build where the expect to be
# able to cd into the $GOSRCPATH
2015-02-21 12:38:37 +00:00
if [[ "${go_get}" != "yes" ]]; then
mkdir -p "$(dirname ${GOSRCPATH})"
ln -fs $PWD "${GOSRCPATH}"
2017-09-15 17:18:31 +00:00
fi
}
2017-09-15 17:18:31 +00:00
do_build() {
go_package=${go_package:-$go_import_path}
2016-05-02 22:32:48 +00:00
go get -x -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
2015-02-21 12:38:37 +00:00
}
do_install() {
find "${GOPATH}/bin" -type f -executable | while read line
do
vbin "${line}"
done
2015-02-21 12:38:37 +00:00
}