summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/ncurses/ncurses.inc
diff options
context:
space:
mode:
authorTom Rini <tom_rini@mentor.com>2011-04-06 17:50:40 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-04-08 06:18:21 -0700
commit2588569c9781d59b7f3f4f28ed94dea48d29fd68 (patch)
tree9ed0bb23fc8ca55596c1d5915de7e2d06f6bc7de /meta/recipes-core/ncurses/ncurses.inc
parent5a780eb38821f3b6fb8d1be007e3f3323f6f2b83 (diff)
downloadpoky-2588569c9781d59b7f3f4f28ed94dea48d29fd68.tar.gz
ncurses: Update to 5.9
The previous 5.7 release was relatively close to 5.8 due to it bringing in a patch to sync with upstream work-in-progress. We skip over the 5.8 release and move to 5.9. Also, we move most of the contents of the main recipe into the previously unused ncurses.inc file. (From OE-Core rev: 296ac8b2b0fe5b84f04a272b33d1df37bdac986f) Signed-off-by: Tom Rini <tom_rini@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/ncurses/ncurses.inc')
-rw-r--r--meta/recipes-core/ncurses/ncurses.inc256
1 files changed, 194 insertions, 62 deletions
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc
index 3f897f6ad2..e244eb8b4f 100644
--- a/meta/recipes-core/ncurses/ncurses.inc
+++ b/meta/recipes-core/ncurses/ncurses.inc
@@ -2,7 +2,7 @@ SUMMARY = "The New Curses library"
2DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library." 2DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library."
3HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" 3HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
4LICENSE = "MIT" 4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cf3c7ab00720a1b83391f49ea9956277" 5LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66"
6SECTION = "libs" 6SECTION = "libs"
7DEPENDS = "ncurses-native" 7DEPENDS = "ncurses-native"
8DEPENDS_virtclass-native = "" 8DEPENDS_virtclass-native = ""
@@ -11,53 +11,121 @@ PACKAGES_append = " ncurses-terminfo"
11FILES_ncurses_append = " ${datadir}/tabset" 11FILES_ncurses_append = " ${datadir}/tabset"
12RSUGGESTS_${PN} = "ncurses-terminfo" 12RSUGGESTS_${PN} = "ncurses-terminfo"
13RPROVIDES = "libncurses5" 13RPROVIDES = "libncurses5"
14INC_PR = "r0"
14 15
15inherit autotools 16inherit autotools binconfig
16 17
17# This keeps only tput/tset in ncurses 18# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
18# clear/reset are in already busybox 19SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz"
19FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear.${PN} ${bindir}/reset.${PN} ${bindir}/tack " 20
20FILES_ncurses-terminfo = "${datadir}/terminfo" 21EXTRA_AUTORECONF = "-I m4"
21FILES_${PN} = "${bindir}/tput ${bindir}/tset ${libdir}/lib*.so.* /usr/share/tabset /etc/terminfo" 22CONFIG_SITE =+ "${WORKDIR}/config.cache"
22 23
23PARALLEL_MAKE="" 24# Whether to enable separate widec libraries; must be 'true' or 'false'
24 25#
25FILESPATH = "${FILE_DIRNAME}/local:${FILE_DIRNAME}/ncurses-${PV}-${PR}:${FILE_DIRNAME}/ncurses-${PV}:${FILE_DIRNAME}/ncurses:${FILE_DIRNAME}" 26# TODO: remove this variable when widec is supported in every setup?
26 27ENABLE_WIDEC = "true"
27EXTRA_OECONF = "--with-shared \ 28
28 --with-libtool \ 29# _GNU_SOURCE is required for widec stuff and is detected automatically
29 --without-profile \ 30# for target objects. But it must be set manually for native and sdk
30 --without-debug \ 31# builds.
31 --disable-rpath \ 32BUILD_CPPFLAGS += "-D_GNU_SOURCE"
32 --enable-echo \ 33
33 --enable-const \ 34# Override the function from the autotools class; ncurses requires a
34 --without-ada \ 35# patched autoconf213 to generate the configure script. This autoconf
35 --enable-termcap \ 36# is not available so that the shipped script will be used.
36 --without-cxx-binding \ 37do_configure() {
37 --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \ 38 # check does not work with cross-compiling and is generally
38 --enable-overwrite \ 39 # broken because it requires stdin to be pollable (which is
39 --with-build-ldflags='' \ 40 # not the case for /dev/null redirections)
40 --with-build-ccflags='' " 41 export cf_cv_working_poll=yes
41export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}" 42
42export BUILD_LDFLAGS = "" 43 for i in \
43export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"' 44 'narrowc' \
45 'widec --enable-widec --without-progs'; do
46 set -- $i
47 mkdir -p $1
48 cd $1
49 shift
50
51 oe_runconf \
52 --disable-static \
53 --without-debug \
54 --without-ada \
55 --without-gpm \
56 --enable-hard-tabs \
57 --enable-xmc-glitch \
58 --enable-colorfgbg \
59 --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap' \
60 --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo' \
61 --with-shared \
62 --disable-big-core \
63 --program-prefix= \
64 --with-ticlib \
65 --with-termlib=tinfo \
66 --enable-sigwinch \
67 --enable-pc-files \
68 --disable-rpath-hack \
69 "$@"
70 cd ..
71 done
72}
73
74do_compile() {
75 oe_runmake -C narrowc libs
76 oe_runmake -C narrowc/progs
77
78 ! ${ENABLE_WIDEC} || \
79 oe_runmake -C widec libs
80}
81
82# set of expected differences between narrowc and widec header
83#
84# TODO: the NCURSES_CH_T difference can cause real problems :(
85_unifdef_cleanup = " \
86 -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
87 -e '/^#define NCURSES_CH_T /d' \
88 -e '/^#include <wchar.h>/d' \
89 -e '\!^/\* .* \*/!d' \
90"
91
92do_test[depends] = "unifdef-native:do_populate_sysroot"
93do_test[dirs] = "${S}"
94do_test() {
95 ${ENABLE_WIDEC} || return 0
96
97 # make sure that the narrow and widec header are compatible
98 # and differ only in minor details.
99 unifdef -k narrowc/include/curses.h | \
100 sed ${_unifdef_cleanup} > curses-narrowc.h
101 unifdef -k widec/include/curses.h | \
102 sed ${_unifdef_cleanup} > curses-widec.h
103
104 diff curses-narrowc.h curses-widec.h
105}
106
107_install_opts = "\
108 DESTDIR='${D}' \
109 PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
110 install.libs install.includes install.man \
111"
44 112
45do_install() { 113do_install() {
46 # This is necessary so that the "tic" command executed during the install can 114 # Order of installation is important; widec installs a 'curses.h'
47 # link with the correct libary in staging. 115 # header with more definitions and must be installed last hence.
48 export LD_LIBRARY_PATH="${STAGING_LIBDIR_NATIVE}" 116 # Compatibility of these headers will be checked in 'do_test()'.
117 oe_runmake -C narrowc ${_install_opts} \
118 install.data install.progs
49 119
50 autotools_do_install 120 ! ${ENABLE_WIDEC} || \
121 oe_runmake -C widec ${_install_opts}
51 122
52 ln -sf curses.h ${D}${includedir}/ncurses.h
53 123
54 # our ncurses has termcap support 124 cd narrowc
55 ln -sf libncurses.so ${D}${libdir}/libtermcap.so
56 ln -sf libncurses.a ${D}${libdir}/libtermcap.a
57 125
58 # include some basic terminfo files 126 # include some basic terminfo files
59 # stolen ;) from gentoo and modified a bit 127 # stolen ;) from gentoo and modified a bit
60 for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86 128 for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86
61 do 129 do
62 local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)" 130 local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
63 local basedir="$(basename $(dirname "${termfile}"))" 131 local basedir="$(basename $(dirname "${termfile}"))"
@@ -70,32 +138,96 @@ do_install() {
70 ${D}${datadir}/terminfo/${basedir}/${x} 138 ${D}${datadir}/terminfo/${basedir}/${x}
71 fi 139 fi
72 done 140 done
73 # i think we can use xterm-color as default xterm 141 # i think we can use xterm-color as default xterm
74 if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ] 142 if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
75 then 143 then
76 ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm 144 ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
77 fi 145 fi
78 146
79 if [ "${PN}" = "ncurses" ]; then 147 if [ "${PN}" = "ncurses" ]; then
80 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN} 148 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
81 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN} 149 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
82 fi 150 fi
151
152
153 # create linker scripts for libcurses.so and libncurses to
154 # link against -ltinfo when needed. Some builds might break
155 # else when '-Wl,--no-copy-dt-needed-entries' has been set in
156 # linker flags.
157 for i in libncurses libncursesw; do
158 f=${D}${libdir}/$i.so
159 test -h $f || continue
160 rm -f $f
161 echo '/* GNU ld script */' >$f
162 echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
163 done
164
165 # create libtermcap.so linker script for backward compatibility
166 f=${D}${libdir}/libtermcap.so
167 echo '/* GNU ld script */' >$f
168 echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
83} 169}
84 170
85 171python populate_packages_prepend () {
172 libdir = bb.data.expand("${libdir}", d)
173 pnbase = bb.data.expand("${PN}-lib%s", d)
174 do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
175}
176
177
86pkg_postinst_ncurses-tools () { 178pkg_postinst_ncurses-tools () {
87 if [ "${PN}" = "ncurses" ]; then 179 if [ "${PN}" = "ncurses" ]; then
88 update-alternatives --install ${bindir}/clear clear clear.${PN} 100 180 update-alternatives --install ${bindir}/clear clear clear.${PN} 100
89 update-alternatives --install ${bindir}/reset reset reset.${PN} 100 181 update-alternatives --install ${bindir}/reset reset reset.${PN} 100
90 fi 182 fi
91} 183}
92 184
93
94pkg_prerm_ncurses-tools () { 185pkg_prerm_ncurses-tools () {
95 if [ "${PN}" = "ncurses" ]; then 186 if [ "${PN}" = "ncurses" ]; then
96 update-alternatives --remove clear clear.${PN} 187 update-alternatives --remove clear clear.${PN}
97 update-alternatives --remove reset reset.${PN} 188 update-alternatives --remove reset reset.${PN}
98 fi 189 fi
99} 190}
100 191
101BBCLASSEXTEND = "native nativesdk" 192BBCLASSEXTEND = "native nativesdk"
193
194PACKAGES += " \
195 ${PN}-tools \
196 ${PN}-terminfo \
197 ${PN}-terminfo-base \
198"
199
200FILES_${PN} = "\
201 ${bindir}/tput \
202 ${bindir}/tset \
203 ${bindir}/ncurses5-config \
204 ${bindir}/ncursesw5-config \
205 ${datadir}/tabset \
206"
207
208# This keeps only tput/tset in ncurses
209# clear/reset are in already busybox
210FILES_${PN}-tools = "\
211 ${bindir}/tic \
212 ${bindir}/toe \
213 ${bindir}/infotocap \
214 ${bindir}/captoinfo \
215 ${bindir}/infocmp \
216 ${bindir}/clear.${PN} \
217 ${bindir}/reset.${PN} \
218 ${bindir}/tack \
219 ${bindir}/tabs \
220"
221# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
222RDEPENDS_${PN}-tools = "${PN}"
223
224FILES_${PN}-terminfo = "\
225 ${datadir}/terminfo \
226"
227
228FILES_${PN}-terminfo-base = "\
229 ${sysconfdir}/terminfo \
230"
231
232RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo"
233RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base"