Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jul 2019 07:15:08 +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: r507340 - head/Mk/Uses
Message-ID:  <201907260715.x6Q7F8dw075300@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Fri Jul 26 07:15:08 2019
New Revision: 507340
URL: https://svnweb.freebsd.org/changeset/ports/507340

Log:
  Mk/Uses/go.mk: Default to "." instead of PORTNAME
  
  If neither GO_PKGNAME or GO_TARGET are set explicitly, go install
  tries to install a package named ${PORTNAME} which is almost always
  wrong.  This forces Go ports to set GO_PKGNAME or GO_TARGET although
  their value is often redundant.
  
  Update do-build to default to the "." package instead ("the package
  in the current directory") and teach do-install to install the "."
  package.  In many cases, this removes the need to explicitly set
  GO_PKGNAME and GO_TARGET making USES=go:modules alone sufficient
  for simpler ports.
  
  This is a backward compatible change.
  
  - Assign maintainership to Dmitri
  
  Submitted by:	Dmitri Goutnik <dg@syrec.org>
  Approved by:	jlaffaye (maintainer timeout, ~3 weeks)
  Differential Revision:	https://reviews.freebsd.org/D20813

Modified:
  head/Mk/Uses/go.mk

Modified: head/Mk/Uses/go.mk
==============================================================================
--- head/Mk/Uses/go.mk	Fri Jul 26 04:49:02 2019	(r507339)
+++ head/Mk/Uses/go.mk	Fri Jul 26 07:15:08 2019	(r507340)
@@ -48,7 +48,7 @@
 #
 #	This variable must not be set by individual ports!
 #
-# MAINTAINER: jlaffaye@FreeBSD.org
+# MAINTAINER: dg@syrec.org
 
 .if !defined(_INCLUDE_USES_GO_MK)
 _INCLUDE_USES_GO_MK=	yes
@@ -117,13 +117,13 @@ post-extract:
 .if !target(do-build) && empty(go_ARGS:Mno_targets)
 do-build:
 	(cd ${GO_WRKSRC}; \
-		${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install ${GO_BUILDFLAGS} ${GO_TARGET})
+		${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install ${GO_BUILDFLAGS} ${GO_TARGET:S/^${PORTNAME}$/./})
 .endif
 
 .if !target(do-install) && empty(go_ARGS:Mno_targets)
 do-install:
 .for _TARGET in ${GO_TARGET}
-	${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${_TARGET:T} ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${_TARGET:T:S/^.$/${PORTNAME}/} ${STAGEDIR}${PREFIX}/bin
 .endfor
 .endif
 



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