2015-02-21 13:38:37 +01:00
|
|
|
#
|
|
|
|
# This helper is for templates for Go packages.
|
|
|
|
#
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2015-02-21 13:58:46 +01:00
|
|
|
export GOPATH="$(mktemp -d --tmpdir="${wrksrc}")"
|
2015-02-21 13:38:37 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2015-02-21 13:52:10 +01:00
|
|
|
go get -d -v "${go_import_path}"
|
|
|
|
go build -x "${go_import_path}"
|
2015-02-21 13:38:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
vbin ${pkgname}
|
|
|
|
}
|