On Sat, Aug 24, 2024 at 06:08:45PM +0200, Sven Joachim wrote:
> On 2024-08-24 01:47 -0400, Paul Dufresne wrote:
> 
> > Package: ncurses-base
> > Version: 6.5-2
> > Severity: wishlist
> >
> > Dear Maintainer,
> >
> > While trying to compile the haskell example program for module ncurses,
> > I got the following error:
> > While compiling: got:
> > Failed to build ncurses-0.2.16.
> > Build log (
> > /home/paul/.cabal/logs/ghc-9.4.7/ncurses-0.2.16-d863cb3651dc4baa1ab3f5d6ea2fc5693727b1cc5282fbebd8a1f4a6edda73e5.log
> > ):
> > Warning: ncurses.cabal:85:21: version operators used. To use version 
> > operators
> > the package needs to specify at least 'cabal-version: >= 1.8'.
> > Configuring ncurses-0.2.16...
> > Preprocessing library for ncurses-0.2.16..
> > c2hs: C header contains errors:
> >
> > dist/build/UI/NCurses/Enums.chs.h:140: (column 25) [ERROR]  >>> Unknown
> > identifier!
> >   Cannot find a definition for `KEY_EVENT' in the header file.
> >
> > Error: cabal: Failed to build ncurses-0.2.16 (which is required by
> > exe:ncurses1 from ncurses1-0.1.0.0). See the build log above for details.
> >
> > Contacting the old maintainer of the ncurses Haskell module he said:
> > Regarding the specific case of KEY_EVENT, it was removed from the ncurses
> > public API (a backwards-incompatible breaking change), and the configure 
> > flag
> > `--enable-wgetch-events` is required to re-enable it. I recommend filing a 
> > bug
> > against the Debian ncurses package asking them to set that flag when 
> > building.
> >
> > I downloaded latest source code, and:
> > paul@albukerk:~/Téléchargements/ncurses-6.4-20230520$ ./configure 
> > --help|grep
> > event
> >   --enable-wgetch-events  compile with wgetch-events code
> > paul@albukerk:~/Téléchargements/ncurses-6.4-20230520$
> >
> > So the option seems to still exist.
> 
> It exists but has been deprecated four years ago, in the same
> patchlevel that removed the KEY_EVENT macro.  See the NEWS file:
> 
> ,----
> | 20200817
> |     + mark wgetch-events feature as deprecated.
> |     + prevent KEY_EVENT from appearing in curses.h unless the configure
> |       option --enable-wgetch-events is used (report by Werner Fink).
> `----
> 
> > So... this is a wish request to build with this flag enable.
> 
> Not going to happen, I am afraid.  You could try the following change to
> haskell-ncurses:
> 

> diff --git a/lib/UI/NCurses/Enums.chs b/lib/UI/NCurses/Enums.chs
> index 73a64f5..ef47d00 100644
> --- a/lib/UI/NCurses/Enums.chs
> +++ b/lib/UI/NCurses/Enums.chs
> @@ -195,7 +195,6 @@ enum hsncurses_Key
>  , hsncurses_KEY_UNDO = KEY_UNDO
>  , hsncurses_KEY_MOUSE = KEY_MOUSE
>  , hsncurses_KEY_RESIZE = KEY_RESIZE
> -, hsncurses_KEY_EVENT = KEY_EVENT
>  };
>  #endc
> 

That's what I recommend.  I deprecated it because (aside from
copy/paste stuff like this), there were no known uses of the feature,
and there was no documentation.

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

Attachment: signature.asc
Description: PGP signature

Reply via email to