summaryrefslogtreecommitdiff
path: root/Mk/Uses/go.mk
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2019-08-13 17:23:16 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2019-08-13 17:23:16 +0000
commita2fc071fe3a1da6b0b70f493b82148247d104e41 (patch)
treeb4ea77bd397ad546d13af6171aa5e780262f7e43 /Mk/Uses/go.mk
parentConvert to UCL & cleanup pkg-message (categories e-g) (diff)
Mk/Uses/go.mk: Add gomod-vendor helper target
For USES=go:modules ports it simplifies generating GH_TUPLE by calling modules2tuple in the right directory etc. Submitted by: Dmitri Goutnik <dg@syrec.org> (maintainer) Differential Revision: https://reviews.freebsd.org/D21246
Notes
Notes: svn path=/head/; revision=508838
Diffstat (limited to 'Mk/Uses/go.mk')
-rw-r--r--Mk/Uses/go.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk
index 56442bd99a82..a087b4bb1fa6 100644
--- a/Mk/Uses/go.mk
+++ b/Mk/Uses/go.mk
@@ -126,4 +126,17 @@ do-install:
.endfor
.endif
+# Helper targets for port maintainers
+
+.if ${go_ARGS:Mmodules}
+_MODULES2TUPLE_CMD= modules2tuple
+gomod-vendor: patch
+ @if type ${_MODULES2TUPLE_CMD} > /dev/null 2>&1; then \
+ cd ${WRKSRC}; ${GO_CMD} mod vendor; \
+ [ -r vendor/modules.txt ] && ${_MODULES2TUPLE_CMD} vendor/modules.txt; \
+ else \
+ ${ECHO_MSG} "===> Please install \"ports-mgmt/modules2tuple\""; \
+ fi
+.endif
+
.endif # defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_GO_POST_MK)