Upgrade readline

This commit is contained in:
Huang Xin 2022-07-26 04:10:58 -07:00
parent b0616d343c
commit c7793fab62
6 changed files with 193 additions and 0 deletions

View File

@ -0,0 +1,61 @@
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.
# Be 8 bit clean.
set input-meta on
set output-meta on
# To allow the use of 8bit-characters like the german umlauts, comment out
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.
# set convert-meta off
# try to enable the application keypad when it is called. Some systems
# need this to enable the arrow keys.
# set enable-keypad on
# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
# do not bell on tab-completion
# set bell-style none
# some defaults / modifications for the emacs mode
$if mode=emacs
# allow the use of the Home/End keys
# "\e[1~": beginning-of-line
# "\e[4~": end-of-line
# allow the use of the Delete/Insert keys
# "\e[3~": delete-char
# "\e[2~": quoted-insert
# mappings for "page up" and "page down" to step to the beginning/end
# of the history
# "\e[5~": beginning-of-history
# "\e[6~": end-of-history
# alternate mappings for "page up" and "page down" to search the history
# "\e[5~": history-search-backward
# "\e[6~": history-search-forward
# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
# "\e[5C": forward-word
# "\e[5D": backward-word
# "\e\e[C": forward-word
# "\e\e[D": backward-word
# $if term=rxvt
# "\e[8~": end-of-line
# $endif
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
# "\eOH": beginning-of-line
# "\eOF": end-of-line
# for freebsd console
# "\e[H": beginning-of-line
# "\e[F": end-of-line
$endif

View File

@ -0,0 +1,12 @@
READLINE_6.3 {
rl_change_environment;
rl_clear_history;
rl_executing_key;
rl_executing_keyseq;
rl_filename_stat_hook;
rl_history_substr_search_backward;
rl_history_substr_search_forward;
rl_input_available_hook;
rl_print_last_kbd_macro;
rl_signal_event_hook;
};

View File

@ -0,0 +1,57 @@
SUMMARY = "Library for editing typed command lines"
DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
lines, and perform csh-like history expansion on previous commands."
SECTION = "libs"
HOMEPAGE = "https://tiswww.case.edu/php/chet/readline/rltop.html"
# GPL-2.0-or-later (< 6.0), GPL-3.0-or-later (>= 6.0)
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS += "ncurses"
SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive"
SRC_URI += "file://inputrc"
inherit autotools texinfo
EXTRA_AUTORECONF += "--exclude=autoheader"
EXTRA_OECONF += "bash_cv_termcap_lib=ncurses"
LEAD_SONAME = "libreadline.so"
do_configure_prepend () {
if [ ! -e ${S}/acinclude.m4 ]; then
cat ${S}/aclocal.m4 > ${S}/acinclude.m4
fi
}
do_install_append () {
# Make install doesn't properly install these
oe_libinstall -so -C shlib libhistory ${D}${libdir}
oe_libinstall -so -C shlib libreadline ${D}${libdir}
rmdir ${D}${bindir}
rm -rf ${D}${datadir}/${BPN}/*.c
rmdir ${D}${datadir}/${BPN} || true
install -m 0755 -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
}
BBCLASSEXTEND = "native nativesdk"
CONFFILES_${PN} += "${sysconfdir}/inputrc"
inherit update-alternatives
ALTERNATIVE_PRIORITY = "100"
ALTERNATIVE_${PN}-doc = "history.3"
ALTERNATIVE_LINK_NAME[history.3] = "${mandir}/man3/history.3"
# OpenSuse injects versions into libreadline leading to conficits between our native one and theirs
# see their spec file for where this is injected. Extra versioning is harmless so we just do the same.
SRC_URI_append_class-native = " file://rl-native.map"
LDFLAGS_append_class-native = " -Wl,--version-script=${WORKDIR}/rl-native.map"

View File

@ -0,0 +1,35 @@
Upstream-Status: Pending
Without this it fails to link against libtermcap causing various missing
symbols issues.
RP - 8/10/08
Support 6.3 which uses configure.ac rather than configure.in.
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
configure.ac | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index cea8f91..9075b8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -218,10 +218,10 @@ if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
-# case "$SHLIB_LIBS" in
-# *curses*|*termcap*|*termlib*) ;;
-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
-# esac
+ case "$SHLIB_LIBS" in
+ *curses*|*termcap*|*termlib*) ;;
+ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
+ esac
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
--
1.8.1.2

View File

@ -0,0 +1,21 @@
This support script ends up hardcoding unnecessary rpaths into the libraries. We
will search $libdir automatically so this is just wastes space. There may be some
cases this is necessary but our use cases aren't one of them.
Upstream-Status: Inappropriate
RP 2012/2/23
Index: readline-6.2/support/shobj-conf
===================================================================
--- readline-6.2.orig/support/shobj-conf 2012-02-23 11:06:37.193179379 +0000
+++ readline-6.2/support/shobj-conf 2012-02-23 11:06:50.049178918 +0000
@@ -114,7 +114,7 @@
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;

View File

@ -0,0 +1,7 @@
require readline.inc
SRC_URI += "file://configure-fix.patch \
file://norpath.patch \
"
SRC_URI[archive.sha256sum] = "7589a2381a8419e68654a47623ce7dfcb756815c8fee726b98f90bf668af7bc6"