Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161368496
D20735.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D20735.id.diff
View Options
Index: Mk/Uses/go.mk
===================================================================
--- Mk/Uses/go.mk
+++ Mk/Uses/go.mk
@@ -5,11 +5,17 @@
#
# Feature: go
# Usage: USES=go
-# Valid ARGS: (none), modules
+# Valid ARGS: (none), modules, no_targets, run
#
# (none) Setup GOPATH and build in GOPATH mode.
# modules If the upstream uses Go modules, this can be set to build
# in modules-aware mode.
+# no_targets Indicates that Go is needed at build time as a part of
+# make/CMake build. This will setup build environment like
+# GO_ENV, GO_BUILDFLAGS but will not create post-extract, do-build
+# and do-install targets.
+# run Indicates that Go is needed at run time and adds it to
+# RUN_DEPENDS.
#
# You can set the following variables to control the process.
#
@@ -40,15 +46,15 @@
# The Go port to use. By default this is lang/go but can be set
# to lang/go-devel in make.conf for testing with future Go versions.
#
-# This variable should not be set by individual ports!
+# This variable must not be set by individual ports!
#
# MAINTAINER: jlaffaye@FreeBSD.org
.if !defined(_INCLUDE_USES_GO_MK)
_INCLUDE_USES_GO_MK= yes
-.if !empty(go_ARGS) && ${go_ARGS:Nmodules}
-IGNORE= USES=go only accepts no arguments or 'modules'
+.if !empty(go_ARGS:Nmodules:Nno_targets:Nrun)
+IGNORE= USES=go has invalid arguments: ${go_ARGS:Nmodules:Nno_targets:Nrun}
.endif
# Settable variables
@@ -91,6 +97,9 @@
GO_PORT?= lang/go
BUILD_DEPENDS+= ${GO_CMD}:${GO_PORT}
+.if ${go_ARGS:Mrun}
+RUN_DEPENDS+= ${GO_CMD}:${GO_PORT}
+.endif
PLIST_SUB+= GO_PKGNAME=${GO_PKGNAME}
_USES_POST+= go
@@ -105,13 +114,13 @@
@${LN} -sf ${WRKSRC} ${GO_WRKSRC}
.endif
-.if !target(do-build)
+.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})
.endif
-.if !target(do-install)
+.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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 4, 5:14 AM (5 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34619724
Default Alt Text
D20735.id.diff (2 KB)
Attached To
Mode
D20735: Mk/Uses/go.mk: Add no_targets and run args
Attached
Detach File
Event Timeline
Log In to Comment