Merge oe-devel@oe-devel.bkbits.net:packages
[vuplus_openembedded] / ncurses / ncurses_5.4.oe
1 PR = "r3"
2 DESCRIPTION = "Ncurses library"
3 HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
4 LICENSE = "MIT"
5 SECTION = "libs"
6 DEPENDS = "ncurses-native"
7 PACKAGES_append = " ncurses-terminfo"
8 FILES_ncurses_append = " ${datadir}/tabset"
9 FILES_ncurses-terminfo = "${datadir}/terminfo"
10 RSUGGESTS_${PN} = "ncurses-terminfo"
11
12 SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz"
13 S = "${WORKDIR}/ncurses-${PV}"
14
15 inherit autotools
16
17 EXTRA_OECONF = "--with-shared \
18                 --without-profile \
19                 --without-debug \
20                 --disable-rpath \
21                 --enable-echo \
22                 --enable-const \
23                 --without-ada \
24                 --enable-termcap \
25                 --without-cxx-binding \
26                 --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \
27                 --enable-overwrite"
28 export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}"
29 export BUILD_LDFLAGS = ""
30 export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"'
31
32 do_configure_prepend () {
33         if [ -e aclocal.m4 -a ! -e acinclude.m4 ]; then
34                 cat aclocal.m4 > acinclude.m4
35         fi
36 }
37
38 do_configure () {
39 # override this function to avoid the autoconf/automake/aclocal/autoheader
40 # calls for now
41         gnu-configize
42         oe_runconf
43 }
44
45 do_stage () {
46         for i in libncurses libpanel libform libmenu; do
47                 oe_libinstall -so -C lib $i ${STAGING_LIBDIR}
48         done
49         for h in ncurses_*.h curses.h eti.h form.h menu.h panel.h \
50                 termcap.h term.h unctrl.h; do
51                        install -m 0644 include/$h ${STAGING_INCDIR}/
52         done
53         ln -sf curses.h ${STAGING_INCDIR}/ncurses.h
54 }
55
56 do_install() {
57         autotools_do_install
58
59         # include some basic terminfo files
60         # stolen ;) from gentoo and modified a bit
61         for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86
62         do
63                 local termfile="$(find "${D}/usr/share/terminfo/" -name "${x}" 2>/dev/null)"
64                 local basedir="$(basename $(dirname "${termfile}"))"
65
66                 if [ -n "${termfile}" ]
67                 then
68                         install -d ${D}/etc/terminfo/${basedir}
69                         mv ${termfile} ${D}/etc/terminfo/${basedir}/
70                         ln -s /etc/terminfo/${basedir}/${x} \
71                                 ${D}/usr/share/terminfo/${basedir}/${x}
72                 fi
73         done
74         # i think we can use xterm-color as default xterm
75         if [ -e ${D}/etc/terminfo/x/xterm-color ]
76         then
77                 ln -sf xterm-color ${D}/etc/terminfo/x/xterm
78         fi
79 }