ncurses - CRT screen handling and optimization package ChangeLog

HOWTO


# GNU Ncurses 6.2 (ncurses = new curses)
# ===============
# Slackware 13.37, 14.0, 14.1, 14.2: ncurses 5.9

# Many other pieces of software can be removed before you install a new
# version with little to no ill-effects, 'make uninstall' the old one, 'make
# install' the new one.  ncurses is so widely used that you may not be able
# to get away with that, without breaking a bunch of things.  Below we blow
# away files that may be left over from old source-installed versions of
# ncurses, ass|u|me'ing that you still have libncurses in /lib or /lib64
# from Slackware's aaa_elflibs|aaa_libraries package to keep things working
# that use it.  If you are not comfortable with that, skip the cleanup part
# before 'make install' below, then either leave it all there and hope for
# the best, or manually clean up files after the new version is installed -
# look for a date that is other than today.
#
# Loads of console programs like dialog, lynx, mc, mutt, ncftp, joe, vim,
# etc. use ncurses and even things like the Dropbox daemon do, so running
# something like:
#   lsof /lib*/libncurses.* /usr/lib*/libncurses.*
# is not a bad idea, to find out what running programs are using it.

# The home page for Ncurses is https://invisible-island.net/ncurses/
# but the GNU page for it is here:
# https://invisible-island.net/ncurses/

# If you have any trouble downloading Ncurses from gnu.org, you can
# also get it here:
# ftp://ftp.invisible-island.net/ncurses/
# https://invisible-mirror.net/archives/ncurses/

# Release notes

# Prerequisites:
# pkg-config
# ctags

# Due to the number of patches, create a directory for the ncurses tarball
# and patches, move the tarball and patches into it (if you previously had
# any of them):
mkdir -p -m 0700 ~/installed/ncurses
( cd ~/installed
  mv -f ncurses-6.2.tar.gz ncurses-*.patch.gz \
   ncurses-*-patch.sh.bz2 ncurses/ 2> /dev/null )

# Get it
cd
test -f installed/ncurses/ncurses-6.2.tar.gz &&
mv installed/ncurses/ncurses-6.2.tar.gz .
test ! -f ncurses-6.2.tar.gz &&
wget http://ftpmirror.gnu.org/ncurses/ncurses-6.2.tar.gz

# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c\
9d  ncurses-6.2.tar.gz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys F7E48EDB > /dev/null 2>&1 || gpg --recv-keys F7E48EDB ) &&
wget -nc http://ftpmirror.gnu.org/ncurses/ncurses-6.2.tar.gz.sig &&
  gpg --verify ncurses-6.2.tar.gz.sig && rm ncurses-6.2.tar.gz.sig

# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "ncurses-*" -exec rm -r {} \;
tar xzvf ~/ncurses-6.2.tar.gz
cd ncurses-6.2
test $UID = 0 && chown -R root:root .

# gpg-verify, then apply patches that have come out since the full release
# if there is one, the latest rollout patch:
# [ Note: When I did this, one patch to ANNOUNCEMENT was .rej, changing it
#   from a 6.1 version to 6.2, but that is just a text doc file, so just
#   ignored that ]
gpg --list-keys F7E48EDB > /dev/null 2>&1 || gpg --recv-keys F7E48EDB
mv -f ~/installed/ncurses/ncurses-6.2-*.patch.gz .
rm -f ~/installed/ncurses/ncurses-*.patch.gz
wget -N https://invisible-mirror.net/archives/ncurses/6.2/dev-patches.zip
unzip -n dev-patches.zip
chmod u+w ncurses-6.2-*.patch.gz*
for file in ncurses-6.2-*.patch.gz;
do
  test -f ${file}.asc && gpg --verify ${file}.asc && rm ${file}.asc
  zcat $file | patch -p1 -N && mv -f $file ~/installed/ncurses/
  echo "Hit enter to continue"
  read
done

# Configure build #1 (libncurses.so.*) for 64-bit
test $(uname -m) = 'x86_64' && LIBDIR=lib64 &&
CFLAGS="-O2 -fPIC" ./configure --prefix=/usr --libdir=/usr/${LIBDIR} \
--mandir=/usr/man --without-ada \
--with-pkg-config-libdir=/usr/${LIBDIR}/pkgconfig \
--enable-pc-files --with-shared --without-normal --without-debug \
--disable-overwrite --enable-symlinks --enable-hard-tabs --with-cxx-shared \
--enable-xmc-glitch --enable-colorfgbg --with-ospeed=unsigned \
--with-termlib --with-ticlib=tic \
--with-chtype=long --with-mmask-t=long

# Configure build #1 (libncurses.so.*) for anything else
test $(uname -m) != 'x86_64' && LIBDIR=lib &&
CFLAGS="-O2" ./configure --prefix=/usr --libdir=/usr/${LIBDIR} \
--mandir=/usr/man --without-ada \
--with-pkg-config-libdir=/usr/${LIBDIR}/pkgconfig \
--enable-pc-files --with-shared --without-normal --without-debug \
--disable-overwrite --enable-symlinks --enable-hard-tabs --with-cxx-shared \
--enable-xmc-glitch --enable-colorfgbg --with-ospeed=unsigned \
--with-ticlib=tic

# Build it
make

# Become root to clean up old files and to install it
su

# As I write this, Slackware-current no longer includes a libtermcap
# package, and ncurses includes a /usr/include/termcap.h ...
text -x /sbin/removepkg && /sbin/removepkg libtermcap

# Remove Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg ncurses

# Remove files from old source-installed versions.
# We do not mess with Slackware package libncurses or aaa_elflibs /lib*/
# files here.
( cd /usr/bin ; rm -f clear infocmp ncurses5-config ncursesw5-config \
  ncurses6-config ncursesw6-config tabs tic toe tput tset )
find /usr/doc -maxdepth 1 -type d -name "ncurses-*" -exec rm -r {} \;
find /usr/include -type l -ilname "ncurses/*" -exec rm -r {} \;
test -d /usr/include/ncurses && rm -r /usr/include/ncurses
for lib in libform libformw libmenu libmenuw libncurses++ libncurses++w \
libncurses libncursesw libpanel libpanelw;
do
  ( cd /usr/lib ; rm -f "${lib}.*" )
  test -d /usr/lib64 && ( cd /usr/lib64 ; rm -f "${lib}.*" )
done
test -L /usr/include/ncursesw &&
rm -f /usr/include/ncursesw

# If you have a termcap.h from the libtermcap package and you want to move
# it out of the way for the one from ncurses:
grep -q usr/include/termcap.h /var/adm/packages/libtermcap* &&
test ! -L /usr/include/termcap.h &&
  mv -f /usr/include/termcap.h /usr/include/termcap.h.orig

# Install the new version
make install

# Create symlinks from the *.h files in /usr/include/ncurses/
# to /usr/include
( cd /usr/include
  for file in ncurses/*.h ; do ln -sf $file . ; done )

# Become yourself again (to rebuild it)
exit

# Clean the previous build files
make clean

# Configure build #2 (libncursesw.so.*) for 64-bit
test $(uname -m) = 'x86_64' && LIBDIR=lib64 &&
CFLAGS="-O2 -fPIC" ./configure --prefix=/usr --libdir=/usr/${LIBDIR} \
--mandir=/usr/man --without-ada \
--with-pkg-config-libdir=/usr/${LIBDIR}/pkgconfig \
--enable-pc-files --with-shared --without-normal --without-debug \
--disable-overwrite --enable-symlinks --enable-hard-tabs --with-cxx-shared \
--enable-xmc-glitch --enable-colorfgbg --with-ospeed=unsigned \
--with-termlib --with-ticlib=tic \
--with-chtype=long --with-mmask-t=long --enable-widec

# Configure build #2 (libncursesw.so.*) for anything else
test $(uname -m) != 'x86_64' && LIBDIR=lib &&
CFLAGS="-O2" ./configure --prefix=/usr --libdir=/usr/${LIBDIR} \
--mandir=/usr/man --without-ada \
--with-pkg-config-libdir=/usr/${LIBDIR}/pkgconfig \
--enable-pc-files --with-shared --without-normal --without-debug \
--disable-overwrite --enable-symlinks --enable-hard-tabs --with-cxx-shared \
--enable-xmc-glitch --enable-colorfgbg --with-ospeed=unsigned \
--with-termlib --with-ticlib=tic --enable-widec

# Re-build it
make

# Become root to install it
su

# Install the 'w' version of everything
# It will just install the same man pages, /usr/share/terminfo files...
make install

# If you're really low on drive space, I'm pretty sure you could zap
# /usr/include/ncursesw and symlink from /usr/include/ncurses to that

# Move libncurses library files into /lib*/, fix up symlinks to make sure
# all is well
test $(uname -m) = 'x86_64' && LIBDIR=lib64
test $(uname -m) != 'x86_64' && LIBDIR=lib

( cd /usr/${LIBDIR}
  rm -f libcurses.so libcursesw.so libncurses.so libncursesw.so
  rm -f libtinfo.so libtinfow.so
  mv -f libncurses.so.* /${LIBDIR}/
  mv -f libncursesw.so.* /${LIBDIR}/
  mv -f libtinfo.so.* /${LIBDIR}/
  mv -f libtinfow.so.* /${LIBDIR}/
  ln -sf /${LIBDIR}/libncurses.so.6
  ln -sf /${LIBDIR}/libncurses.so.6 libncurses.so
  ln -sf /${LIBDIR}/libncursesw.so.6
  ln -sf /${LIBDIR}/libncursesw.so.6 libncursesw.so
  ln -sf /${LIBDIR}/libtinfo.so.6 libtinfo.so
  ln -sf /${LIBDIR}/libtinfow.so.6 libtinfow.so )

( cd /${LIBDIR}
  rm -f libncurses.so libncurses.so.6 libncursesw.so libncursesw.so.6 \
   libtinfo.so libtinfo.so.6 libtinfow.so libtinfow.so.6
  ln -sf libncurses.so.6.2 libncurses.so.6
  ln -sf libncurses.so.6 libncurses.so
  ln -sf libncursesw.so.6.2 libncursesw.so.6
  ln -sf libncursesw.so.6 libncursesw.so
  ln -sf libncurses.so libcurses.so
  ln -sf libncursesw.so libcursesw.so
  ln -sf libtinfo.so.6.2 libtinfo.so
  ln -sf libtinfow.so.6.2 libtinfow.so )

# If you want things looking for -lcurses (no "n") to work
echo "INPUT(-lncurses)" > /usr/${LIBDIR}/libcurses.so
echo "INPUT(-lncursesw)" > /usr/${LIBDIR}/libcursesw.so

# Make sure the linker can see the libraries
ldconfig

# Unset the temporary lib or lib64
unset LIBDIR

# ncurses has a 'clear' and the textutils package has a 'clear'.  The latter
# is a shell script that runs 'tput clear'.  textutils, fileutils, and
# sh-utils became coreutils, and there was no clear in Slackware's coreutils
# last time I checked.

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/ncurses-*.tar.* installed/ncurses/ncurses-*.tar.*
mv ncurses-6.2.tar.gz installed/ncurses/

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2021-06-04 2:17am
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]