pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/go go: Add support for GO_EXTRA_MOD_DIRS.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cff359596526
branches:  trunk
changeset: 459404:cff359596526
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Wed Oct 06 10:30:22 2021 +0000

description:
go: Add support for GO_EXTRA_MOD_DIRS.

This is a list of extra directories in which to look for go.mod files
when generating the output of show-go-modules.

diffstat:

 lang/go/go-module.mk |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 04d5eb386576 -r cff359596526 lang/go/go-module.mk
--- a/lang/go/go-module.mk      Wed Oct 06 10:25:32 2021 +0000
+++ b/lang/go/go-module.mk      Wed Oct 06 10:30:22 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: go-module.mk,v 1.6 2020/11/03 18:44:13 tnn Exp $
+# $NetBSD: go-module.mk,v 1.7 2021/10/06 10:30:22 jperkin Exp $
 #
 # This file implements common logic for compiling Go programs in pkgsrc.
 #
@@ -15,6 +15,11 @@
 #      List of dependency files to be downloaded from the Go module proxy.
 #      Can be filled out from the output of "make show-go-modules".
 #
+# GO_EXTRA_MOD_DIRS (optional)
+#
+#      List of additional directories in which to look for go.mod files for
+#      the show-go-modules target.
+#
 # Keywords: go golang
 #
 
@@ -27,6 +32,7 @@
 .include "../../lang/go/version.mk"
 
 GO_BUILD_PATTERN?=     ...
+GO_EXTRA_MOD_DIRS?=
 
 MAKE_JOBS_SAFE=                no
 INSTALLATION_DIRS+=    bin
@@ -56,6 +62,9 @@
 .PHONY: show-go-modules
 show-go-modules: ${WRKDIR}/.extract_done
        ${RUN} cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} GOPROXY= ${GO} mod download -x
+.for dir in ${GO_EXTRA_MOD_DIRS}
+       ${RUN} cd ${dir} && ${PKGSRC_SETENV} ${MAKE_ENV} GOPROXY= ${GO} mod download -x
+.endfor
        ${RUN} ${PRINTF} '# $$%s$$\n\n' NetBSD
        ${RUN} cd ${WRKDIR}/.gopath/pkg/mod/cache/download && ${FIND} . -type f -a \( -name "*.mod" -o -name "*.zip" \) | ${SED} -e 's/\.\//GO_MODULE_FILES+=   /' | ${SORT}
 
@@ -75,7 +84,7 @@
        ${RUN} [ -d ${WRKDIR}/.gopath ] && chmod -R +w ${WRKDIR}/.gopath || true
 
 _VARGROUPS+=           go
-_PKG_VARS.go=          GO_BUILD_PATTERN
+_PKG_VARS.go=          GO_BUILD_PATTERN GO_MODULE_FILES GO_EXTRA_MOD_DIRS
 _USER_VARS.go=         GO_VERSION_DEFAULT
 _SYS_VARS.go=          GO GO_VERSION GOVERSSUFFIX GOARCH GOCHAR \
                        GOOPT GOTOOLDIR GO_PLATFORM



Home | Main Index | Thread Index | Old Index