1
|
#!/bin/bash
|
2
|
# remove previous install
|
3
|
rm -r ncurses*
|
4
|
|
5
|
# get up to date version
|
6
|
apt-get source ncurses
|
7
|
|
8
|
# check if sources obtained
|
9
|
if [ $? -ne 0 ]
|
10
|
then
|
11
|
echo "+------------------------------------------------------------------------------+"
|
12
|
echo "| Unable to get NCURSES source tree! |"
|
13
|
echo "| Check the available packages list in /etc/apt/sources.list. |"
|
14
|
echo "+------------------------------------------------------------------------------+"
|
15
|
exit
|
16
|
fi
|
17
|
|
18
|
# patching the source files
|
19
|
cd ncurses-6.*
|
20
|
wget https://proj.goldencode.com/downloads/ncurses/ncurses_curses_h_in_v6.1_20200708.patch
|
21
|
wget https://proj.goldencode.com/downloads/ncurses/ncurses_lib_getch_c_v6.1_20200708.patch
|
22
|
patch include/curses.h.in ncurses_curses_h_in_v6.1_20200708.patch
|
23
|
patch ncurses/base/lib_getch.c ncurses_lib_getch_c_v6.1_20200708.patch
|
24
|
|
25
|
# configure and build object libraries
|
26
|
./configure --with-termlib CFLAGS='-fPIC -O2' --with-abi-version=6
|
27
|
make
|
28
|
|
29
|
# make valid reference to updated ncurses.h
|
30
|
cd include
|
31
|
ln -s curses.h ncurses.h
|
32
|
cd ..
|
33
|
|
34
|
echo "+------------------------------------------------------------------------------+"
|
35
|
echo "| Patched NCURSES libraries update completed. |"
|
36
|
|
37
|
# setting up system variable if not yet defined to use custom libraries location
|
38
|
if [ -z "$NCURSES_FWD_STATIC" ]
|
39
|
then
|
40
|
rc_filename=$HOME'/.bashrc'
|
41
|
echo '' >> $rc_filename
|
42
|
echo '# set up patched NCURSES root location' >> $rc_filename
|
43
|
echo 'export NCURSES_FWD_STATIC='$PWD >> $rc_filename
|
44
|
echo "| --------------------------- WARNING ! -------------------------------- |"
|
45
|
echo "| The .bashrc has been changed! Please open new console to activate setup! |"
|
46
|
echo "| --------------------------- WARNING ! -------------------------------- |"
|
47
|
fi
|
48
|
echo "| Please do FULL FWD rebuild to activate the changes. |"
|
49
|
echo "+------------------------------------------------------------------------------+"
|
50
|
|
51
|
# back to the starting directory
|
52
|
cd ..
|