tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[patch] New OS_VARIANT=OpenIndiana in bsd.prefs.mk



Hi all,

lang/go/version.mk has this snippet:

    55  .if ${OPSYS} == "SunOS" && ${OS_VARIANT} != "Solaris"
    56  GO_PLATFORM=            illumos_${GOARCH}
    57  .else
    58  GO_PLATFORM=            ${LOWER_OPSYS}_${GOARCH}
    59  .endif

bsd.prefs.mk doesn't have a check for Illumos-based OpenIndiana, so it 
falls back to setting OS_VARIANT to "Solaris". The wrong GO_PLATFORM is 
used and Go fails to build.

The attached patch adds logic for detecting OpenIndiana and its version 
in bsd.prefs.mk, and it fixes Go on OpenIndiana for me, but I felt it 
prudent to check with the list first.

OK to commit?

Sijmen
Index: mk/bsd.prefs.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.436
diff -u -r1.436 bsd.prefs.mk
--- mk/bsd.prefs.mk	30 Jul 2023 19:04:02 -0000	1.436
+++ mk/bsd.prefs.mk	10 Aug 2023 18:19:50 -0000
@@ -283,6 +283,7 @@
 LOWER_VENDOR?=		sun
 LOWER_OPSYS?=		solaris
 LOWER_OPSYS_VERSUFFIX=	2.${OS_VERSION:C/5.//}
+_SUN_RELEASE!=		head -n1 /etc/release
 .  if !defined(_UNAME_V)
 _UNAME_V!=		${UNAME} -v
 MAKEFLAGS+=		_UNAME_V=${_UNAME_V:Q}
@@ -292,10 +293,13 @@
 LOWER_VARIANT_VERSION=	${_UNAME_V:C/joyent_//}
 .  elif !empty(_UNAME_V:Momnios-*)
 OS_VARIANT=		OmniOS
-LOWER_VARIANT_VERSION!=	/usr/bin/awk '{ print $$3; exit 0; }' /etc/release
+LOWER_VARIANT_VERSION=	${_SUN_RELEASE:[3]}
 .  elif !empty(_UNAME_V:Mtribblix-*)
 OS_VARIANT=		Tribblix
-LOWER_VARIANT_VERSION!=	/usr/bin/awk '{ print $$2; exit 0; }' /etc/release
+LOWER_VARIANT_VERSION=	${_SUN_RELEASE:[2]}
+.  elif ${_SUN_RELEASE:[1]} == "OpenIndiana"
+OS_VARIANT=		OpenIndiana
+LOWER_VARIANT_VERSION=	${_SUN_RELEASE:[3]}
 .  else
 OS_VARIANT=		Solaris
 LOWER_VARIANT_VERSION=	${_UNAME_V}


Home | Main Index | Thread Index | Old Index