aboutsummaryrefslogtreecommitdiff
path: root/Mk/Uses/go.mk
diff options
context:
space:
mode:
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)