2015-02-21 12:38:37 +00:00
|
|
|
#
|
|
|
|
# This helper is for templates for Go packages.
|
|
|
|
#
|
|
|
|
|
2017-11-24 22:05:29 +00:00
|
|
|
do_configure() {
|
2018-09-19 00:29:24 +00:00
|
|
|
# $go_import_path must be set, or we can't link $PWD into $GOSRCPATH
|
|
|
|
if [ -z "$go_import_path" ]; then
|
|
|
|
msg_error "\"\$go_import_path\" not set on $pkgname template.\n"
|
|
|
|
fi
|
|
|
|
|
2018-09-19 00:41:08 +00:00
|
|
|
# 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
|
2017-11-24 22:05:29 +00:00
|
|
|
mkdir -p "$(dirname ${GOSRCPATH})"
|
|
|
|
ln -fs $PWD "${GOSRCPATH}"
|
2017-09-15 17:18:31 +00:00
|
|
|
fi
|
2017-11-24 22:05:29 +00:00
|
|
|
}
|
2017-09-15 17:18:31 +00:00
|
|
|
|
2017-11-24 22:05:29 +00:00
|
|
|
do_build() {
|
2015-04-17 16:18:35 +00:00
|
|
|
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() {
|
2015-08-22 18:42:02 +00:00
|
|
|
find "${GOPATH}/bin" -type f -executable | while read line
|
2015-06-12 11:21:10 +00:00
|
|
|
do
|
|
|
|
vbin "${line}"
|
2015-05-04 11:39:15 +00:00
|
|
|
done
|
2015-02-21 12:38:37 +00:00
|
|
|
}
|