Move most of the version selection logic into version.mk.

Provide a new variable, GO_PACKAGE_DEP, with the correct dependency on
the user-selected Go version, to be used for fixing syncthing and friends.
This commit is contained in:
bsiegert 2018-09-22 19:44:21 +00:00
parent b9376c1d2e
commit 7064d10572
2 changed files with 22 additions and 21 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: go-package.mk,v 1.17 2018/09/21 20:35:56 bsiegert Exp $ # $NetBSD: go-package.mk,v 1.18 2018/09/22 19:44:21 bsiegert Exp $
# #
# This file implements common logic for compiling Go programs in pkgsrc. # This file implements common logic for compiling Go programs in pkgsrc.
# #
@ -41,12 +41,11 @@
# 2. Install binaries into bin/. # 2. Install binaries into bin/.
# 3. Install source code and packages into a separate gopkg tree. # 3. Install source code and packages into a separate gopkg tree.
# #
# In the future, we may implement buildlink by creating a separate tree during # We implement buildlink by creating a separate tree during the build and
# the build and linking only the packages explicitly mentioned in dependencies # linking only the packages explicitly mentioned in dependencies there.
# there.
# #
# All packages build-depend on the "master" Go release. Go packages # All packages build-depend on the default Go release. Go packages should be
# need to be revbumped when lang/go is updated. # revbumped when that package is updated.
# #
.include "../../lang/go/version.mk" .include "../../lang/go/version.mk"
@ -57,23 +56,12 @@ GO_BUILD_PATTERN?= ${GO_SRCPATH}/...
WRKSRC= ${WRKDIR}/src/${GO_SRCPATH} WRKSRC= ${WRKDIR}/src/${GO_SRCPATH}
.if ${OPSYS} == "NetBSD" && ${OS_VERSION:M6.*}
# 1.9 is the last Go version to support NetBSD 6
GO_VERSION_DEFAULT?= 19
.else
GO_VERSION_DEFAULT?= 111
.endif
.if !empty(GO_VERSION_DEFAULT)
GOVERSSUFFIX= ${GO_VERSION_DEFAULT}
.endif
BUILD_DEPENDS+= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION}*:../../lang/go${GOVERSSUFFIX}
MAKE_JOBS_SAFE= no MAKE_JOBS_SAFE= no
INSTALLATION_DIRS+= bin gopkg INSTALLATION_DIRS+= bin gopkg
USE_TOOLS+= pax USE_TOOLS+= pax
BUILD_DEPENDS+= ${GO_PACKAGE_DEP}
GO_PLATFORM= ${LOWER_OPSYS}_${GOARCH} GO_PLATFORM= ${LOWER_OPSYS}_${GOARCH}
GOTOOLDIR= ${PREFIX}/go/pkg/tool/${GO_PLATFORM} GOTOOLDIR= ${PREFIX}/go/pkg/tool/${GO_PLATFORM}

View file

@ -1,4 +1,4 @@
# $NetBSD: version.mk,v 1.44 2018/09/18 20:52:11 bsiegert Exp $ # $NetBSD: version.mk,v 1.45 2018/09/22 19:44:21 bsiegert Exp $
SSP_SUPPORTED= no SSP_SUPPORTED= no
@ -10,10 +10,23 @@ GO19_VERSION= 1.9.7
GO14_VERSION= 1.4.3 GO14_VERSION= 1.4.3
GO_VERSION= ${GO110_VERSION} GO_VERSION= ${GO110_VERSION}
.if ${OPSYS} == "NetBSD" && ${OS_VERSION:M6.*}
# 1.9 is the last Go version to support NetBSD 6
GO_VERSION_DEFAULT?= 19
.else
GO_VERSION_DEFAULT?= 111
.endif
.if !empty(GO_VERSION_DEFAULT)
GOVERSSUFFIX= ${GO_VERSION_DEFAULT}
.endif
# How to find the Go tool # How to find the Go tool
GOVERSSUFFIX?=
GO= ${PREFIX}/go${GOVERSSUFFIX}/bin/go GO= ${PREFIX}/go${GOVERSSUFFIX}/bin/go
# Build dependency for Go
GO_PACKAGE_DEP= go${GOVERSSUFFIX}-${GO${GOVERSSUFFIX}_VERSION}*:../../lang/go${GOVERSSUFFIX}
ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64 *-*-earmv[67]hf ONLY_FOR_PLATFORM= *-*-i386 *-*-x86_64 *-*-earmv[67]hf
NOT_FOR_PLATFORM= SunOS-*-i386 NOT_FOR_PLATFORM= SunOS-*-i386
.if ${MACHINE_ARCH} == "i386" .if ${MACHINE_ARCH} == "i386"