diff options
Diffstat (limited to 'meta/recipes-core/ncurses/ncurses.inc')
-rw-r--r-- | meta/recipes-core/ncurses/ncurses.inc | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc new file mode 100644 index 0000000000..259750cb46 --- /dev/null +++ b/meta/recipes-core/ncurses/ncurses.inc | |||
@@ -0,0 +1,99 @@ | |||
1 | DESCRIPTION = "Ncurses library" | ||
2 | HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" | ||
3 | LICENSE = "MIT" | ||
4 | SECTION = "libs" | ||
5 | DEPENDS = "ncurses-native" | ||
6 | DEPENDS_virtclass-native = "" | ||
7 | PACKAGES_prepend = "ncurses-tools " | ||
8 | PACKAGES_append = " ncurses-terminfo" | ||
9 | FILES_ncurses_append = " ${datadir}/tabset" | ||
10 | RSUGGESTS_${PN} = "ncurses-terminfo" | ||
11 | RPROVIDES = "libncurses5" | ||
12 | |||
13 | inherit autotools | ||
14 | |||
15 | # This keeps only tput/tset in ncurses | ||
16 | # clear/reset are in already busybox | ||
17 | FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear.${PN} ${bindir}/reset.${PN} ${bindir}/tack " | ||
18 | FILES_ncurses-terminfo = "${datadir}/terminfo" | ||
19 | FILES_${PN} = "${bindir}/tput ${bindir}/tset ${libdir}/lib*.so.* /usr/share/tabset /etc/terminfo" | ||
20 | |||
21 | PARALLEL_MAKE="" | ||
22 | |||
23 | FILESPATH = "${FILE_DIRNAME}/local:${FILE_DIRNAME}/ncurses-${PV}-${PR}:${FILE_DIRNAME}/ncurses-${PV}:${FILE_DIRNAME}/ncurses:${FILE_DIRNAME}" | ||
24 | |||
25 | EXTRA_OECONF = "--with-shared \ | ||
26 | --with-libtool \ | ||
27 | --without-profile \ | ||
28 | --without-debug \ | ||
29 | --disable-rpath \ | ||
30 | --enable-echo \ | ||
31 | --enable-const \ | ||
32 | --without-ada \ | ||
33 | --enable-termcap \ | ||
34 | --without-cxx-binding \ | ||
35 | --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \ | ||
36 | --enable-overwrite \ | ||
37 | --with-build-ldflags='' \ | ||
38 | --with-build-ccflags='' " | ||
39 | export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}" | ||
40 | export BUILD_LDFLAGS = "" | ||
41 | export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"' | ||
42 | |||
43 | # This is necessary so that the "tic" command executed during the install can | ||
44 | # link with the correct libary in staging. | ||
45 | export LD_LIBRARY_PATH = "${STAGING_LIBDIR_NATIVE}" | ||
46 | |||
47 | do_install() { | ||
48 | autotools_do_install | ||
49 | |||
50 | ln -sf curses.h ${D}${includedir}/ncurses.h | ||
51 | |||
52 | # our ncurses has termcap support | ||
53 | ln -sf libncurses.so ${D}${libdir}/libtermcap.so | ||
54 | ln -sf libncurses.a ${D}${libdir}/libtermcap.a | ||
55 | |||
56 | # include some basic terminfo files | ||
57 | # stolen ;) from gentoo and modified a bit | ||
58 | for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86 | ||
59 | do | ||
60 | local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)" | ||
61 | local basedir="$(basename $(dirname "${termfile}"))" | ||
62 | |||
63 | if [ -n "${termfile}" ] | ||
64 | then | ||
65 | install -d ${D}${sysconfdir}/terminfo/${basedir} | ||
66 | mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/ | ||
67 | ln -s /etc/terminfo/${basedir}/${x} \ | ||
68 | ${D}${datadir}/terminfo/${basedir}/${x} | ||
69 | fi | ||
70 | done | ||
71 | # i think we can use xterm-color as default xterm | ||
72 | if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ] | ||
73 | then | ||
74 | ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm | ||
75 | fi | ||
76 | |||
77 | if [ "${PN}" = "ncurses" ]; then | ||
78 | mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN} | ||
79 | mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN} | ||
80 | fi | ||
81 | } | ||
82 | |||
83 | |||
84 | pkg_postinst_ncurses-tools () { | ||
85 | if [ "${PN}" = "ncurses" ]; then | ||
86 | update-alternatives --install ${bindir}/clear clear clear.${PN} 100 | ||
87 | update-alternatives --install ${bindir}/reset reset reset.${PN} 100 | ||
88 | fi | ||
89 | } | ||
90 | |||
91 | |||
92 | pkg_prerm_ncurses-tools () { | ||
93 | if [ "${PN}" = "ncurses" ]; then | ||
94 | update-alternatives --remove clear clear.${PN} | ||
95 | update-alternatives --remove reset reset.${PN} | ||
96 | fi | ||
97 | } | ||
98 | |||
99 | BBCLASSEXTEND = "native nativesdk" | ||