Bug 261829 - lang/expect: fix build with only lang/tcl87 installed
Summary: lang/expect: fix build with only lang/tcl87 installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Pietro Cerutti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-09 13:27 UTC by Dimitry Andric
Modified: 2022-02-26 00:09 UTC (History)
2 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
Replace CONST84 with CONST (722 bytes, text/plain)
2022-02-09 13:27 UTC, Dimitry Andric
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2022-02-09 13:27:25 UTC
Created attachment 231676 [details]
Replace CONST84 with CONST

If you have DEFAULT_VERSIONS+=tcltk=8.7 in your make.conf, and therefore only have lang/tcl87 installed, lang/expect does not compile, complaining about an bad identifier "CONST84".

With the older lang/tcl86 installed, this is defined in /usr/local/include/tcl8.6/tcl.h:

#ifdef USE_NON_CONST
#   ifdef USE_COMPAT_CONST
#      error define at most one of USE_NON_CONST and USE_COMPAT_CONST
#   endif
#   define CONST84
#   define CONST84_RETURN
#else
#   ifdef USE_COMPAT_CONST
#      define CONST84
#      define CONST84_RETURN const
#   else
#      define CONST84 const
#      define CONST84_RETURN const
#   endif
#endif

#ifndef CONST86
#      define CONST86 CONST84
#endif

Since we are now in the next millennium, we can assume const always works, and replace the CONST84 macro with just CONST.
Comment 1 Pietro Cerutti freebsd_committer freebsd_triage 2022-02-09 17:32:59 UTC
Thanks, I've applied a few patches from upstream: https://core.tcl-lang.org/expect/vdiff?diff=2&to=0a2dd35d85cdf625&from=f8e8464f14c728cf
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-02-09 17:33:05 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e6529265153c3420c8441ceaf55fc7c8b58788bd

commit e6529265153c3420c8441ceaf55fc7c8b58788bd
Author:     Pietro Cerutti <gahr@FreeBSD.org>
AuthorDate: 2022-02-09 17:21:32 +0000
Commit:     Pietro Cerutti <gahr@FreeBSD.org>
CommitDate: 2022-02-09 17:31:55 +0000

    lang/expect: apply patches from upstream

    PR:             261829
    Reported by:    dim

 lang/expect/Makefile                    |    2 +-
 lang/expect/files/patch-modernize (new) | 1039 +++++++++++++++++++++++++++++++
 2 files changed, 1040 insertions(+), 1 deletion(-)
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2022-02-26 00:09:17 UTC
^Triage: Assign to committer that resolved