bsd.prefs.mk OpenIndiana detection

Tobias Nygren <[email protected]> Mon, 13 Apr 2026 10:00:56 +0200
Newsgroups gmane.os.netbsd.devel.packages
Message-ID <[email protected]>
Hi,

I'd like to commit this patch to be able to fix some PLIST issues
on OpenIndiana. pkgsrc currently detects OpenIndiana as Solaris
instead of Illumos which breaks some packages like lang/go.

--- bsd.prefs.mk	22 Oct 2025 08:37:18 -0000	1.462
+++ bsd.prefs.mk	13 Apr 2026 07:53:25 -0000
@@ -287,6 +287,14 @@ NATIVE_LOWER_VARIANT_VERSION!=	/usr/bin/
 .  elif !empty(_UNAME_V:Mtribblix-*)
 NATIVE_OS_VARIANT=		Tribblix
 NATIVE_LOWER_VARIANT_VERSION!=	/usr/bin/awk '{ print $$2; exit 0; }' /etc/release
+.  elif !empty(_UNAME_V:Millumos-*)
+NATIVE_OS_VARIANT!=		/usr/bin/awk '{ print $$1; exit 0; }' /etc/release
+.    if ${NATIVE_OS_VARIANT} == "OpenIndiana"
+NATIVE_LOWER_VARIANT_VERSION!=	/usr/bin/awk '{ print $$3; exit 0; }' /etc/release
+.    else
+NATIVE_OS_VARIANT=		Solaris
+NATIVE_LOWER_VARIANT_VERSION=	${_UNAME_V}
+.    endif
 .  else
 NATIVE_OS_VARIANT=		Solaris
 NATIVE_LOWER_VARIANT_VERSION=	${_UNAME_V}

How this would affect pkgsrc:

Before:

# uname -v
illumos-5d086a7886
# head -n 1 /etc/release
             OpenIndiana Hipster 2025.10 (powered by illumos)
# /opt/pbulk/bin/bmake show-var VARNAME=OPSYS
SunOS
# /opt/pbulk/bin/bmake show-var VARNAME=OS_VARIANT
Solaris
# /opt/pbulk/bin/bmake show-var VARNAME=NATIVE_LOWER_VARIANT_VERSION
illumos-5d086a7886

After:

# /opt/pbulk/bin/bmake show-var VARNAME=OS_VARIANT
OpenIndiana
# /opt/pbulk/bin/bmake show-var VARNAME=NATIVE_LOWER_VARIANT_VERSION
2025.10

Any objections?

Kind regards,
-Tobias