Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Apr 2018 16:07:34 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 227528] devel/ncurses and USES=ncurses is not sufficient (= is broken under some conditions)
Message-ID:  <bug-227528-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227528

            Bug ID: 227528
           Summary: devel/ncurses and USES=3Dncurses is not sufficient (=3D=
 is
                    broken under some conditions)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: swills@FreeBSD.org
          Reporter: cejkar@fit.vutbr.cz
             Flags: maintainer-feedback?(swills@FreeBSD.org)
          Assignee: swills@FreeBSD.org

This problem seems to be very intricate with many "if"s, so I try to explai=
n it
as I digged into it:

The problem: When net-im/centerim is compiled on a system without
devel/ncurses, everything is good. However, when devel/ncurses is preinstal=
led
and net-im/centerim then compiled, terminal output is broken.

The reason: It includes system ncurses.h, but uses ports libraries.

The explanation: System ncurses.h and system libraries libncurses/libtinfo
define and use chtype as 8-byte long, but ports ncurses.h and ports librari=
es
libncurses/libtinfo define and use chtype as 4-byte unsigned. The worst cas=
e is
in definition of library's chtype acs_map[], which is used in application
through ACS characters as ACS_* macros. If the headers and libraries are
mismatched, the application do not reference correct ACS characters. Someti=
mes
it writes nul characters (@), sometimes it dumps core.

When port has USES=3Dncurses and devel/ncurses is installed, the port shoul=
d use
-I${NCURSESINC} in CFLAGS and -L${NCURSESLIB} in LDFLAGS. However, it is not
sufficient itself.

But why sysutils/screen with just NCURSESINC/NCURSESLIB does work? It is
because it does not include any of ncurses headers. It needs just tget*()
function family, and it is defined itself in osdef.h, without any external
header. If you try to include ncurses.h in screen.c, you end on
'ncurses/ncurses_dll.h' file not found.

Well. And why net-mgmt/cnagios "works" without NCURSESINC/NCURSESLIB, linked
with ports ncurses and included with system ncurses.h? Because it does not =
use
ACS_* macros.

And so on. It seems to me that every port using ncurses is another case for
itself, where universal instruction would be:
Add "-I${NCURSESINC} -I/usr/local/include" to CFLAGS and add "-L${NCURSESLI=
B}"
to LDFLAGS, but as I feel, it does not look systemically at all.

I think that fixes are needed by both: Ncurses infrastructure and ports usi=
ng
USES=3Dncurses themselves. Sometimes they do not work at all, sometimes the=
y just
look that they work, and sometimes they would be correct.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227528-7788>