Download raw body.
Tcl extensions for Tcl 8 and 9
On Wed, 8 Jul 2026, Stuart Henderson wrote:
> An important part of this is that where you have a file where the
> names differ for Tcl8/Tcl9 but it's broadly equivalent (i.e. the
> loadable .so, or the linkable library), it's represented by a
> single PLIST entry that uses variables to expand to the relevant
> filename for the current flavour.
>
> You just want to have an @comment/"" variable to 'turn off' the
> files that you don't want in one of the flavours, rather than using
> them for "either/or" lines in PLISTs.
>
> That way you just need to make sure you're using the correct flavour
> (presumably Tcl9) which includes pkgIndex etc when you generate the
> PLIST, and life is much much easier for updates/new ports. Otherwise
> you need to reinstate the lines for the other of the "either/or"
> options (or deal with a PLIST and a couple of PFRAG files).
>
The comment var might be too much.
New variables for Tcl 8/9 ports.
Index: tcl.port.mk
===================================================================
RCS file: /cvs/ports/lang/tcl/tcl.port.mk,v
diff -u -p -u -p -r1.22 tcl.port.mk
--- tcl.port.mk 16 Mar 2026 15:44:31 -0000 1.22
+++ tcl.port.mk 7 Aug 2026 14:11:30 -0000
@@ -24,6 +24,18 @@ MODTCL_RUN_DEPENDS ?= ${_MODTCL_SPEC}:la
MODTCL_LIB_DEPENDS ?= ${_MODTCL_SPEC}:lang/tcl/${MODTCL_VERSION}
MODTCL_WANTLIB ?= ${MODTCL_LIB}
+# For Tcl 8/9 ports.
+.if "${MODTCL_VERSION}" == "9"
+MODTCL_EXTLIB = tcl9
+MODTCL_EXT8 = "@comment "
+MODTCL_EXT9 =
+MODTCL_COMMENT = (Tcl9)
+.else
+MODTCL_EXTLIB =
+MODTCL_EXT8 =
+MODTCL_EXT9 = "@comment "
+MODTCL_COMMENT = (Tcl8)
+.endif
# Handle the two most commonly used methods
# for starting up executable Tcl scripts.
Index: port-modules.5
===================================================================
RCS file: /cvs/src/share/man/man5/port-modules.5,v
diff -u -p -u -p -r1.286 port-modules.5
--- port-modules.5 25 Jun 2026 07:30:43 -0000 1.286
+++ port-modules.5 7 Aug 2026 14:11:51 -0000
@@ -1097,6 +1097,14 @@ Sets
.Ev MODTCL_LIB_DEPENDS ,
and
.Ev MODTCL_LIB .
+Also sets
+.Ev MODTCL_EXTLIB ,
+.Ev MODTCL_EXT8 ,
+.Ev MODTCL_EXT9 ,
+and
+.Ev MODTCL_COMMENT ,
+for Tcl 8/9 ports.
+See textproc/tdom and x11/dbus-tcl.
.Ev MODTCL_VERSION
is the default version used by all Tcl ports and may be overridden.
Provides
Tcl extensions for Tcl 8 and 9