2021-12-09 18:25:56 +01:00
|
|
|
# $NetBSD: version.mk,v 1.137 2021/12/09 17:25:56 bsiegert Exp $
|
2018-01-30 18:05:21 +01:00
|
|
|
|
2019-12-09 10:59:31 +01:00
|
|
|
#
|
|
|
|
# If bsd.prefs.mk is included before go-package.mk in a package, then this
|
|
|
|
# file must be included directly in the package prior to bsd.prefs.mk.
|
|
|
|
#
|
|
|
|
.include "go-vars.mk"
|
2014-11-18 21:39:11 +01:00
|
|
|
|
2021-12-09 18:25:56 +01:00
|
|
|
GO117_VERSION= 1.17.5
|
2021-12-09 18:13:49 +01:00
|
|
|
GO116_VERSION= 1.16.12
|
2019-01-24 10:33:08 +01:00
|
|
|
GO110_VERSION= 1.10.8
|
2018-07-08 20:40:40 +02:00
|
|
|
GO19_VERSION= 1.9.7
|
2015-09-26 19:37:01 +02:00
|
|
|
GO14_VERSION= 1.4.3
|
2014-11-18 21:39:11 +01:00
|
|
|
|
2019-12-09 10:59:31 +01:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2021-11-29 17:29:34 +01:00
|
|
|
.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 070000
|
2018-09-22 21:44:21 +02:00
|
|
|
# 1.9 is the last Go version to support NetBSD 6
|
|
|
|
GO_VERSION_DEFAULT?= 19
|
2021-11-29 17:29:34 +01:00
|
|
|
.elif ${OPSYS} == "Darwin" && ${OPSYS_VERSION} < 101000
|
2019-09-17 06:39:20 +02:00
|
|
|
# go 1.11 removed support for osx 10.8 and 10.9
|
|
|
|
# https://github.com/golang/go/issues/23122
|
|
|
|
# darwin version 13.4 is osx 10.9.5
|
|
|
|
GO_VERSION_DEFAULT?= 110
|
2018-09-22 21:44:21 +02:00
|
|
|
.else
|
2021-09-04 17:46:42 +02:00
|
|
|
GO_VERSION_DEFAULT?= 117
|
2018-09-22 21:44:21 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !empty(GO_VERSION_DEFAULT)
|
|
|
|
GOVERSSUFFIX= ${GO_VERSION_DEFAULT}
|
|
|
|
.endif
|
|
|
|
|
2018-07-08 15:53:42 +02:00
|
|
|
# How to find the Go tool
|
|
|
|
GO= ${PREFIX}/go${GOVERSSUFFIX}/bin/go
|
|
|
|
|
2018-09-22 21:44:21 +02:00
|
|
|
# Build dependency for Go
|
|
|
|
GO_PACKAGE_DEP= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION}*:../../lang/go${GOVERSSUFFIX}
|
|
|
|
|
2020-05-01 18:39:59 +02:00
|
|
|
ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64 *-*-earmv[67]hf *-*-aarch64
|
2014-11-18 21:39:11 +01:00
|
|
|
NOT_FOR_PLATFORM= SunOS-*-i386
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
2019-11-03 20:03:56 +01:00
|
|
|
GOARCH= 386
|
|
|
|
GOCHAR= 8
|
2014-11-18 21:39:11 +01:00
|
|
|
.elif ${MACHINE_ARCH} == "x86_64"
|
2019-11-03 20:03:56 +01:00
|
|
|
GOARCH= amd64
|
|
|
|
GOCHAR= 6
|
2018-01-20 17:55:05 +01:00
|
|
|
.elif ${MACHINE_ARCH} == "earmv6hf" || ${MACHINE_ARCH} == "earmv7hf"
|
2019-11-03 20:03:56 +01:00
|
|
|
GOARCH= arm
|
|
|
|
GOCHAR= 5
|
2020-05-01 18:39:59 +02:00
|
|
|
.elif ${MACHINE_ARCH} == "aarch64"
|
|
|
|
GOARCH= arm64
|
|
|
|
GOOPT= GOARM=7
|
|
|
|
# GOHOSTARCH is being misdetected as arm on NetBSD. Unclear why.
|
|
|
|
GOOPT+= GOHOSTARCH=arm64
|
2014-11-18 21:39:11 +01:00
|
|
|
.endif
|
2018-01-20 17:55:05 +01:00
|
|
|
.if ${MACHINE_ARCH} == "earmv6hf"
|
2019-11-03 20:03:56 +01:00
|
|
|
GOOPT= GOARM=6
|
2018-01-20 17:55:05 +01:00
|
|
|
.elif ${MACHINE_ARCH} == "earmv7hf"
|
2019-11-03 20:03:56 +01:00
|
|
|
GOOPT= GOARM=7
|
2018-01-20 17:55:05 +01:00
|
|
|
.endif
|
2019-11-03 20:03:56 +01:00
|
|
|
GO_PLATFORM= ${LOWER_OPSYS}_${GOARCH}
|
|
|
|
PLIST_SUBST+= GO_PLATFORM=${GO_PLATFORM:Q} GOARCH=${GOARCH:Q}
|
|
|
|
PLIST_SUBST+= GOCHAR=${GOCHAR:Q}
|
2018-10-26 15:49:23 +02:00
|
|
|
|
|
|
|
PRINT_PLIST_AWK+= { sub("/${GO_PLATFORM}/", "/$${GO_PLATFORM}/") }
|
2019-12-07 19:15:13 +01:00
|
|
|
|
|
|
|
TOOLS_CREATE+= go
|
|
|
|
TOOLS_PATH.go= ${GO}
|