mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #5944 from mglae/le11_ncursesw
ncurses: build ncursesw for UTF-8 support
This commit is contained in:
commit
abe9cfd552
@ -38,7 +38,6 @@ PKG_CONFIGURE_OPTS_TARGET=" \
|
||||
|
||||
pre_configure_target() {
|
||||
LDFLAGS+=" -lcrypto -lssl"
|
||||
CFLAGS+=' -DNCURSES_WIDECHAR=0'
|
||||
}
|
||||
|
||||
post_makeinstall_target() {
|
||||
|
@ -1,71 +0,0 @@
|
||||
See https://midnight-commander.org/ticket/4200
|
||||
|
||||
diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c
|
||||
index 5cddf5059..2c117ef4b 100644
|
||||
--- a/lib/tty/tty-ncurses.c
|
||||
+++ b/lib/tty/tty-ncurses.c
|
||||
@@ -560,6 +560,7 @@ tty_fill_region (int y, int x, int rows, int cols, unsigned char ch)
|
||||
void
|
||||
tty_colorize_area (int y, int x, int rows, int cols, int color)
|
||||
{
|
||||
+#ifdef ENABLE_SHADOWS
|
||||
cchar_t *ctext;
|
||||
wchar_t wch[10]; /* TODO not sure if the length is correct */
|
||||
attr_t attrs;
|
||||
@@ -585,6 +586,13 @@ tty_colorize_area (int y, int x, int rows, int cols, int color)
|
||||
}
|
||||
|
||||
g_free (ctext);
|
||||
+#else
|
||||
+ (void) y;
|
||||
+ (void) x;
|
||||
+ (void) rows;
|
||||
+ (void) cols;
|
||||
+ (void) color;
|
||||
+#endif /* ENABLE_SHADOWS */
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
diff --git a/lib/tty/tty-ncurses.h b/lib/tty/tty-ncurses.h
|
||||
index d75df9533..8feb17ccd 100644
|
||||
--- a/lib/tty/tty-ncurses.h
|
||||
+++ b/lib/tty/tty-ncurses.h
|
||||
@@ -30,6 +30,11 @@
|
||||
#define NCURSES_CONST const
|
||||
#endif
|
||||
|
||||
+/* do not draw shadows if NCurses is built with --disable-widec */
|
||||
+#if defined(NCURSES_WIDECHAR) && NCURSES_WIDECHAR
|
||||
+#define ENABLE_SHADOWS 1
|
||||
+#endif
|
||||
+
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
diff --git a/lib/tty/tty-slang.h b/lib/tty/tty-slang.h
|
||||
index c36785ffc..15fd00a94 100644
|
||||
--- a/lib/tty/tty-slang.h
|
||||
+++ b/lib/tty/tty-slang.h
|
||||
@@ -27,6 +27,8 @@
|
||||
#define COLS SLtt_Screen_Cols
|
||||
#define LINES SLtt_Screen_Rows
|
||||
|
||||
+#define ENABLE_SHADOWS 1
|
||||
+
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
enum
|
||||
diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
|
||||
index ed16d04dd..4c1f5ba84 100644
|
||||
--- a/src/filemanager/boxes.c
|
||||
+++ b/src/filemanager/boxes.c
|
||||
@@ -280,7 +280,9 @@ appearance_box_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
|
||||
switch (msg)
|
||||
{
|
||||
case MSG_INIT:
|
||||
+#ifdef ENABLE_SHADOWS
|
||||
if (!tty_use_colors ())
|
||||
+#endif
|
||||
{
|
||||
Widget *shadow;
|
||||
|
@ -3,15 +3,14 @@
|
||||
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="ncurses"
|
||||
PKG_VERSION="6.1-20181215"
|
||||
PKG_SHA256="08b07c3e792961f300829512c283d5fefc0b1c421a57b76922c3d13303ed677d"
|
||||
PKG_VERSION="6.3"
|
||||
PKG_SHA256="97fc51ac2b085d4cde31ef4d2c3122c21abc217e9090a43a30fc5ec21684e059"
|
||||
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_URL="http://invisible-mirror.net/archives/ncurses/ncurses-${PKG_VERSION}.tar.gz"
|
||||
PKG_DEPENDS_HOST="ccache:host"
|
||||
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"
|
||||
|
||||
PKG_CONFIGURE_OPTS_TARGET="--without-ada \
|
||||
@ -54,11 +53,12 @@ PKG_CONFIGURE_OPTS_TARGET="--without-ada \
|
||||
--disable-hashmap \
|
||||
--disable-safe-sprintf \
|
||||
--disable-scroll-hints \
|
||||
--disable-widec \
|
||||
--enable-widec \
|
||||
--disable-echo \
|
||||
--disable-warnings \
|
||||
--disable-home-terminfo \
|
||||
--disable-assertions"
|
||||
--disable-assertions \
|
||||
--enable-leaks"
|
||||
|
||||
PKG_CONFIGURE_OPTS_HOST="--enable-termcap \
|
||||
--with-termlib \
|
||||
@ -67,9 +67,17 @@ PKG_CONFIGURE_OPTS_HOST="--enable-termcap \
|
||||
--without-manpages"
|
||||
|
||||
post_makeinstall_target() {
|
||||
local f
|
||||
cp misc/ncurses-config ${TOOLCHAIN}/bin
|
||||
chmod +x ${TOOLCHAIN}/bin/ncurses-config
|
||||
sed -e "s:\(['=\" ]\)/usr:\\1${PKG_ORIG_SYSROOT_PREFIX}/usr:g" -i ${TOOLCHAIN}/bin/ncurses-config
|
||||
rm -f ${TOOLCHAIN}/bin/ncurses6-config
|
||||
rm -rf ${INSTALL}/usr/bin
|
||||
# create links to be compatible with any ncurses include path and lib names
|
||||
ln -sf . ${SYSROOT_PREFIX}/usr/include/ncursesw
|
||||
ln -sf . ${SYSROOT_PREFIX}/usr/include/ncurses
|
||||
for f in form menu ncurses panel; do
|
||||
ln -sf lib${f}w.a ${SYSROOT_PREFIX}/usr/lib/lib${f}.a
|
||||
ln -sf ${f}w.pc ${SYSROOT_PREFIX}/usr/lib/pkgconfig/${f}.pc
|
||||
done
|
||||
}
|
||||
|
@ -1,16 +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,
|
||||
--- a/misc/terminfo.src 2021-03-20 22:45:39.000000000 +0100
|
||||
+++ b/misc/terminfo.src 2021-06-01 23:53:10.335516419 +0200
|
||||
@@ -4808,8 +4808,8 @@ xterm-xfree86|xterm terminal emulator (X
|
||||
xterm+nofkeys|building block for xterm fkey-variants,
|
||||
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,
|
||||
kcbt=\E[Z, kent=\EOM, nel=\EE, use=ecma+index,
|
||||
- use=ansi+rep, use=ecma+strikeout, use=vt420+lrmm,
|
||||
- use=xterm+sm+1006, use=xterm+tmux, use=ecma+italics,
|
||||
+ use=ecma+strikeout, use=vt420+lrmm,
|
||||
+ use=xterm+sm+1005, use=xterm+tmux, use=ecma+italics,
|
||||
use=xterm+keypad, use=xterm-basic,
|
||||
|
||||
# This fragment is for people who cannot agree on what the backspace key
|
||||
# This version reflects the current xterm features.
|
||||
|
@ -1,19 +1,8 @@
|
||||
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
|
||||
@@ -180,6 +180,8 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * T
|
||||
if (status != TGETENT_YES) {
|
||||
const TERMTYPE2 *fallback = _nc_fallback2(tname);
|
||||
|
||||
|
18
packages/devel/ncurses/patches/ncurses-003-fix_hints.patch
Normal file
18
packages/devel/ncurses/patches/ncurses-003-fix_hints.patch
Normal file
@ -0,0 +1,18 @@
|
||||
Fix USE_SCROLL_HINTS/USE_HASHMAP logic
|
||||
|
||||
--- a/ncurses/curses.priv.h 2018-12-16 02:16:58.000000000 +0100
|
||||
+++ a/ncurses/curses.priv.h 2021-05-30 00:12:14.086528124 +0200
|
||||
@@ -258,10 +258,9 @@ extern NCURSES_EXPORT(void *) _nc_memmov
|
||||
/*
|
||||
* Scroll hints are useless when hashmap is used
|
||||
*/
|
||||
-#if !USE_SCROLL_HINTS
|
||||
-#if !USE_HASHMAP
|
||||
-#define USE_SCROLL_HINTS 1
|
||||
-#else
|
||||
+#if USE_SCROLL_HINTS
|
||||
+#if USE_HASHMAP
|
||||
+#undef USE_SCROLL_HINTS
|
||||
#define USE_SCROLL_HINTS 0
|
||||
#endif
|
||||
#endif
|
@ -0,0 +1,13 @@
|
||||
Fix configure option --with-pkg-config-libdir is broken for cross compilation
|
||||
|
||||
--- a/configure 2021-10-17 17:12:23.000000000 +0200
|
||||
+++ b/configure 2021-11-26 00:27:00.224815736 +0100
|
||||
@@ -4229,7 +4229,7 @@ echo $ECHO_N "checking for first directo
|
||||
cf_pkg_config_path=none
|
||||
for cf_config in $cf_search_path
|
||||
do
|
||||
- if test -d "$cf_config"
|
||||
+ if test -n "$cf_config"
|
||||
then
|
||||
cf_pkg_config_path=$cf_config
|
||||
break
|
Loading…
x
Reference in New Issue
Block a user