pkgsrc changes:
- use REPLACE_PERL instead of hand-rolled sed
- use ncursesw
- make curses selection work
- add INSTALLATION_DIRS
upstream changes:
Changes to support Unicode terminals. Link against ncursesw instead
of ncurses, since the former knows how to translate ACS_ULCORNER et
al into the right Unicode code points; also call setlocale() before
starting up curses, so that it knows it has to.
Also closes PR pkg/37366.