On 12/08/13 09:23, Marc Espie wrote:
> On Sun, Dec 08, 2013 at 08:41:23AM -0500, Stuart Cassoff wrote:
>> On 12/07/13 16:42, Marc Espie wrote:
>>> On Sat, Dec 07, 2013 at 03:39:28PM -0500, Stuart Cassoff wrote:
>>>> On 12/05/13 05:36, Marc Espie wrote:
>>>>> On Thu, Dec 05, 2013 at 01:26:47AM -0500, Stuart Cassoff wrote:
>>>>>> I'd like tcllib and tklib to make use of 'tcl modules'.
>>>>>> Every package that can be installed as a tcl module saves one file and
>>>>>> one dir
>>>>>> and there are enough eligible packages that I think it's worth doing.
>>>>>> This makes use of a newer tcl packaging system that's a bit better
>>>>>> and/or faster.
>>>>>>
>>>>>> These should always be installend in the dir for lowest tcl version
>>>>>> possible, which is 8.5.
>>>>>> I'm concerned that ${MODTK_VERSION} in the PLIST isn't right.
>>>>>>
>>>>>> Here's the result for one package:
>>>>>
>>>>> So, make sure to look at the result of update-plist, it's not always
>>>>> right.
>>>>>
>>>>
>>>> How's this? Snippet from the port Makefile diff.
>>>>
>>>> +# We want the lowest Tcl version possible.
>>>> +MODTK_VERSION = 8.5
>>>> +
>>>> +# Manual target to adjust PLIST after update-plist.
>>>> +adj-plist:
>>>> + perl -pi -e 's/\$${MODTK_VERSION}/8.5/' ${PKGDIR}/PLIST
>>>> +
>>> YUCK. A big *NO*.
>>>
>>> Did you try the approach I outlined ? Namely provide longer module
>>> variables
>>> that would be FIRST in the substituted list.
>>>
>
>> It confused and frightened me.
>>
>> Eventually I manned-up and so with your approach I get this in the PLIST:
>>
>> lib/tcl/${MODTK_MODPATH}/autoscroll-1.1.tm
>>
>> Which I don't understand much more.
>>
>> Either way I get the same package file so maybe I don't actually have a
>> problem here?
>
> Maybe you don't understand it much more, but it's cleaner, in as much
> as there's no extra step to fix the plist after update-plist.
>
> ... and it will fix the same problem in (potentially) other ports, without
> you needing to special-case each and every port.
>
Ok I understand now, thanks.
How's this? Should there be a MODTK_MINVERSION as well?
Index: lang/tcl/tcl.port.mk
===================================================================
RCS file: /cvs/ports/lang/tcl/tcl.port.mk,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 tcl.port.mk
--- lang/tcl/tcl.port.mk 17 Nov 2013 11:08:03 -0000 1.16
+++ lang/tcl/tcl.port.mk 9 Apr 2014 21:26:05 -0000
@@ -3,6 +3,7 @@
CATEGORIES += lang/tcl
MODTCL_VERSION ?= 8.5
+MODTCL_MINVERSION ?= 8.5
.if ${MODTCL_VERSION} == 8.4
_MODTCL_SPEC = tcl->=${MODTCL_VERSION},<8.5
@@ -43,4 +44,4 @@ MODTCL_TCLSH_ADJ = perl -pi \
# Same for 'wish'.
MODTCL_WISH_ADJ = ${MODTCL_TCLSH_ADJ:S/tclsh/wish/}
-SUBST_VARS += MODTCL_VERSION MODTCL_BIN
+SUBST_VARS += MODTCL_MINVERSION MODTCL_VERSION MODTCL_BIN
Index: x11/tk/tk.port.mk
===================================================================
RCS file: /cvs/ports/x11/tk/tk.port.mk,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 tk.port.mk
--- x11/tk/tk.port.mk 2 Feb 2013 11:18:28 -0000 1.12
+++ x11/tk/tk.port.mk 9 Apr 2014 21:26:55 -0000
@@ -22,7 +22,7 @@ MODTK_LIBDIR ?= ${MODTCL_TCLDIR}/tk${MO
MODTK_CONFIG ?= ${MODTK_LIBDIR}/tkConfig.sh
-SUBST_VARS += MODTK_VERSION MODTK_BIN
+SUBST_VARS += MODTCL_MINVERSION MODTK_VERSION MODTK_BIN
MODULES += lang/tcl
Index: port-modules.5
===================================================================
RCS file: /cvs/src/share/man/man5/port-modules.5,v
retrieving revision 1.172
diff -u -p -u -p -r1.172 port-modules.5
--- port-modules.5 2 Apr 2014 15:00:27 -0000 1.172
+++ port-modules.5 9 Apr 2014 21:24:27 -0000
@@ -933,8 +933,9 @@ Sets
.Ev MODTCL_RUN_DEPENDS ,
.Ev MODTCL_LIB ,
.Ev MODTCL_LIB_DEPENDS ,
+.Ev MODTCL_CONFIG
and
-.Ev MODTCL_CONFIG .
+.Ev MODTCL_MINVERSION .
.Ev MODTCL_VERSION
is the default version used by all Tcl ports and may be overridden.
Provides
@@ -946,6 +947,10 @@ Also affects
.Ev CATEGORIES
and
.Ev SUBST_VARS .
+.Ev MODTCL_MINVERSION
+may be used to prevent unwanted
+.Ev MODTCL_VERSION
+substitutions in PLISTs.
.It perl
This module is documented in the main
.Xr bsd.port.mk 5