diff options
Diffstat (limited to 'meta/recipes-core/ncurses')
-rw-r--r-- | meta/recipes-core/ncurses/ncurses-5.9/config.cache | 4 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch | 27 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses.inc | 296 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/ncurses_5.9.bb | 10 | ||||
-rw-r--r-- | meta/recipes-core/ncurses/site_config/headers | 5 |
5 files changed, 342 insertions, 0 deletions
diff --git a/meta/recipes-core/ncurses/ncurses-5.9/config.cache b/meta/recipes-core/ncurses/ncurses-5.9/config.cache new file mode 100644 index 0000000000..6a9217d5bb --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses-5.9/config.cache | |||
@@ -0,0 +1,4 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | cf_cv_func_nanosleep=yes | ||
4 | cf_cv_func_mkstemp=yes | ||
diff --git a/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch new file mode 100644 index 0000000000..cba89d26f5 --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | 'tic' of some linux distributions (e.g. fedora 11) hang in an infinite | ||
4 | loop when processing the original file. | ||
5 | |||
6 | Index: ncurses-5.7/misc/terminfo.src | ||
7 | =================================================================== | ||
8 | --- ncurses-5.7.orig/misc/terminfo.src | ||
9 | +++ ncurses-5.7/misc/terminfo.src | ||
10 | @@ -3706,12 +3706,11 @@ konsole-xf3x|KDE console window with key | ||
11 | # The value for kbs reflects local customization rather than the settings used | ||
12 | # for XFree86 xterm. | ||
13 | konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm, | ||
14 | - kend=\EOF, khome=\EOH, use=konsole+pcfkeys, | ||
15 | - use=konsole-vt100, | ||
16 | -# Konsole does not implement shifted cursor-keys. | ||
17 | -konsole+pcfkeys|konsole subset of xterm+pcfkeys, | ||
18 | - kLFT@, kRIT@, kcbt=\E[Z, kind@, kri@, kDN@, kUP@, use=xterm+pcc2, | ||
19 | - use=xterm+pcf0, | ||
20 | + kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R, | ||
21 | + kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~, | ||
22 | + kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~, | ||
23 | + kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS, | ||
24 | + khome=\EOH, use=konsole-vt100, | ||
25 | # KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but | ||
26 | # it is still useful for deriving the other entries. | ||
27 | konsole-vt100|KDE console window with vt100 (sic) keyboard, | ||
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc new file mode 100644 index 0000000000..10f7dd175d --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses.inc | |||
@@ -0,0 +1,296 @@ | |||
1 | SUMMARY = "The New Curses library" | ||
2 | DESCRIPTION = "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." | ||
3 | HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" | ||
4 | LICENSE = "MIT" | ||
5 | LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66" | ||
6 | SECTION = "libs" | ||
7 | DEPENDS = "ncurses-native" | ||
8 | DEPENDS_class-native = "" | ||
9 | INC_PR = "r15" | ||
10 | |||
11 | BINCONFIG = "${bindir}/ncurses-config" | ||
12 | |||
13 | inherit autotools binconfig-disabled multilib_header | ||
14 | |||
15 | # Upstream has useful patches at times at ftp://invisible-island.net/ncurses/ | ||
16 | SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz" | ||
17 | |||
18 | EXTRA_AUTORECONF = "-I m4" | ||
19 | CONFIG_SITE =+ "${WORKDIR}/config.cache" | ||
20 | |||
21 | # Whether to enable separate widec libraries; must be 'true' or 'false' | ||
22 | # | ||
23 | # TODO: remove this variable when widec is supported in every setup? | ||
24 | ENABLE_WIDEC ?= "true" | ||
25 | |||
26 | # _GNU_SOURCE is required for widec stuff and is detected automatically | ||
27 | # for target objects. But it must be set manually for native and sdk | ||
28 | # builds. | ||
29 | BUILD_CPPFLAGS += "-D_GNU_SOURCE" | ||
30 | |||
31 | # natives don't generally look in base_libdir | ||
32 | base_libdir_class-native = "${libdir}" | ||
33 | |||
34 | # Display corruption occurs on 64 bit hosts without these settings | ||
35 | # This was derrived from the upstream debian ncurses which uses | ||
36 | # these settings for 32 and 64 bit hosts. | ||
37 | EXCONFIG_ARGS = "" | ||
38 | EXCONFIG_ARGS_class-native = " \ | ||
39 | --disable-lp64 \ | ||
40 | --with-chtype='long' \ | ||
41 | --with-mmask-t='long'" | ||
42 | EXCONFIG_ARGS_class-nativesdk = " \ | ||
43 | --disable-lp64 \ | ||
44 | --with-chtype='long' \ | ||
45 | --with-mmask-t='long'" | ||
46 | |||
47 | PACKAGES_DYNAMIC = "^${PN}-lib.*" | ||
48 | |||
49 | # Fall back to the host termcap / terminfo for -nativesdk and -native | ||
50 | # The reality is a work around for strange problems with things like | ||
51 | # "bitbake -c menuconfig busybox" where it cannot find the terminfo | ||
52 | # because the sstate had a hard coded search path. Until this is fixed | ||
53 | # another way this is deemed good enough. | ||
54 | EX_TERMCAP = "" | ||
55 | EX_TERMCAP_class-native = ":/etc/termcap:/usr/share/misc/termcap" | ||
56 | EX_TERMCAP_class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap" | ||
57 | EX_TERMINFO = "" | ||
58 | EX_TERMINFO_class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo" | ||
59 | EX_TERMINFO_class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo" | ||
60 | |||
61 | # Helper function for do_configure to allow multiple configurations | ||
62 | # $1 the directory to run configure in | ||
63 | # $@ the arguments to pass to configure | ||
64 | ncurses_configure() { | ||
65 | mkdir -p $1 | ||
66 | cd $1 | ||
67 | shift | ||
68 | oe_runconf \ | ||
69 | --disable-static \ | ||
70 | --without-debug \ | ||
71 | --without-ada \ | ||
72 | --without-gpm \ | ||
73 | --enable-hard-tabs \ | ||
74 | --enable-xmc-glitch \ | ||
75 | --enable-colorfgbg \ | ||
76 | --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \ | ||
77 | --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \ | ||
78 | --with-shared \ | ||
79 | --disable-big-core \ | ||
80 | --program-prefix= \ | ||
81 | --with-ticlib \ | ||
82 | --with-termlib=tinfo \ | ||
83 | --enable-sigwinch \ | ||
84 | --enable-pc-files \ | ||
85 | --disable-rpath-hack \ | ||
86 | ${EXCONFIG_ARGS} \ | ||
87 | --with-manpage-format=normal \ | ||
88 | "$@" || return 1 | ||
89 | cd .. | ||
90 | } | ||
91 | |||
92 | # Override the function from the autotools class; ncurses requires a | ||
93 | # patched autoconf213 to generate the configure script. This autoconf | ||
94 | # is not available so that the shipped script will be used. | ||
95 | do_configure() { | ||
96 | # check does not work with cross-compiling and is generally | ||
97 | # broken because it requires stdin to be pollable (which is | ||
98 | # not the case for /dev/null redirections) | ||
99 | export cf_cv_working_poll=yes | ||
100 | |||
101 | # The --enable-pc-files requires PKG_CONFIG_LIBDIR existed | ||
102 | mkdir -p ${PKG_CONFIG_LIBDIR} | ||
103 | ( cd ${S}; gnu-configize --force ) | ||
104 | ncurses_configure "narrowc" || \ | ||
105 | return 1 | ||
106 | ! ${ENABLE_WIDEC} || \ | ||
107 | ncurses_configure "widec" "--enable-widec" "--without-progs" | ||
108 | } | ||
109 | |||
110 | do_compile() { | ||
111 | oe_runmake -C narrowc libs | ||
112 | oe_runmake -C narrowc/progs | ||
113 | |||
114 | ! ${ENABLE_WIDEC} || \ | ||
115 | oe_runmake -C widec libs | ||
116 | } | ||
117 | |||
118 | # set of expected differences between narrowc and widec header | ||
119 | # | ||
120 | # TODO: the NCURSES_CH_T difference can cause real problems :( | ||
121 | _unifdef_cleanup = " \ | ||
122 | -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \ | ||
123 | -e '/^#define NCURSES_CH_T /d' \ | ||
124 | -e '/^#include <wchar.h>/d' \ | ||
125 | -e '\!^/\* .* \*/!d' \ | ||
126 | " | ||
127 | |||
128 | do_test[depends] = "unifdef-native:do_populate_sysroot" | ||
129 | do_test[dirs] = "${S}" | ||
130 | do_test() { | ||
131 | ${ENABLE_WIDEC} || return 0 | ||
132 | |||
133 | # make sure that the narrow and widec header are compatible | ||
134 | # and differ only in minor details. | ||
135 | unifdef -k narrowc/include/curses.h | \ | ||
136 | sed ${_unifdef_cleanup} > curses-narrowc.h | ||
137 | unifdef -k widec/include/curses.h | \ | ||
138 | sed ${_unifdef_cleanup} > curses-widec.h | ||
139 | |||
140 | diff curses-narrowc.h curses-widec.h | ||
141 | } | ||
142 | |||
143 | # Split original _install_opts to two parts. | ||
144 | # One is the options to install contents, the other is the parameters \ | ||
145 | # when running command "make install" | ||
146 | _install_opts = "\ | ||
147 | install.libs install.includes install.man \ | ||
148 | " | ||
149 | _install_cfgs = "\ | ||
150 | DESTDIR='${D}' \ | ||
151 | PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \ | ||
152 | " | ||
153 | |||
154 | do_install() { | ||
155 | # Order of installation is important; widec installs a 'curses.h' | ||
156 | # header with more definitions and must be installed last hence. | ||
157 | # Compatibility of these headers will be checked in 'do_test()'. | ||
158 | oe_runmake -C narrowc ${_install_cfgs} ${_install_opts} \ | ||
159 | install.progs | ||
160 | |||
161 | # The install.data should run after install.libs, otherwise | ||
162 | # there would be a race issue in a very critical conditon, since | ||
163 | # tic will be run by install.data, and tic needs libtinfo.so | ||
164 | # which would be regenerated by install.libs. | ||
165 | oe_runmake -C narrowc ${_install_cfgs} \ | ||
166 | install.data | ||
167 | |||
168 | |||
169 | ! ${ENABLE_WIDEC} || \ | ||
170 | oe_runmake -C widec ${_install_cfgs} ${_install_opts} | ||
171 | |||
172 | cd narrowc | ||
173 | |||
174 | # include some basic terminfo files | ||
175 | # stolen ;) from gentoo and modified a bit | ||
176 | for x in ansi console dumb linux rxvt screen sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color | ||
177 | do | ||
178 | local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)" | ||
179 | local basedir="$(basename $(dirname "${termfile}"))" | ||
180 | |||
181 | if [ -n "${termfile}" ] | ||
182 | then | ||
183 | install -d ${D}${sysconfdir}/terminfo/${basedir} | ||
184 | mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/ | ||
185 | ln -s /etc/terminfo/${basedir}/${x} \ | ||
186 | ${D}${datadir}/terminfo/${basedir}/${x} | ||
187 | fi | ||
188 | done | ||
189 | # i think we can use xterm-color as default xterm | ||
190 | if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ] | ||
191 | then | ||
192 | ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm | ||
193 | fi | ||
194 | |||
195 | rm -f ${D}${libdir}/terminfo | ||
196 | |||
197 | # create linker scripts for libcurses.so and libncurses to | ||
198 | # link against -ltinfo when needed. Some builds might break | ||
199 | # else when '-Wl,--no-copy-dt-needed-entries' has been set in | ||
200 | # linker flags. | ||
201 | for i in libncurses libncursesw; do | ||
202 | f=${D}${libdir}/$i.so | ||
203 | test -h $f || continue | ||
204 | rm -f $f | ||
205 | echo '/* GNU ld script */' >$f | ||
206 | echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f | ||
207 | done | ||
208 | |||
209 | # Make sure that libcurses is linked so that it gets -ltinfo | ||
210 | # also, this should be addressed upstream really. | ||
211 | ln -sf libncurses.so ${D}${libdir}/libcurses.so | ||
212 | |||
213 | # create libtermcap.so linker script for backward compatibility | ||
214 | f=${D}${libdir}/libtermcap.so | ||
215 | echo '/* GNU ld script */' >$f | ||
216 | echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f | ||
217 | |||
218 | if [ ! -d "${D}${base_libdir}" ]; then | ||
219 | # Setting base_libdir to libdir as is done in the -native | ||
220 | # case will skip this code | ||
221 | mkdir ${D}${base_libdir} | ||
222 | mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir} | ||
223 | ! ${ENABLE_WIDEC} || \ | ||
224 | mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir} | ||
225 | |||
226 | mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir} | ||
227 | rm ${D}${libdir}/libtinfo.so | ||
228 | |||
229 | # Use lnr to ensure this is a relative link despite absolute paths | ||
230 | # (as we can't know the relationship between base_libdir and libdir). | ||
231 | # At some point we can rely on coreutils 8.16 which has ln -r. | ||
232 | lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so | ||
233 | fi | ||
234 | |||
235 | oe_multilib_header curses.h | ||
236 | } | ||
237 | |||
238 | python populate_packages_prepend () { | ||
239 | libdir = d.expand("${libdir}") | ||
240 | base_libdir = d.expand("${base_libdir}") | ||
241 | pnbase = d.expand("${PN}-lib%s") | ||
242 | do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True) | ||
243 | if libdir is not base_libdir: | ||
244 | do_split_packages(d, base_libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True) | ||
245 | } | ||
246 | |||
247 | |||
248 | inherit update-alternatives | ||
249 | |||
250 | ALTERNATIVE_PRIORITY = "100" | ||
251 | |||
252 | ALTERNATIVE_ncurses-tools_class-target = "clear reset" | ||
253 | |||
254 | BBCLASSEXTEND = "native nativesdk" | ||
255 | |||
256 | PACKAGES += " \ | ||
257 | ${PN}-tools \ | ||
258 | ${PN}-terminfo \ | ||
259 | ${PN}-terminfo-base \ | ||
260 | " | ||
261 | |||
262 | FILES_${PN} = "\ | ||
263 | ${bindir}/tput \ | ||
264 | ${bindir}/tset \ | ||
265 | ${bindir}/ncurses5-config \ | ||
266 | ${bindir}/ncursesw5-config \ | ||
267 | ${datadir}/tabset \ | ||
268 | " | ||
269 | |||
270 | # This keeps only tput/tset in ncurses | ||
271 | # clear/reset are in already busybox | ||
272 | FILES_${PN}-tools = "\ | ||
273 | ${bindir}/tic \ | ||
274 | ${bindir}/toe \ | ||
275 | ${bindir}/infotocap \ | ||
276 | ${bindir}/captoinfo \ | ||
277 | ${bindir}/infocmp \ | ||
278 | ${bindir}/clear${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \ | ||
279 | ${bindir}/reset${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \ | ||
280 | ${bindir}/tack \ | ||
281 | ${bindir}/tabs \ | ||
282 | " | ||
283 | |||
284 | # 'reset' is a symlink to 'tset' which is in the 'ncurses' package | ||
285 | RDEPENDS_${PN}-tools = "${PN}" | ||
286 | |||
287 | FILES_${PN}-terminfo = "\ | ||
288 | ${datadir}/terminfo \ | ||
289 | " | ||
290 | |||
291 | FILES_${PN}-terminfo-base = "\ | ||
292 | ${sysconfdir}/terminfo \ | ||
293 | " | ||
294 | |||
295 | RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo" | ||
296 | RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base" | ||
diff --git a/meta/recipes-core/ncurses/ncurses_5.9.bb b/meta/recipes-core/ncurses/ncurses_5.9.bb new file mode 100644 index 0000000000..6d23c0c7ea --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses_5.9.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | require ncurses.inc | ||
2 | |||
3 | PR = "${INC_PR}.1" | ||
4 | |||
5 | SRC_URI += "file://tic-hang.patch \ | ||
6 | file://config.cache \ | ||
7 | " | ||
8 | |||
9 | SRC_URI[md5sum] = "8cb9c412e5f2d96bc6f459aa8c6282a1" | ||
10 | SRC_URI[sha256sum] = "9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b" | ||
diff --git a/meta/recipes-core/ncurses/site_config/headers b/meta/recipes-core/ncurses/site_config/headers new file mode 100644 index 0000000000..087b7bfd5e --- /dev/null +++ b/meta/recipes-core/ncurses/site_config/headers | |||
@@ -0,0 +1,5 @@ | |||
1 | curses.h | ||
2 | ncurses/curses.h | ||
3 | ncurses.h | ||
4 | ncurses/termcap.h | ||
5 | |||