Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139417536
D54104.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
D54104.diff
View Options
Index: Mk/Uses/go.mk
===================================================================
--- Mk/Uses/go.mk
+++ Mk/Uses/go.mk
@@ -6,7 +6,8 @@
# Valid ARGS: (none), N.NN, N.NN-devel, modules, no_targets, run
#
# (none) Setup GOPATH and build in GOPATH mode using default Go version.
-# N.NN[-devel] Specify Go version
+# N.NN+ Specify minimum Go version
+# N.NN[-devel] Specify exact Go version (should be avoided)
# 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
@@ -73,14 +74,25 @@
GO_VALID_VERSIONS= 1.20 1.21 1.22 1.23 1.24 1.25 1.26-devel
# Check arguments sanity
-. if !empty(go_ARGS:N[1-9].[0-9][0-9]:N*-devel:Nmodules:Nno_targets:Nrun)
-IGNORE= USES=go has invalid arguments: ${go_ARGS:N[1-9].[0-9][0-9]:N*-devel:Nmodules:Nno_targets:Nrun}
+. if !empty(go_ARGS:N[1-9].[0-9][0-9]+:N[1-9].[0-9][0-9]:N[1-9].[0-9][0-9]-devel:Nmodules:Nno_targets:Nrun)
+IGNORE= USES=go has invalid arguments: ${go_ARGS:N[1-9].[0-9][0-9]+:N[1-9].[0-9][0-9]:N[1-9].[0-9][0-9]-devel:Nmodules:Nno_targets:Nrun}
. endif
# Parse Go version
-GO_VERSION= ${go_ARGS:Nmodules:Nno_targets:Nrun:C/^$/${GO_DEFAULT}/}
-. if empty(GO_VALID_VERSIONS:M${GO_VERSION})
+. if !empty(go_ARGS:M*+)
+GO_MIN_VERSION= ${go_ARGS:M*+:S/+//}
+. for version in ${GO_VALID_VERSIONS:[-1..1]}
+. if empty(GO_VERSION)
+. if ${version} == ${GO_DEFAULT} || ${version:S/-devel//} == ${GO_MIN_VERSION}
+GO_VERSION:= ${version}
+. endif
+. endif
+. endfor
+. else
+GO_VERSION:= ${go_ARGS:Nmodules:Nno_targets:Nrun:C/^$/${GO_DEFAULT}/}
+. if empty(GO_VALID_VERSIONS:M${GO_VERSION})
IGNORE?= USES=go has invalid version number: ${GO_VERSION}
+. endif
. endif
GO_SUFFIX= ${GO_VERSION:S/.//:C/.*-devel/-devel/}
GO_PORT= lang/go${GO_SUFFIX}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 12, 8:40 PM (6 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26912067
Default Alt Text
D54104.diff (1 KB)
Attached To
Mode
D54104: Uses/go.mk: Add support for requesting a minimum version
Attached
Detach File
Event Timeline
Log In to Comment