netbsdnoob Why did it fail to find the ncurses/term.h file, even though it was present on the system and after the -I flag?
Something along the racket sources was likely overwriting CFLAGS; otherwise including devel/ncurses/buildlink3.mk would normally tell pkgsrc to add the ncurses headers directory to the C include path, through:
which translates to:
How did you find out that it needed terminfo?
It includes <term.h> and uses functions described in terminfo(3) like tputs(), tparm() and setupterm().
Also, term.h is the header pkgsrc looks for when trying to determine whether a native terminfo library is available. From mk/terminfo.builtin.mk
BUILTIN_FIND_LIBS:= terminfo curses tinfo
What would the fix for this have been if I wanted to retain ncurses without considering curses, as you did?
Including devel/ncurses/buildlink3.mk should be ok, but this won't prevent software from finding the native curses first and linking against it.
To my understanding, a clean way of doing this is:
- include mk/curses.buildlink.mk in the package Makefile.
USE_NCURSES= yes to the package Makefile.
PREFER_PKGSRC= curses to /etc/mk.conf or whatever file MKCONF points to.
NOTE: Normally, it would be preferable to rely on
USE_CURSES instead of USE_NCURSES to define which library functions the packages relies upon, and let pkgsrc define the curses library to use (so as to pull ncurses only if netbsd-curses doen't support those functions).
For example you may have:
USE_CURSES= chgat getmouse resize_term
These are supported by netbsd curses, so pkgsrc wouldn't pull ncurses on NetBSD in this case.
USE_CURSES= wide shall pull ncursesw.
In our case, we also need terminfo definitions (which ncurses provides on its own). So we should have included mk/terminfo.buildlink3.mk anyways, and, to force ncurses, set
How did you find out that it did not need ncurses but just curses?
I tried to build it with netbsd-curses and it went fine. I don't know how racket uses curses though. In my limited experience, sometimes, even if the software compiles fine with netbsd-curses, some pitfalls may come up in usage (testing needed).