The recent versions of devel/ncurses break the build editors/nano, because the configure script adds bogus options to CFLAGS.
This had already been patched out (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223578), but the patch was removed again with this commit: https://svnweb.freebsd.org/ports?view=revision&revision=486883
The reason for the removal of the patch might have been, that the relevant part of the configure script got changed upstream (they added a midnightbsd option).
That means that the patch probably has to be updated before it can be reintroduced.
The editors/nano build fails, because the ncurses CFLAGS force an old C header version, which makes the type "max_align_t" unavailable.
This also affect sysutils/htop, see https://github.com/hishamhm/htop/issues/870
Created attachment 200380 [details]
Updated patch which fixes the problem
(In reply to Étienne Simon from comment #1)
Thanks for linking the htop issue, this segfault looks even nastier to track down than the nano build error.
A few more details about the CFLAGS:
* thy come from the configure file (line 8789)
* they get stored in "/usr/local/libdata/pkgconfig/ncursesw.pc"
* they are queried with "pkg-config --cflags ncursesw"
I've attached an updated version of the old patch,
but it would probably be better to get this fixed upstream.
The patch excludes DragonFly and MidnightBSD,
is this the right way to go here?
I sent this to the ncurses mailing list:
What's needed is a suggested patch which references a release version of FreeBSD
with whatever turns on the header features needed to compile ncurses, xterm
lynx. That chunk of configure script is used in more than one program.
I see that FreeBSD 12 is available for download. I'll put together an
update for configure script which takes that into account.
There's some history of this issue affecting other ports, too.
In that case, the port was modified to use pkg-config --cflags-only-I (instead of pkg-config --cflags) to avoid pulling in the -D flags.
It's hard to define flags like -D_POSIX_C_SOURCE=XXX specially for the headers in a particular package (e.g., ncurses) in such a way that they might not interfere with headers of a different package that might want a different value for XXX.
(In reply to John Hein from comment #6)
> It's hard to define flags like -D_POSIX_C_SOURCE=XXX specially for the headers in a particular package (e.g., ncurses) in such a way that they might not interfere with headers of a different package that might want a different value for XXX.
For portability, one might argue you should support multiple versions of XXX in one's library. But that can be tedious, error prone, and a maintenance burden.
(In reply to John Hein from comment #7)
See also this thread:
(In reply to John Hein from comment #8)
A commit references this bug:
Date: Mon Dec 31 23:55:56 UTC 2018
New revision: 488848
devel/ncurses: update to 6.1.20181229
* Fix bogus CFLAGS by putting back configure patch 
* Add MANPAGES option 
PR: 234049 
PR: 186249 
Submitted by: Daniel Eisele <firstname.lastname@example.org> 
Submitted by: Zsolt Udvari <email@example.com> 
Committed, thanks for the explanation.
Patch can be removed again, problem was solved with ncurses version 20190105.