Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Aug 2019 17:23:16 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r508838 - head/Mk/Uses
Message-ID:  <201908131723.x7DHNGo0082307@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Tue Aug 13 17:23:16 2019
New Revision: 508838
URL: https://svnweb.freebsd.org/changeset/ports/508838

Log:
  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

Modified:
  head/Mk/Uses/go.mk

Modified: head/Mk/Uses/go.mk
==============================================================================
--- head/Mk/Uses/go.mk	Tue Aug 13 16:03:11 2019	(r508837)
+++ head/Mk/Uses/go.mk	Tue Aug 13 17:23:16 2019	(r508838)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908131723.x7DHNGo0082307>