diff --git a/scripts/chapter8/8.28-ncurses.sh b/scripts/chapter8/8.28-ncurses.sh new file mode 100644 index 0000000..c038ec4 --- /dev/null +++ b/scripts/chapter8/8.28-ncurses.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +cd /sources +tar xf ncurses-6.3.tar.gz +cd ncurses-6.3 + +./configure --prefix=/usr \ + --mandir=/usr/share/man \ + --with-shared \ + --without-debug \ + --without-normal \ + --with-cxx-shared \ + --enable-pc-files \ + --enable-widec \ + --with-pkg-config-libdir=/usr/lib/pkgconfig + + +if [ $? -ne 0 ] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0 ] +then + exit 1 +fi + +make DESTDIR=$PWD/dest install +install -vm755 dest/usr/lib/libncursesw.so.6.3 /usr/lib +rm -v dest/usr/lib/libncursesw.so.6.3 +cp -av dest/* / + +for lib in 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}w.pc /usr/lib/pkgconfig/${lib}.pc +done + +rm -vf /usr/lib/libcursesw.so +echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so +ln -sfv libncurses.so /usr/lib/libcurses.so + +mkdir -pv /usr/share/doc/ncurses-6.3 +cp -v -R doc/* /usr/share/doc/ncurses-6.3 + +cd /sources +rm -rf ncurses-6.3 diff --git a/scripts/main.sh b/scripts/main.sh index b56f581..0ba54fd 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -869,3 +869,15 @@ then stop_script "chapter8/8.27-pkg-config.sh" fi +# Chapter 8.28 +# ============ +echo "Building ncurses" +su -c "bash $SCRIPT/chapter8/8/28-ncurses.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter8/8.28-ncurses.sh" +fi +