bug-ncurses
[Top][All Lists]
Advanced

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

Re: API change with macro KEY_EVENT?


From: Thomas Dickey
Subject: Re: API change with macro KEY_EVENT?
Date: Fri, 18 Sep 2020 17:13:03 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Sep 18, 2020 at 09:37:56PM +0200, Sven Joachim wrote:
> On 2020-08-17 06:19 -0400, Thomas Dickey wrote:
> 
> > On Mon, Aug 17, 2020 at 11:40:24AM +0200, Dr. Werner Fink wrote:
> >> On 2020/08/17 04:57:02 -0400, Thomas Dickey wrote:
> >> > On Mon, Aug 17, 2020 at 09:56:17AM +0200, Dr. Werner Fink wrote:
> >> > >
> >> > > Hmmm .... those packages do fail in staging test:
> >> > >
> >> > >  apparmor      failed
> >> > >  ceph  failed
> >> > >  dpkg  failed
> >> > >  grantlee5     failed
> >> > >  kbuild        failed
> >> > >  kdelibs4support       failed
> >> > >  libappindicator:gtk3  failed
> >> > >  libarchive    failed
> >> > >  memcached     failed
> >> > >  meson:test    failed
> >> > >  python-pytest-django  failed
> >> > >  speech-dispatcher     failed
> >> > >  tcpd  failed
> >> > >  zsh   failed
> >> >
> >> > I see - lots of copy/paste going on.  Aside from zsh, none of those
> >> > appear to have a reason to use ncurses.
> >> >
> >> > > ... do I've revert the change for Visual C++ for OpenSUSE to get
> >> > > then to compile again?
> >> >
> >> > That seems to be the initial fix.  I don't see a reason why ncurses
> >> > should provide a definition for a return value which is not supported
> >> > by the configuration you've built :-(
> >> >
> >> > fwiw, there's no known users of the wgetch_events feature.
> >> >
> >> > I could probably replace that definition by any integer constant without
> >> > altering the behavior of those programs.
> >> >
> >>
> >> AFAICS from source of both dpkg and zsh: it seems that those packages uses
> >> scripts (perl/awk) to seek for KEY_* macros to generate the header files
> >> used later in the sources.  That seems to be a common method to grep
> >> through /usr/include/ncurses.h :/
> >
> > In that case, I can simply omit the entire feature unless it's configured.
> 
> This is what you claimed to do in the 20200817 patchlevel, but it does
> not actually work as advertised.

In my test-builds, it's omitted...

I haven't checked if you've changed options in the Debian package,
but the script that I used a couple of years ago for this produces
the expected result.
 
> The v1.49 change to include/Makefile.in is this:

The change was mostly in different files:

        a) modifying the script which special-case added KEY_EVENT

        
------------------------------------------------------------------------------
        REV:1.21                MKkey_defs.sh       2020/08/17 10:45:33       
tom
        tags:            v6_2_20200912, v6_2_20200907, v6_2_20200906, 
v6_2_20200831,
                         v6_2_20200829, v6_2_20200822, v6_2_20200817

           simply remove KEY_EVENT from curses.h

        --- MKkey_defs.sh       2020/08/01 18:20:15     1.20
        +++ MKkey_defs.sh       2020/08/17 10:45:33     1.21
        @@ -1,5 +1,5 @@
         #! /bin/sh
        -# $Id: MKkey_defs.sh,v 1.19 2020/02/02 23:34:34 tom Exp $
        +# $Id: MKkey_defs.sh,v 1.20 2020/08/01 18:20:15 tom Exp $
         
##############################################################################
         # Copyright 2019,2020 Thomas E. Dickey                                 
      #
         # Copyright 2001-2013,2017 Free Software Foundation, Inc.              
      #
        @@ -64,7 +64,6 @@
         # add keys that we generate automatically:
         cat >>$data <<EOF
         key_resize     kr1     str     R1      KEY_RESIZE      +       
NCURSES_EXT_FUNCS       Terminal resize event
        -key_event      kv1     str     V1      KEY_EVENT       +       
NCURSES_WGETCH_EVENTS   We were interrupted by an event
         EOF
         
         THIS=./`basename $0`
        
------------------------------------------------------------------------------

        b) splitting-out include/curses.events, which is only added to
           curses.h if the wgetch-events feature is configured.

           I did that to address the scripts which use grep rather than
           doing test-compiles.

           This is for the latter:

> diff --git a/include/Makefile.in b/include/Makefile.in
> index d89dfa3d..25cca487 100644
> --- a/include/Makefile.in
> +++ b/include/Makefile.in
> @@ -1,4 +1,4 @@
> -# $Id: Makefile.in,v 1.48 2020/02/19 23:54:22 tom Exp $
> +# $Id: Makefile.in,v 1.49 2020/08/17 10:43:16 tom Exp $
>  
> ##############################################################################
>  # Copyright 2019,2020 Thomas E. Dickey                                       
> #
>  # Copyright 1998-2013,2015 Free Software Foundation, Inc.                    
> #
> @@ -104,6 +104,7 @@ curses.h :        $(CAPLIST) \
>               $(srcdir)/MKkey_defs.sh
>       cat curses.head >$@
>       AWK=$(AWK) $(SHELL) $(srcdir)/MKkey_defs.sh $(CAPLIST) >>$@
> +     $(SHELL) -c 'if test "@NCURSES_EXT_FUNCS@" = "1" ; then cat 
> $(srcdir)/curses.events >>$@ ; fi'
>       $(SHELL) -c 'if test "@NCURSES_CH_T@" = "cchar_t" ; then cat 
> $(srcdir)/curses.wide >>$@ ; fi'
>       cat $(srcdir)/curses.tail >>$@

This part of the change was needed to apply the curses.events chunk.

> and @NCURSES_EXT_FUNCS@ evaluates to 1 unless "--disable-ext-funcs" is
> given to configure AFAICS.  That's not what was intended, namely a check
> for "--enable-wgetch-events", it seems?

KEY_EVENT was only used with --enable-wgetch-events;
that's off by default:

        AC_MSG_CHECKING(if you want wgetch-events code)
        AC_ARG_ENABLE(wgetch-events,
                [  --enable-wgetch-events  compile with wgetch-events code],
                [with_wgetch_events=$enableval],
                [with_wgetch_events=no])
        AC_MSG_RESULT($with_wgetch_events)
        test "x$with_wgetch_events" = xyes && 
AC_DEFINE(NCURSES_WGETCH_EVENTS,1,[Define to 1 to compile with wgetch-events 
code])
 
> In Debian I have upgraded ncurses to the 20200912 patchlevel, and now
> at least dpkg and zsh fail to build.
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970545

I'll take a look to see what's amiss (thanks)

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]