From 99d8ca22f1aebb6f61d2cbc6a9df9e09b8f8801d Mon Sep 17 00:00:00 2001 From: mglae Date: Thu, 27 Dec 2018 15:53:05 +0100 Subject: [PATCH] ncurses: update version 6.1-20181215 and improve - add /storage/.config/termcap path for user configuration - disable getcap cache to avoid creation of /storage/none folder - add ncurses:host to PKG_DEPENDS_TARGET to use tic from package - add patch to remove recent xterm terminfo features to be more compatible with other emulations (i.e. Putty) - add patch fixing freeing not allocated memory. Let screen work again --- packages/devel/ncurses/package.mk | 9 +++---- .../patches/ncurses-001-terminfo-xterm.patch | 16 +++++++++++++ .../patches/ncurses-002-alloc-fallbacks.patch | 24 +++++++++++++++++++ 3 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 packages/devel/ncurses/patches/ncurses-001-terminfo-xterm.patch create mode 100644 packages/devel/ncurses/patches/ncurses-002-alloc-fallbacks.patch diff --git a/packages/devel/ncurses/package.mk b/packages/devel/ncurses/package.mk index a61d150955..c04d685099 100644 --- a/packages/devel/ncurses/package.mk +++ b/packages/devel/ncurses/package.mk @@ -2,12 +2,12 @@ # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) PKG_NAME="ncurses" -PKG_VERSION="6.1-20180203" -PKG_SHA256="fac9db9460f271ee632af386a5b502d43a25d7cf14138e3d3166d4bedc4f6cb0" +PKG_VERSION="6.1-20181215" +PKG_SHA256="08b07c3e792961f300829512c283d5fefc0b1c421a57b76922c3d13303ed677d" PKG_LICENSE="MIT" PKG_SITE="http://www.gnu.org/software/ncurses/" PKG_URL="http://invisible-mirror.net/archives/ncurses/current/ncurses-$PKG_VERSION.tgz" -PKG_DEPENDS_TARGET="toolchain zlib" +PKG_DEPENDS_TARGET="toolchain zlib ncurses:host" PKG_LONGDESC="A library is a free software emulation of curses in System V Release 4.0, and more." # causes some segmentation fault's (dialog) when compiled with gcc's link time optimization. PKG_BUILD_FLAGS="+pic" @@ -31,10 +31,11 @@ PKG_CONFIGURE_OPTS_TARGET="--without-ada \ --disable-rpath \ --disable-database \ --with-fallbacks=linux,screen,xterm,xterm-color \ + --with-termpath=/storage/.config/termcap \ --disable-big-core \ --enable-termcap \ --enable-getcap \ - --enable-getcap-cache \ + --disable-getcap-cache \ --enable-symlinks \ --disable-bsdpad \ --without-rcs-ids \ diff --git a/packages/devel/ncurses/patches/ncurses-001-terminfo-xterm.patch b/packages/devel/ncurses/patches/ncurses-001-terminfo-xterm.patch new file mode 100644 index 0000000000..030213be1e --- /dev/null +++ b/packages/devel/ncurses/patches/ncurses-001-terminfo-xterm.patch @@ -0,0 +1,16 @@ + +Remove recent xterm terminfo features to be compatible with other emulations + +--- a/misc/terminfo.src 2018-12-21 18:53:11.000000000 +0100 ++++ a/misc/terminfo.src 2018-12-22 22:56:47.000000000 +0100 +@@ -4335,8 +4335,8 @@ xterm-xfree86|xterm terminal emulator (X + xterm-new|modern xterm terminal emulator, + npc, + indn=\E[%p1%dS, kb2=\EOE, kcbt=\E[Z, kent=\EOM, +- rin=\E[%p1%dT, use=ansi+rep, use=ecma+strikeout, +- use=xterm+sm+1006, use=xterm+pcfkeys, use=xterm+tmux, ++ rin=\E[%p1%dT, use=ecma+strikeout, ++ use=xterm+sm+1005, use=xterm+pcfkeys, use=xterm+tmux, + use=xterm-basic, + + # This fragment is for people who cannot agree on what the backspace key diff --git a/packages/devel/ncurses/patches/ncurses-002-alloc-fallbacks.patch b/packages/devel/ncurses/patches/ncurses-002-alloc-fallbacks.patch new file mode 100644 index 0000000000..218e3a7b32 --- /dev/null +++ b/packages/devel/ncurses/patches/ncurses-002-alloc-fallbacks.patch @@ -0,0 +1,24 @@ +Fix freeing not allocated fallback entries by allocating a copy. + +--- a/ncurses/tinfo/lib_setup.c 2018-11-24 23:13:16.000000000 +0100 ++++ b/ncurses/tinfo/lib_setup.c 2018-12-29 10:31:01.000000000 +0100 +@@ -756,6 +756,8 @@ TINFO_SETUP_TERM(TERMINAL **tp, + if (status != TGETENT_YES) { + const TERMTYPE2 *fallback = _nc_fallback2(tname); + ++ if (fallback) ++ fallback = _nc_copy_entry(fallback); + if (fallback) { + T(("found fallback entry")); + TerminalType(termp) = *fallback; +--- a/ncurses/tinfo/tinfo_driver.c 2018-11-24 23:17:03.000000000 +0100 ++++ b/ncurses/tinfo/tinfo_driver.c 2018-12-29 10:27:19.000000000 +0100 +@@ -172,6 +172,8 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * T + if (status != TGETENT_YES) { + const TERMTYPE2 *fallback = _nc_fallback2(tname); + ++ if (fallback) ++ fallback = _nc_copy_entry(fallback); + if (fallback) { + T(("found fallback entry")); + TerminalType(termp) = *fallback;