summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-03-16 16:31:01 -0700
committerZac Medico <zmedico@gentoo.org>2019-03-16 16:32:37 -0700
commit3e91f887a86531b786674c7ead1532b96e496134 (patch)
tree2347bc7cd7c0d1a650adec1f0295ace507f6048c /dev-go/go-tour
parentdev-python/idna-ssl: keyword ~arm (diff)
downloadgentoo-3e91f887a86531b786674c7ead1532b96e496134.tar.gz
gentoo-3e91f887a86531b786674c7ead1532b96e496134.tar.bz2
gentoo-3e91f887a86531b786674c7ead1532b96e496134.zip
dev-go/go-tour: fix build with installed instance
Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'dev-go/go-tour')
-rw-r--r--dev-go/go-tour/go-tour-0_p20180810.ebuild6
1 files changed, 5 insertions, 1 deletions
diff --git a/dev-go/go-tour/go-tour-0_p20180810.ebuild b/dev-go/go-tour/go-tour-0_p20180810.ebuild
index 42d9aa99327c..c5967f041fa4 100644
--- a/dev-go/go-tour/go-tour-0_p20180810.ebuild
+++ b/dev-go/go-tour/go-tour-0_p20180810.ebuild
@@ -20,12 +20,16 @@ DEPEND="dev-go/go-net:=
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"
}