Wed Nov 15 15:54:40 2023 UTC ()
go: Add support for GO_VERSION_REQD.

This isn't full multi support like other languages yet, but for now simply a
way for a package to indicate that it requires a specific version of go.

Useful for things like wireguard-go which currently do not build with 1.21.


(jperkin)
diff -r1.194 -r1.195 pkgsrc/lang/go/version.mk

cvs diff -r1.194 -r1.195 pkgsrc/lang/go/version.mk (expand / switch to unified diff)

--- pkgsrc/lang/go/version.mk 2023/11/10 15:39:34 1.194
+++ pkgsrc/lang/go/version.mk 2023/11/15 15:54:40 1.195
@@ -1,32 +1,34 @@ @@ -1,32 +1,34 @@
1# $NetBSD: version.mk,v 1.194 2023/11/10 15:39:34 bsiegert Exp $ 1# $NetBSD: version.mk,v 1.195 2023/11/15 15:54:40 jperkin Exp $
2 2
3# 3#
4# If bsd.prefs.mk is included before go-package.mk in a package, then this 4# If bsd.prefs.mk is included before go-package.mk in a package, then this
5# file must be included directly in the package prior to bsd.prefs.mk. 5# file must be included directly in the package prior to bsd.prefs.mk.
6# 6#
7.include "go-vars.mk" 7.include "go-vars.mk"
8 8
9GO121_VERSION= 1.21.4 9GO121_VERSION= 1.21.4
10GO120_VERSION= 1.20.11 10GO120_VERSION= 1.20.11
11GO119_VERSION= 1.19.13 11GO119_VERSION= 1.19.13
12GO118_VERSION= 1.18.10 12GO118_VERSION= 1.18.10
13GO14_VERSION= 1.4.3 13GO14_VERSION= 1.4.3
14 14
15.include "../../mk/bsd.prefs.mk" 15.include "../../mk/bsd.prefs.mk"
16 16
17GO_VERSION_DEFAULT?= 121 17GO_VERSION_DEFAULT?= 121
18 18
19.if !empty(GO_VERSION_DEFAULT) 19.if defined(GO_VERSION_REQD)
 20GOVERSSUFFIX= ${GO_VERSION_REQD}
 21.elif !empty(GO_VERSION_DEFAULT)
20GOVERSSUFFIX= ${GO_VERSION_DEFAULT} 22GOVERSSUFFIX= ${GO_VERSION_DEFAULT}
21.endif 23.endif
22 24
23# How to find the Go tool 25# How to find the Go tool
24GO= ${PREFIX}/go${GOVERSSUFFIX}/bin/go 26GO= ${PREFIX}/go${GOVERSSUFFIX}/bin/go
25 27
26# Build dependency for Go 28# Build dependency for Go
27GO_PACKAGE_DEP= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION}*:../../lang/go${GOVERSSUFFIX} 29GO_PACKAGE_DEP= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION}*:../../lang/go${GOVERSSUFFIX}
28 30
29ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64 *-*-earmv[67]hf *-*-aarch64 31ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64 *-*-earmv[67]hf *-*-aarch64
30NOT_FOR_PLATFORM= SunOS-*-i386 32NOT_FOR_PLATFORM= SunOS-*-i386
31.if ${MACHINE_ARCH} == "i386" 33.if ${MACHINE_ARCH} == "i386"
32GOARCH= 386 34GOARCH= 386