Created attachment 692859 [details]
rough ebuild that will build nethack for tty and curses but not X
Nethack does not build with CURSES_GRAPHICS.
I chased my tail on this one for a while, mostly because I'm not familiar with ebuilds.
Eventually I've managed to narrow it down to the hints file. I used the sys/unix/hints/linux file. I think the old hints file is not sufficient for a CURSES_GRAPHICS build.
I didn't mange to get it to work with X so I just commented the parts relating to X out. I suspect it would be changes to the hints file again.
I've attached my rough ebuild that now builds a version of Nethack with tty and curses support.
I hope this information is helpful in some way.
See also: https://forums.freebsd.org/threads/enable-curses-interface-for-nethack36.75423/.
The above link has helped tremendously.
To enable ncurses support, one needs to first modify the ebuild and add "append-cflags -DCURSES_GRAPHICS" under the src_compile() section.
The appropriate hints file must also be changed. The file to modify depends on whether the X use flag is enabled or not.
If the 'X' use flag is enabled, files/nethack-3.6.3-hint-x11 must be changed so that the section containing
WINSRC = $(WINTTYSRC) $(WINX11SRC)
WINOBJ = $(WINTTYOBJ) $(WINX11OBJ)
WINLIB = $(WINTTYLIB) $(WINX11LIB)
WINSRC = $(WINTTYSRC) $(WINX11SRC) $(WINCURSESSRC)
WINOBJ = $(WINTTYOBJ) $(WINX11OBJ) $(WINCURSESOBJ)
WINLIB = $(WINTTYLIB) $(WINX11LIB) $(WINCURSESLIB)
If the X use flag is not enabled, files/nethack-3.6.3-hint-tty will be used by the ebuild instead, and the above modification should be made to that file.
I believe these changes should be default to the nethack ebuild and hints file(s) seeing as ncurses is already a dependency.
Confirming fix proposed by Jazbeel for TTY: add one cflags and curses sources to *-hint-tty and the pretty curses graphics work in console - yay! - thank you Jazbeel for info!
+1 for fixing this :-)
Notes: I investigated this because Nethack@Termux on Android tablet has curses graphics. However, both Debian and Ubuntu nethack-console package seem to be compiled only with default tty support and no curses - why? So there must be a reason?
Looking at the NH366 source package, sys/unix/hints/linux has curses enabled, but the nethack-3.6.6-hint-tty used by the Gentoo ebuild has not. Hm.
First, apology for misspelling Jazeel in last comment - sorry
Second, I was unable to find a codepage437 translation tool in Gentoo's ebuilds to use curses AND IBMgraphics - the best terminal experience. A workaround is to use this cp437 tool: https://github.com/keaston/cp437
Compile cp437 binary and put somewhere in PATH.
and then chain-start nethack via cp437:
...enjoy nice terminal graphics on Gentoo!