diff options
Diffstat (limited to 'meta/recipes-core/ncurses/ncurses.inc')
| -rw-r--r-- | meta/recipes-core/ncurses/ncurses.inc | 256 |
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" | |||
| 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." | 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" | 3 | HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" |
| 4 | LICENSE = "MIT" | 4 | LICENSE = "MIT" |
| 5 | LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cf3c7ab00720a1b83391f49ea9956277" | 5 | LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66" |
| 6 | SECTION = "libs" | 6 | SECTION = "libs" |
| 7 | DEPENDS = "ncurses-native" | 7 | DEPENDS = "ncurses-native" |
| 8 | DEPENDS_virtclass-native = "" | 8 | DEPENDS_virtclass-native = "" |
| @@ -11,53 +11,121 @@ PACKAGES_append = " ncurses-terminfo" | |||
| 11 | FILES_ncurses_append = " ${datadir}/tabset" | 11 | FILES_ncurses_append = " ${datadir}/tabset" |
| 12 | RSUGGESTS_${PN} = "ncurses-terminfo" | 12 | RSUGGESTS_${PN} = "ncurses-terminfo" |
| 13 | RPROVIDES = "libncurses5" | 13 | RPROVIDES = "libncurses5" |
| 14 | INC_PR = "r0" | ||
| 14 | 15 | ||
| 15 | inherit autotools | 16 | inherit 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 | 19 | SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz" |
| 19 | FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear.${PN} ${bindir}/reset.${PN} ${bindir}/tack " | 20 | |
| 20 | FILES_ncurses-terminfo = "${datadir}/terminfo" | 21 | EXTRA_AUTORECONF = "-I m4" |
| 21 | FILES_${PN} = "${bindir}/tput ${bindir}/tset ${libdir}/lib*.so.* /usr/share/tabset /etc/terminfo" | 22 | CONFIG_SITE =+ "${WORKDIR}/config.cache" |
| 22 | 23 | ||
| 23 | PARALLEL_MAKE="" | 24 | # Whether to enable separate widec libraries; must be 'true' or 'false' |
| 24 | 25 | # | |
| 25 | FILESPATH = "${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 | 27 | ENABLE_WIDEC = "true" | |
| 27 | EXTRA_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 \ | 32 | BUILD_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 \ | 37 | do_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 |
| 41 | export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}" | 42 | |
| 42 | export BUILD_LDFLAGS = "" | 43 | for i in \ |
| 43 | export 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 | |||
| 74 | do_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 | |||
| 92 | do_test[depends] = "unifdef-native:do_populate_sysroot" | ||
| 93 | do_test[dirs] = "${S}" | ||
| 94 | do_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 | ||
| 45 | do_install() { | 113 | do_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 | 171 | python 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 | |||
| 86 | pkg_postinst_ncurses-tools () { | 178 | pkg_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 | |||
| 94 | pkg_prerm_ncurses-tools () { | 185 | pkg_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 | ||
| 101 | BBCLASSEXTEND = "native nativesdk" | 192 | BBCLASSEXTEND = "native nativesdk" |
| 193 | |||
| 194 | PACKAGES += " \ | ||
| 195 | ${PN}-tools \ | ||
| 196 | ${PN}-terminfo \ | ||
| 197 | ${PN}-terminfo-base \ | ||
| 198 | " | ||
| 199 | |||
| 200 | FILES_${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 | ||
| 210 | FILES_${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 | ||
| 222 | RDEPENDS_${PN}-tools = "${PN}" | ||
| 223 | |||
| 224 | FILES_${PN}-terminfo = "\ | ||
| 225 | ${datadir}/terminfo \ | ||
| 226 | " | ||
| 227 | |||
| 228 | FILES_${PN}-terminfo-base = "\ | ||
| 229 | ${sysconfdir}/terminfo \ | ||
| 230 | " | ||
| 231 | |||
| 232 | RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo" | ||
| 233 | RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base" | ||
