1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # cross-lfs native ncurses build
|
---|
4 | # ------------------------------
|
---|
5 | # $LastChangedBy$
|
---|
6 | # $LastChangedDate$
|
---|
7 | # $LastChangedRevision$
|
---|
8 | # $HeadURL$
|
---|
9 | #
|
---|
10 |
|
---|
11 | cd ${SRC}
|
---|
12 | LOG=ncurses-native.log
|
---|
13 | libdir="lib"
|
---|
14 |
|
---|
15 | SELF=`basename ${0}`
|
---|
16 | set_buildenv
|
---|
17 | set_libdirname
|
---|
18 | setup_multiarch
|
---|
19 |
|
---|
20 | unpack_tarball ncurses-${NCURSES_VER} &&
|
---|
21 | cd ${PKGDIR}
|
---|
22 |
|
---|
23 | if [ ! "${libdirname}" = "lib" ]; then
|
---|
24 | extra_conf="--libdir=/usr/${libdirname}"
|
---|
25 |
|
---|
26 | # Patch misc/run_tic.in to create lib64/terminfo -> share/terminfo link
|
---|
27 | test -f misc/run_tic.in-ORIG ||
|
---|
28 | mv misc/run_tic.in misc/run_tic.in-ORIG
|
---|
29 |
|
---|
30 | sed "s:^\(TICDIR.*/\)lib\(.*\):\1${libdirname}\2:g" \
|
---|
31 | misc/run_tic.in-ORIG > misc/run_tic.in
|
---|
32 | fi
|
---|
33 |
|
---|
34 |
|
---|
35 | # replace some deprecated headers
|
---|
36 | # strstream deprecated in favour of sstream
|
---|
37 | test -f c++/cursesw.h-ORIG ||
|
---|
38 | mv c++/cursesw.h c++/cursesw.h-ORIG
|
---|
39 | sed 's/include <strstream.h>/include <sstream>/g' c++/cursesw.h-ORIG > c++/cursesw.h
|
---|
40 |
|
---|
41 | # CHECK THIS... Should only affect ncurses 5.2 and less,
|
---|
42 | # must check whether vsscanf is picked up or not in 5.3
|
---|
43 |
|
---|
44 | test 5.2 = "${NCURSES_VER}" &&
|
---|
45 | {
|
---|
46 | # Apply cursesw.cc vsscanf patch
|
---|
47 | # Unsure who provided the original patch used.
|
---|
48 | # Please contact the authors so we can attribute you correctly.
|
---|
49 | test -f c++/cursesw.cc-ORIG ||
|
---|
50 | cp c++/cursesw.cc c++/cursesw.cc-ORIG
|
---|
51 | grep -v strstreambuf c++/cursesw.cc-ORIG |
|
---|
52 | sed 's@ss.vscan(@::vsscanf(buf, @' > c++/cursesw.cc
|
---|
53 | }
|
---|
54 |
|
---|
55 | max_log_init Ncurses ${NCURSES_VER} "native (shared)" ${CONFLOGS} ${LOG}
|
---|
56 | CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
57 | CXX="${CXX-g++} ${ARCH_CFLAGS}" \
|
---|
58 | ./configure --prefix=/usr --with-shared \
|
---|
59 | --without-debug ${extra_conf} \
|
---|
60 | >> ${LOGFILE} 2>&1 &&
|
---|
61 | echo " o Configure OK" &&
|
---|
62 |
|
---|
63 | min_log_init ${BUILDLOGS} &&
|
---|
64 | make \
|
---|
65 | >> ${LOGFILE} 2>&1 &&
|
---|
66 | echo " o Build OK" &&
|
---|
67 |
|
---|
68 | min_log_init ${INSTLOGS} &&
|
---|
69 | make install \
|
---|
70 | >> ${LOGFILE} 2>&1 &&
|
---|
71 | echo " o ALL OK" || barf
|
---|
72 |
|
---|
73 | chmod 755 /usr/${libdirname}/*.${NCURSES_VER} &&
|
---|
74 | chmod 644 /usr/${libdirname}/libncurses++.a &&
|
---|
75 | mv /usr/${libdirname}/libncurses.so.* /${libdirname}
|
---|
76 | ln -s libncurses.a /usr/${libdirname}/libcurses.a
|
---|
77 | ln -sf ../../${libdirname}/libncurses.so.5 /usr/${libdirname}/libncurses.so
|
---|
78 | ln -sf ../../${libdirname}/libncurses.so.5 /usr/${libdirname}/libcurses.so
|
---|
79 |
|
---|
80 | #ldconfig
|
---|
81 |
|
---|
82 | if [ ! -f /usr/include/term.h -a -f /usr/include/ncurses/term.h ]; then
|
---|
83 | ln -sf ncurses/term.h /usr/include
|
---|
84 | fi
|
---|
85 |
|
---|
86 | # also create a curses.h symlink
|
---|
87 | if [ ! -f /usr/include/curses.h -a -f /usr/include/ncurses/curses.h ]; then
|
---|
88 | ln -sf ncurses/curses.h /usr/include
|
---|
89 | fi
|
---|
90 |
|
---|
91 | /sbin/ldconfig
|
---|