2010-09-27 14:44:05 +00:00
SUMMARY = " The New Curses library "
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. "
2005-08-31 10:45:47 +00:00
HOMEPAGE = " http://www.gnu.org/software/ncurses/ncurses.html "
LICENSE = " MIT "
2011-04-07 00:50:40 +00:00
LIC_FILES_CHKSUM = " file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66 "
2005-08-31 10:45:47 +00:00
SECTION = " libs "
DEPENDS = " ncurses-native "
2012-10-27 08:48:17 +00:00
DEPENDS_class - native = " "
2005-08-31 10:45:47 +00:00
2016-12-20 16:11:58 +00:00
BINCONFIG = " ${ bindir } /ncurses5-config ${ bindir } /ncursesw5-config \
$ { bindir } / ncurses6 - config $ { bindir } / ncursesw6 - config "
2014-05-22 09:59:33 +00:00
2015-05-06 13:32:22 +00:00
inherit autotools binconfig - disabled multilib_header pkgconfig
2005-08-31 10:45:47 +00:00
2011-04-07 00:50:40 +00:00
# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
2015-11-25 14:07:32 +00:00
SRC_URI = " git://anonscm.debian.org/collab-maint/ncurses.git "
2011-04-07 00:50:40 +00:00
EXTRA_AUTORECONF = " -I m4 "
CONFIG_SITE =+ " ${ WORKDIR } /config.cache "
2017-05-31 08:27:16 +00:00
EXTRASITECONFIG = " CFLAGS=' ${ CFLAGS } -I ${ SYSROOT_DESTDIR}${includedir } ' "
2011-04-07 00:50:40 +00:00
# Whether to enable separate widec libraries; must be 'true' or 'false'
#
# TODO: remove this variable when widec is supported in every setup?
2011-12-21 09:02:48 +00:00
ENABLE_WIDEC ? = " true "
2011-04-07 00:50:40 +00:00
# _GNU_SOURCE is required for widec stuff and is detected automatically
# for target objects. But it must be set manually for native and sdk
# builds.
BUILD_CPPFLAGS += " -D_GNU_SOURCE "
2012-01-10 19:51:18 +00:00
# natives don't generally look in base_libdir
2012-10-27 08:48:17 +00:00
base_libdir_class - native = " ${ libdir } "
2012-01-05 06:30:29 +00:00
2013-02-09 22:06:57 +00:00
# Display corruption occurs on 64 bit hosts without these settings
# This was derrived from the upstream debian ncurses which uses
# these settings for 32 and 64 bit hosts.
EXCONFIG_ARGS = " "
2014-02-12 12:11:34 +00:00
EXCONFIG_ARGS_class - native = " \
2013-02-09 22:06:57 +00:00
-- disable - lp64 \
-- with - chtype = 'long' \
-- with - mmask - t = 'long' "
2014-02-12 12:11:34 +00:00
EXCONFIG_ARGS_class - nativesdk = " \
2013-02-09 22:06:57 +00:00
-- disable - lp64 \
-- with - chtype = 'long' \
-- with - mmask - t = 'long' "
2013-04-23 15:26:12 +00:00
PACKAGES_DYNAMIC = " ^ ${ PN } -lib.* "
2013-02-09 22:06:57 +00:00
# Fall back to the host termcap / terminfo for -nativesdk and -native
# The reality is a work around for strange problems with things like
# "bitbake -c menuconfig busybox" where it cannot find the terminfo
# because the sstate had a hard coded search path. Until this is fixed
# another way this is deemed good enough.
EX_TERMCAP = " "
2014-02-12 12:11:34 +00:00
EX_TERMCAP_class - native = " :/etc/termcap:/usr/share/misc/termcap "
EX_TERMCAP_class - nativesdk = " :/etc/termcap:/usr/share/misc/termcap "
2013-02-09 22:06:57 +00:00
EX_TERMINFO = " "
2014-02-12 12:11:34 +00:00
EX_TERMINFO_class - native = " :/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo "
EX_TERMINFO_class - nativesdk = " :/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo "
2013-02-09 22:06:57 +00:00
2011-11-08 18:21:28 +00:00
# Helper function for do_configure to allow multiple configurations
# $1 the directory to run configure in
# $@ the arguments to pass to configure
ncurses_configure () {
mkdir - p $ 1
cd $ 1
shift
oe_runconf \
-- without - debug \
-- without - ada \
-- without - gpm \
-- enable - hard - tabs \
-- enable - xmc - glitch \
-- enable - colorfgbg \
2013-02-09 22:06:57 +00:00
-- with - termpath = '${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \
-- with - terminfo - dirs = '${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \
2011-11-08 18:21:28 +00:00
-- with - shared \
-- disable - big - core \
-- program - prefix = \
-- with - ticlib \
-- with - termlib = tinfo \
-- enable - sigwinch \
-- enable - pc - files \
-- disable - rpath - hack \
2013-02-09 22:06:57 +00:00
$ { EXCONFIG_ARGS } \
2011-11-08 18:21:28 +00:00
-- with - manpage - format = normal \
" $ @ " || return 1
cd ..
}
2011-04-07 00:50:40 +00:00
# Override the function from the autotools class; ncurses requires a
# patched autoconf213 to generate the configure script. This autoconf
# is not available so that the shipped script will be used.
do_configure () {
# check does not work with cross-compiling and is generally
# broken because it requires stdin to be pollable (which is
# not the case for /dev/null redirections)
export cf_cv_working_poll = yes
2015-04-06 17:36:29 +00:00
#Remove ${includedir} from CPPFLAGS, need for cross compile
sed - i 's#-I${cf_includedir}##g' $ { S } / configure || die " sed CPPFLAGS "
2011-04-07 00:50:40 +00:00
2014-09-23 04:31:39 +00:00
# The --enable-pc-files requires PKG_CONFIG_LIBDIR existed
mkdir - p $ { PKG_CONFIG_LIBDIR }
2013-03-18 01:15:14 +00:00
( cd $ { S }; gnu - configize -- force )
2011-11-08 18:21:28 +00:00
ncurses_configure " narrowc " || \
return 1
! $ { ENABLE_WIDEC } || \
ncurses_configure " widec " " --enable-widec " " --without-progs "
2015-04-06 17:36:29 +00:00
2011-04-07 00:50:40 +00:00
}
do_compile () {
oe_runmake - C narrowc libs
oe_runmake - C narrowc / progs
! $ { ENABLE_WIDEC } || \
oe_runmake - C widec libs
}
# set of expected differences between narrowc and widec header
#
# TODO: the NCURSES_CH_T difference can cause real problems :(
_unifdef_cleanup = " \
- e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
- e '/^#define NCURSES_CH_T /d' \
- e '/^#include <wchar.h>/d' \
- e '\!^/\* .* \*/!d' \
"
do_test [ depends ] = " unifdef-native:do_populate_sysroot "
do_test [ dirs ] = " ${ S } "
do_test () {
$ { ENABLE_WIDEC } || return 0
# make sure that the narrow and widec header are compatible
# and differ only in minor details.
unifdef - k narrowc / include / curses . h | \
sed $ { _unifdef_cleanup } > curses - narrowc . h
unifdef - k widec / include / curses . h | \
sed $ { _unifdef_cleanup } > curses - widec . h
diff curses - narrowc . h curses - widec . h
}
2012-05-21 06:59:22 +00:00
# Split original _install_opts to two parts.
# One is the options to install contents, the other is the parameters \
# when running command "make install"
2016-03-14 21:29:11 +00:00
# Note that install.libs will also implicitly install header files,
# so we do not need to explicitly specify install.includes.
# Doing so could in fact result in a race condition, as both targets
# (install.libs and install.includes) would install the same headers
# at the same time
_install_opts = " install.libs install.man "
2012-05-21 06:59:22 +00:00
_install_cfgs = " \
2011-04-07 00:50:40 +00:00
DESTDIR = '${D}' \
PKG_CONFIG_LIBDIR = '${libdir}/pkgconfig' \
"
2005-08-31 10:45:47 +00:00
2014-03-03 20:23:35 +00:00
do_install () {
2011-04-07 00:50:40 +00:00
# Order of installation is important; widec installs a 'curses.h'
# header with more definitions and must be installed last hence.
# Compatibility of these headers will be checked in 'do_test()'.
2012-05-21 06:59:22 +00:00
oe_runmake - C narrowc $ { _install_cfgs } $ { _install_opts } \
install . progs
# The install.data should run after install.libs, otherwise
# there would be a race issue in a very critical conditon, since
# tic will be run by install.data, and tic needs libtinfo.so
# which would be regenerated by install.libs.
oe_runmake - C narrowc $ { _install_cfgs } \
install . data
2010-10-02 17:08:19 +00:00
2011-04-07 00:50:40 +00:00
! $ { ENABLE_WIDEC } || \
2012-05-21 06:59:22 +00:00
oe_runmake - C widec $ { _install_cfgs } $ { _install_opts }
2005-08-31 10:45:47 +00:00
2011-04-07 00:50:40 +00:00
cd narrowc
2005-08-31 10:45:47 +00:00
2011-04-07 00:50:40 +00:00
# include some basic terminfo files
# stolen ;) from gentoo and modified a bit
2015-07-17 19:59:28 +00:00
for x in ansi console dumb linux rxvt screen screen - 256 color sun vt52 vt100 vt102 vt200 vt220 xterm - color xterm - xfree86 xterm - 256 color
2005-08-31 10:45:47 +00:00
do
local termfile = " $ (find " $ { D } $ { datadir } / terminfo / " -name " $ { x } " 2>/dev/null) "
local basedir = " $ (basename $ (dirname " $ { termfile } " )) "
if [ - n " ${ termfile } " ]
then
install - d $ { D } $ { sysconfdir } / terminfo / $ { basedir }
mv $ { termfile } $ { D } $ { sysconfdir } / terminfo / $ { basedir } /
ln - s / etc / terminfo / $ { basedir } / $ { x } \
$ { D } $ { datadir } / terminfo / $ { basedir } / $ { x }
fi
done
2011-04-07 00:50:40 +00:00
# i think we can use xterm-color as default xterm
if [ - e $ { D } $ { sysconfdir } / terminfo / x / xterm - color ]
then
ln - sf xterm - color $ { D } $ { sysconfdir } / terminfo / x / xterm
fi
2012-03-15 02:02:13 +00:00
rm - f $ { D } $ { libdir } / terminfo
2012-03-10 04:47:12 +00:00
2011-04-07 00:50:40 +00:00
# create linker scripts for libcurses.so and libncurses to
# link against -ltinfo when needed. Some builds might break
# else when '-Wl,--no-copy-dt-needed-entries' has been set in
# linker flags.
for i in libncurses libncursesw ; do
2012-03-10 04:47:12 +00:00
f = $ { D } $ { libdir } / $i . so
2011-04-07 00:50:40 +00:00
test - h $f || continue
rm - f $f
echo '/* GNU ld script */' > $f
echo " INPUT( $i .so.5 AS_NEEDED(-ltinfo)) " >> $f
done
2012-01-05 06:30:29 +00:00
# Make sure that libcurses is linked so that it gets -ltinfo
# also, this should be addressed upstream really.
2012-03-10 04:47:12 +00:00
ln - sf libncurses . so $ { D } $ { libdir } / libcurses . so
2011-04-07 00:50:40 +00:00
# create libtermcap.so linker script for backward compatibility
2012-03-10 04:47:12 +00:00
f = $ { D } $ { libdir } / libtermcap . so
2011-04-07 00:50:40 +00:00
echo '/* GNU ld script */' > $f
echo 'INPUT(AS_NEEDED(-ltinfo))' >> $f
2011-07-15 14:24:41 +00:00
2012-03-10 04:47:12 +00:00
if [ ! - d " ${ D}${base_libdir } " ]; then
# Setting base_libdir to libdir as is done in the -native
# case will skip this code
mkdir $ { D } $ { base_libdir }
mv $ { D } $ { libdir } / libncurses . so .* $ { D } $ { base_libdir }
2012-03-13 23:40:03 +00:00
! $ { ENABLE_WIDEC } || \
mv $ { D } $ { libdir } / libncursesw . so .* $ { D } $ { base_libdir }
2012-03-10 04:47:12 +00:00
mv $ { D } $ { libdir } / libtinfo . so .* $ { D } $ { base_libdir }
rm $ { D } $ { libdir } / libtinfo . so
2014-03-03 20:23:35 +00:00
# Use lnr to ensure this is a relative link despite absolute paths
# (as we can't know the relationship between base_libdir and libdir).
# At some point we can rely on coreutils 8.16 which has ln -r.
lnr $ { D } $ { base_libdir } / libtinfo . so . 5 $ { D } $ { libdir } / libtinfo . so
2012-03-10 04:47:12 +00:00
fi
2015-04-06 17:36:29 +00:00
if [ - d " ${ D}${includedir } /ncurses " ]; then
for f in `find ${D}${includedir}/ncurses -name "*.h"`
do
f = `basename $f`
test - e $ { D } $ { includedir } / $f && continue
ln - sf ncurses / $f $ { D } $ { includedir } / $f
done
fi
2012-01-05 06:30:29 +00:00
oe_multilib_header curses . h
2005-08-31 10:45:47 +00:00
}
2011-04-07 00:50:40 +00:00
python populate_packages_prepend () {
2012-07-11 17:33:43 +00:00
libdir = d . expand ( " ${ libdir } " )
base_libdir = d . expand ( " ${ base_libdir } " )
pnbase = d . expand ( " ${ PN } -lib%s " )
do_split_packages ( d , libdir , '^lib(.*)\.so\..*' , pnbase , 'ncurses %s library' , prepend = True , extra_depends = '' , allow_links = True )
if libdir is not base_libdir :
do_split_packages ( d , base_libdir , '^lib(.*)\.so\..*' , pnbase , 'ncurses %s library' , prepend = True , extra_depends = '' , allow_links = True )
2011-04-07 00:50:40 +00:00
}
2012-05-15 23:35:04 +00:00
inherit update - alternatives
2011-04-07 00:50:40 +00:00
2012-05-15 23:35:04 +00:00
ALTERNATIVE_PRIORITY = " 100 "
2012-10-23 13:12:45 +00:00
ALTERNATIVE_ncurses - tools_class - target = " clear reset "
2009-11-05 13:01:25 +00:00
BBCLASSEXTEND = " native nativesdk "
2011-04-07 00:50:40 +00:00
PACKAGES += " \
$ { PN } - tools \
$ { PN } - terminfo - base \
2016-04-04 13:41:40 +00:00
$ { PN } - terminfo \
2011-04-07 00:50:40 +00:00
"
FILES_ $ { PN } = " \
$ { bindir } / tput \
$ { bindir } / tset \
$ { bindir } / ncurses5 - config \
$ { bindir } / ncursesw5 - config \
2016-12-20 16:11:58 +00:00
$ { bindir } / ncurses6 - config \
$ { bindir } / ncursesw6 - config \
2011-04-07 00:50:40 +00:00
$ { datadir } / tabset \
2012-01-05 06:30:29 +00:00
"
2011-04-07 00:50:40 +00:00
# This keeps only tput/tset in ncurses
# clear/reset are in already busybox
FILES_ $ { PN } - tools = " \
$ { bindir } / tic \
$ { bindir } / toe \
$ { bindir } / infotocap \
$ { bindir } / captoinfo \
$ { bindir } / infocmp \
2016-02-04 14:06:35 +00:00
$ { bindir } / clear $ { @ [ '' , '.${BPN}' ][ '${CLASSOVERRIDE}' == 'class-target' ]} \
$ { bindir } / reset $ { @ [ '' , '.${BPN}' ][ '${CLASSOVERRIDE}' == 'class-target' ]} \
2011-04-07 00:50:40 +00:00
$ { bindir } / tack \
$ { bindir } / tabs \
"
2012-01-05 06:30:29 +00:00
2011-04-07 00:50:40 +00:00
# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
RDEPENDS_ $ { PN } - tools = " ${ PN } "
FILES_ $ { PN } - terminfo = " \
$ { datadir } / terminfo \
"
FILES_ $ { PN } - terminfo - base = " \
$ { sysconfdir } / terminfo \
"
RSUGGESTS_ $ { PN } - libtinfo = " ${ PN } -terminfo "
RRECOMMENDS_ $ { PN } - libtinfo = " ${ PN } -terminfo-base "