At Sat, 5 Mar 2022 11:06:13 -0600, Jason Bacon <outpaddling%yahoo.com@localhost> wrote:
Subject: Re: GO on macOS Monterrey
Index: lang/go/bootstrap.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/lang/go/bootstrap.mk,v
retrieving revision 1.7
diff -u -r1.7 bootstrap.mk
--- lang/go/bootstrap.mk 14 Jul 2021 14:32:04 -0000 1.7
+++ lang/go/bootstrap.mk 4 Mar 2022 22:56:47 -0000
@@ -1,7 +1,7 @@
# $NetBSD: bootstrap.mk,v 1.7 2021/07/14 14:32:04 jperkin Exp $
.if !defined(GOROOT_BOOTSTRAP) || !exists(${GOROOT_BOOTSTRAP}/bin/go)
-. if ${MACHINE_ARCH} == "aarch64"
+. if ${MACHINE_ARCH} == "aarch64" || (${OPSYS} == "Darwin" && ${OSX_VERSION:R} >= 12)
BUILD_DEPENDS+= go-bin-[0-9]*:../../lang/go-bin
GOROOT_BOOTSTRAP= ${PREFIX}/go-bin
. else
I was pondering what it would take to automate this dependency
chain. If this works, it looks like a no-brainer that should be
committed ASAP. I assume you have fully tested it?
Not fully tested yet, no, but it works on any "Darwin" platform!
Despite decades of working with Makefiles I still struggle knowing when
macro uses can be combined into the same expression, or might have to be
protected with ".if defined(MACRO)", or protected with a default value,
etc. Generally I try to write my own Makefiles such that all macros are
always defined with appropriate defaults, but that is not the case in
pkgsrc (and it would be rather difficult to maintain if that were a goal).
For example here it might have to be written something more like:
. if ${MACHINE_ARCH} == "aarch64" || (${OPSYS} == "Darwin" && ${OSX_VERSION:U0.0:R} >= 12)
and then I'm assuming :U and :R can be successfully combined in that way
(the manual suggests so, but I find these things still need testing to
be sure they are correct in all scenarios, especially when there are no
apparent similar examples elsewhere in the infrastructure).
--
Greg A. Woods <gwoods%acm.org@localhost>
Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>