Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161413256
D20735.id58946.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20735.id58946.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), build, modules, run
#
# (none) Setup GOPATH and build in GOPATH mode.
+# build Indicates that Go is used at build time as a part of
+# make/CMake build. This will setup build environment like
+# GO_ENV, GO_BUILDFLAGS but avoid creating post-extract, do-build
+# and do-install targets.
# modules If the upstream uses Go modules, this can be set to build
# in modules-aware mode.
+# 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.
#
@@ -47,8 +53,8 @@
.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) && ${go_ARGS:Nmodules:Nbuild:Nrun}
+IGNORE= USES=go has invalid arguments: ${go_ARGS:Nmodules:Nbuild: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:Mbuild)
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:Mbuild)
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, 1:15 PM (4 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34671386
Default Alt Text
D20735.id58946.diff (1 KB)
Attached To
Mode
D20735: Mk/Uses/go.mk: Add no_targets and run args
Attached
Detach File
Event Timeline
Log In to Comment