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