[Bug 227528] devel/ncurses and USES=ncurses is not sufficient (= is broken under some conditions)
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Apr 15 16:07:37 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227528
Bug ID: 227528
Summary: devel/ncurses and USES=ncurses is not sufficient (= 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 at FreeBSD.org
Reporter: cejkar at fit.vutbr.cz
Flags: maintainer-feedback?(swills at FreeBSD.org)
Assignee: swills at FreeBSD.org
This problem seems to be very intricate with many "if"s, so I try to explain 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 preinstalled
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 libraries
libncurses/libtinfo define and use chtype as 4-byte unsigned. The worst case 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. Sometimes
it writes nul characters (@), sometimes it dumps core.
When port has USES=ncurses and devel/ncurses is installed, the port should 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${NCURSESLIB}"
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 using
USES=ncurses themselves. Sometimes they do not work at all, sometimes they just
look that they work, and sometimes they would be correct.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list