svn commit: r507340 - head/Mk/Uses
Tobias Kortkamp
tobik at FreeBSD.org
Fri Jul 26 07:15:09 UTC 2019
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 at 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 at FreeBSD.org
+# MAINTAINER: dg at 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
More information about the svn-ports-all
mailing list