src_compile() {
local x
+ # Create a temporary GOROOT, since otherwise the executable is not
+ # built if it happens to be installed already.
+ cp -rs "$(go env GOROOT)" "${T}/goroot" || die
+ rm -rf "${T}/goroot/"{pkg/tool/$(go env GOOS)_$(go env GOARCH)/tour,src/${EGO_PN%/...}} || die
mkdir -p "${T}/golibdir/src/golang.org/x" || die
for x in net tools; do
ln -s "$(get_golibdir_gopath)/src/golang.org/x/${x}" "${T}/golibdir/src/golang.org/x/${x}" || die
done
export -n GOCACHE XDG_CACHE_HOME #567192
- GOPATH="${S}:${T}/golibdir" GOBIN="${S}/bin" \
+ GOPATH="${S}:${T}/golibdir" GOBIN="${S}/bin" GOROOT=${T}/goroot \
go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
[[ -x bin/gotour ]] || die "gotour not found"
}