pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/go Use the non-symlinked go tool for package builds.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/267e7b2b73a4
branches:  trunk
changeset: 310236:267e7b2b73a4
user:      bsiegert <bsiegert%pkgsrc.org@localhost>
date:      Sun Jul 08 12:55:00 2018 +0000

description:
Use the non-symlinked go tool for package builds.

Otherwise, you will not be able to build Go code in pkgsrc if you do not
have pkg_alternatives installed.

Introduce a variable (user-settable for now) GOVERSSUFFIX.
$GO is now the Go tool with full path.

leot@ convinced me to go full Python (e.g. one directory per major version,
GO_VERSION_ACCEPTED etc.) but that will be another series of commits.

diffstat:

 lang/go/go-package.mk |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 45f1f5c68a4f -r 267e7b2b73a4 lang/go/go-package.mk
--- a/lang/go/go-package.mk     Sun Jul 08 12:23:06 2018 +0000
+++ b/lang/go/go-package.mk     Sun Jul 08 12:55:00 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: go-package.mk,v 1.12 2018/06/05 15:42:20 leot Exp $
+# $NetBSD: go-package.mk,v 1.13 2018/07/08 12:55:00 bsiegert Exp $
 #
 # This file implements common logic for compiling Go programs in pkgsrc.
 #
@@ -51,6 +51,11 @@
 
 .include "../../lang/go/version.mk"
 
+# How to find the Go tool.
+GOVERSSUFFIX?=
+GO=                    ${PREFIX}/go${GOVERSSUFFIX}/bin/go
+
+
 _GO_DIST_BASE!=                basename ${GO_SRCPATH}
 GO_DIST_BASE?=         ${_GO_DIST_BASE}
 GO_BUILD_PATTERN?=     ${GO_SRCPATH}/...
@@ -79,12 +84,12 @@
 
 .if !target(do-build)
 do-build:
-       ${RUN} env GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg go install -v ${GO_BUILD_PATTERN}
+       ${RUN} env GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg ${GO} install -v ${GO_BUILD_PATTERN}
 .endif
 
 .if !target(do-test)
 do-test:
-       ${RUN} env GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg go test -v ${GO_BUILD_PATTERN}
+       ${RUN} env GOPATH=${WRKDIR}:${BUILDLINK_DIR}/gopkg ${GO} test -v ${GO_BUILD_PATTERN}
 .endif
 
 .if !target(do-install)



Home | Main Index | Thread Index | Old Index