6.18. Ncurses-5.5

The Ncurses package contains libraries for terminal-independent handling of character screens.

Approximate build time: 0.7 SBU
Required disk space: 31 MB

6.18.1. Installation of Ncurses

Since the release of Ncurses-5.5, a memory leak and some display bugs were found and fixed upstream. Apply those fixes:

patch -Np1 -i ../ncurses-5.5-fixes-1.patch

Prepare Ncurses for compilation:

./configure --prefix=/usr --with-shared --without-debug --enable-widec

The meaning of the configure option:

--enable-widec

This switch causes wide-character libraries (e.g., libncursesw.so.5.5) to be built instead of normal ones (e.g., libncurses.so.5.5). These wide-character libraries are usable in both multibyte and traditional 8-bit locales, while normal libraries work properly only in 8-bit locales. Wide-character and normal libraries are source-compatible, but not binary-compatible.

Compile the package:

make

This package does not come with a test suite.

Install the package:

make install

Give the Ncurses libraries execute permissions:

chmod -v 755 /usr/lib/*.5.5

Fix a library that should not be executable:

chmod -v 644 /usr/lib/libncurses++w.a

Move the libraries to the /lib directory, where they are expected to reside:

mv -v /usr/lib/libncursesw.so.5* /lib

Because the libraries have been moved, one symlink points to a non-existent file. Recreate it:

ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so

Many applications still expect the linker to be able to find non-wide-character Ncurses libraries. Trick such applications into linking with wide-character libraries by means of symlinks and linker scripts:

for lib in curses ncurses form panel menu ; do \
    rm -vf /usr/lib/lib${lib}.so ; \
    echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so ; \
    ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \
done &&
ln -sfv libncurses++w.a /usr/lib/libncurses++.a

Finally, make sure that old applications that look for -lcurses at build time are still buildable:

echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so &&
ln -sfv libncurses.so /usr/lib/libcurses.so &&
ln -sfv libncursesw.a /usr/lib/libcursesw.a &&
ln -sfv libncurses.a /usr/lib/libcurses.a
[Note]

Note

The instructions above don't create non-wide-character Ncurses libraries since no package installed by compiling from sources would link against them at runtime. If you must have such libraries because of some binary-only application, build them with the following commands:

make distclean &&
./configure --prefix=/usr --with-shared --without-normal \
  --without-debug --without-cxx-binding &&
make sources libs &&
cp -av lib/lib*.so.5* /usr/lib

6.18.2. Contents of Ncurses

Installed programs: captoinfo (link to tic), clear, infocmp, infotocap (link to tic), reset (link to tset), tack, tic, toe, tput, and tset
Installed libraries: libcursesw.{a,so} (symlink and linker script to libncursesw.{a,so}), libformw.{a,so}, libmenuw.{a,so}, libncurses++w.a, libncursesw.{a,so}, libpanelw.{a,so} and their non-wide-character counterparts without "w" in the library names.

Short Descriptions

captoinfo

Converts a termcap description into a terminfo description

clear

Clears the screen, if possible

infocmp

Compares or prints out terminfo descriptions

infotocap

Converts a terminfo description into a termcap description

reset

Reinitializes a terminal to its default values

tack

The terminfo action checker; it is mainly used to test the accuracy of an entry in the terminfo database

tic

The terminfo entry-description compiler that translates a terminfo file from source format into the binary format needed for the ncurses library routines. A terminfo file contains information on the capabilities of a certain terminal

toe

Lists all available terminal types, giving the primary name and description for each

tput

Makes the values of terminal-dependent capabilities available to the shell; it can also be used to reset or initialize a terminal or report its long name

tset

Can be used to initialize terminals

libcurses

A link to libncurses

libncurses

Contains functions to display text in many complex ways on a terminal screen; a good example of the use of these functions is the menu displayed during the kernel's make menuconfig

libform

Contains functions to implement forms

libmenu

Contains functions to implement menus

libpanel

Contains functions to implement panels