summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/ncurses/ncurses_5.7.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/ncurses/ncurses_5.7.bb')
-rw-r--r--meta/recipes-core/ncurses/ncurses_5.7.bb242
1 files changed, 242 insertions, 0 deletions
diff --git a/meta/recipes-core/ncurses/ncurses_5.7.bb b/meta/recipes-core/ncurses/ncurses_5.7.bb
new file mode 100644
index 0000000000..33cc16105b
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses_5.7.bb
@@ -0,0 +1,242 @@
1DESCRIPTION = "Ncurses library"
2HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66"
5SECTION = "libs"
6PATCHDATE = "20100501"
7PKGV = "${PV}+${PATCHDATE}"
8PR = "r0"
9
10DEPENDS = "ncurses-native unifdef-native"
11DEPENDS_virtclass-native = "unifdef-native"
12
13inherit autotools binconfig
14
15SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz;name=tarball \
16 ftp://invisible-island.net/ncurses/5.7/ncurses-5.7-20100424-patch.sh.bz2;apply=yes;name=p20100424sh \
17\
18 ftp://invisible-island.net/ncurses/5.7/ncurses-5.7-${PATCHDATE}.patch.gz;name=p20100501 \
19 file://tic-hang.patch \
20 file://config.cache \
21"
22
23SRC_URI[tarball.md5sum] = "cce05daf61a64501ef6cd8da1f727ec6"
24SRC_URI[tarball.sha256sum] = "0a9bdea5c7de8ded5c9327ed642915f2cc380753f12d4ad120ef7da3ea3498f4"
25SRC_URI[p20100424sh.md5sum] = "3a5f76613f0f7ec3e0e73b835bc24864"
26SRC_URI[p20100424sh.sha256sum] = "1e9d70d2d1fe1fea471868832c52f1b9cc6065132102e49e2a3755f2f4f5be53"
27SRC_URI[p20100501.md5sum] = "6518cfa5d45e9069a1e042468161448b"
28SRC_URI[p20100501.sha256sum] = "a97ccc30e4bd6fbb89564f3058db0fe84bd35cfefee831556c500793b477abde"
29
30PARALLEL_MAKE = ""
31EXTRA_AUTORECONF = "-I m4"
32CONFIG_SITE =+ "${WORKDIR}/config.cache"
33
34# Whether to enable separate widec libraries; must be 'true' or 'false'
35#
36# TODO: remove this variable when widec is supported in every setup?
37ENABLE_WIDEC = "true"
38
39# _GNU_SOURCE is required for widec stuff and is detected automatically
40# for target objects. But it must be set manually for native and sdk
41# builds.
42BUILD_CPPFLAGS += "-D_GNU_SOURCE"
43
44# Override the function from the autotools class; ncurses requires a
45# patched autoconf213 to generate the configure script. This autoconf
46# is not available so that the shipped script will be used.
47do_configure() {
48 # check does not work with cross-compiling and is generally
49 # broken because it requires stdin to be pollable (which is
50 # not the case for /dev/null redirections)
51 export cf_cv_working_poll=yes
52
53 for i in \
54 'narrowc' \
55 'widec --enable-widec --without-progs'; do
56 set -- $i
57 mkdir -p $1
58 cd $1
59 shift
60
61 oe_runconf \
62 --disable-static \
63 --without-debug \
64 --without-ada \
65 --without-gpm \
66 --enable-hard-tabs \
67 --enable-xmc-glitch \
68 --enable-colorfgbg \
69 --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap' \
70 --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo' \
71 --with-shared \
72 --disable-big-core \
73 --program-prefix= \
74 --with-ticlib \
75 --with-termlib=tinfo \
76 --enable-sigwinch \
77 --enable-pc-files \
78 --disable-rpath-hack \
79 "$@"
80 cd ..
81 done
82}
83
84do_compile() {
85 oe_runmake -C narrowc libs
86 oe_runmake -C narrowc/progs
87
88 ! ${ENABLE_WIDEC} || \
89 oe_runmake -C widec libs
90}
91
92# set of expected differences between narrowc and widec header
93#
94# TODO: the NCURSES_CH_T difference can cause real problems :(
95_unifdef_cleanup = " \
96 -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
97 -e '/^#define NCURSES_CH_T /d' \
98 -e '/^#include <wchar.h>/d' \
99 -e '\!^/\* .* \*/!d' \
100"
101
102do_test[dirs] = "${S}"
103do_test() {
104 ${ENABLE_WIDEC} || return 0
105
106 # make sure that the narrow and widec header are compatible
107 # and differ only in minor details.
108 unifdef -k narrowc/include/curses.h | \
109 sed ${_unifdef_cleanup} > curses-narrowc.h
110 unifdef -k widec/include/curses.h | \
111 sed ${_unifdef_cleanup} > curses-widec.h
112
113 diff curses-narrowc.h curses-widec.h
114}
115
116_install_opts = "\
117 DESTDIR='${D}' \
118 PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
119 install.libs install.includes install.man \
120"
121
122do_install() {
123 # Order of installation is important; widec installs a 'curses.h'
124 # header with more definitions and must be installed last hence.
125 # Compatibility of these headers will be checked in 'do_test()'.
126 oe_runmake -C narrowc ${_install_opts} \
127 install.data install.progs
128
129 ! ${ENABLE_WIDEC} || \
130 oe_runmake -C widec ${_install_opts}
131
132
133 cd narrowc
134
135 # include some basic terminfo files
136 # stolen ;) from gentoo and modified a bit
137 for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86
138 do
139 local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
140 local basedir="$(basename $(dirname "${termfile}"))"
141
142 if [ -n "${termfile}" ]
143 then
144 install -d ${D}${sysconfdir}/terminfo/${basedir}
145 mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
146 ln -s /etc/terminfo/${basedir}/${x} \
147 ${D}${datadir}/terminfo/${basedir}/${x}
148 fi
149 done
150 # i think we can use xterm-color as default xterm
151 if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
152 then
153 ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
154 fi
155
156 if [ "${PN}" = "ncurses" ]; then
157 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
158 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
159 fi
160
161
162 # create linker scripts for libcurses.so and libncurses to
163 # link against -ltinfo when needed. Some builds might break
164 # else when '-Wl,--no-copy-dt-needed-entries' has been set in
165 # linker flags.
166 for i in libncurses libncursesw; do
167 f=${D}${libdir}/$i.so
168 test -h $f || continue
169 rm -f $f
170 echo '/* GNU ld script */' >$f
171 echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
172 done
173
174 # create libtermcap.so linker script for backward compatibility
175 f=${D}${libdir}/libtermcap.so
176 echo '/* GNU ld script */' >$f
177 echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
178}
179
180python populate_packages_prepend () {
181 libdir = bb.data.expand("${libdir}", d)
182 pnbase = bb.data.expand("${PN}-lib%s", d)
183 do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
184}
185
186
187pkg_postinst_ncurses-tools () {
188 if [ "${PN}" = "ncurses" ]; then
189 update-alternatives --install ${bindir}/clear clear clear.${PN} 100
190 update-alternatives --install ${bindir}/reset reset reset.${PN} 100
191 fi
192}
193
194pkg_prerm_ncurses-tools () {
195 if [ "${PN}" = "ncurses" ]; then
196 update-alternatives --remove clear clear.${PN}
197 update-alternatives --remove reset reset.${PN}
198 fi
199}
200
201BBCLASSEXTEND = "native nativesdk"
202
203PACKAGES += " \
204 ${PN}-tools \
205 ${PN}-terminfo \
206 ${PN}-terminfo-base \
207"
208
209FILES_${PN} = "\
210 ${bindir}/tput \
211 ${bindir}/tset \
212 ${bindir}/ncurses5-config \
213 ${bindir}/ncursesw5-config \
214 ${datadir}/tabset \
215"
216
217# This keeps only tput/tset in ncurses
218# clear/reset are in already busybox
219FILES_${PN}-tools = "\
220 ${bindir}/tic \
221 ${bindir}/toe \
222 ${bindir}/infotocap \
223 ${bindir}/captoinfo \
224 ${bindir}/infocmp \
225 ${bindir}/clear.${PN} \
226 ${bindir}/reset.${PN} \
227 ${bindir}/tack \
228 ${bindir}/tabs \
229"
230# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
231RDEPENDS_${PN}-tools = "${PN}"
232
233FILES_${PN}-terminfo = "\
234 ${datadir}/terminfo \
235"
236
237FILES_${PN}-terminfo-base = "\
238 ${sysconfdir}/terminfo \
239"
240
241RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo"
242RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base"