dev-go/go-tour: DEPEND on go-net (bug 664376)
authorZac Medico <zmedico@gentoo.org>
Thu, 23 Aug 2018 17:44:14 +0000 (10:44 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 23 Aug 2018 17:50:48 +0000 (10:50 -0700)
Reported-by: Toralf Förster <toralf@gentoo.org>
Closes: https://bugs.gentoo.org/664376
Package-Manager: Portage-2.3.48, Repoman-2.3.10

dev-go/go-tour/go-tour-0_p20180810.ebuild

index b97a2e598afb5c42f5748d766a4fa100ed8a9e3e..0266d4dd62b2274433064e9803bcac516d03e24b 100644 (file)
@@ -15,17 +15,21 @@ SRC_URI="${ARCHIVE_URI}"
 LICENSE="BSD"
 SLOT="0"
 IUSE=""
-DEPEND="dev-go/go-tools:="
+DEPEND="dev-go/go-net:=
+       dev-go/go-tools:="
 
 src_compile() {
-       GOPATH="${S}:$(get_golibdir_gopath)" GOBIN="${S}/bin" \
-               go build -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
-       [[ -x $(find "${T}" -name a.out) ]] || die "a.out not found"
+       local x
+       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
+       GOPATH="${S}:${T}/golibdir" GOBIN="${S}/bin" \
+               go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
+       [[ -x bin/gotour ]] || die "gotour not found"
 }
 
 src_install() {
-       GOPATH="${S}:$(get_golibdir_gopath)" GOBIN="${S}/bin" \
-               go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
        exeinto "$(go env GOTOOLDIR)"
        newexe bin/gotour tour
        insinto "$(go env GOROOT)"
@@ -33,6 +37,6 @@ src_install() {
 }
 
 src_test() {
-       GOPATH="${S}:$(get_golibdir_gopath)" GOBIN="${S}/bin" \
+       GOPATH="${S}:${T}/golibdir" GOBIN="${S}/bin" \
                go test -v -work -x "${EGO_PN}" || die
 }