fix mc compile failure while ncurses upgraded
cover fix mc compile failure while ncurses upgraded
The following changes since commit 73a8f9df9f4b5e0d87605962c3bd8dcbaef28aea:
layer.conf: Remove mc from packagegroup-core-full-cmdline-utils (2017-08-17 17:37:57 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib hongxu/fix-gplv2-mc
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=hongxu/fix-gplv2-mc
Hongxu Jia (3):
Revert "layer.conf: Remove mc from
packagegroup-core-full-cmdline-utils"
Revert "mc: Drop from meta-gplv2 as incompatible with newer ncurses
versions"
mc: unify curses initialization
conf/layer.conf | 2 - ...3697-tty_init-unify-curses-initialization.patch | 51 ++++++++++++++++++++++ recipes-extended/mc/mc/mc-CTRL.patch | 31 +++++++++++++ recipes-extended/mc/mc_4.7.5.2.bb | 48 ++++++++++++++++++++ 4 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 recipes-extended/mc/mc/0001-Ticket-3697-tty_init-unify-curses-initialization.patch create mode 100644 recipes-extended/mc/mc/mc-CTRL.patch create mode 100644 recipes-extended/mc/mc_4.7.5.2.bb
Signature · 1 line
2.8.1
PATCH 1/3 Revert "layer.conf: Remove mc from packagegroup-core-full-cmdline-utils"
This reverts commit 73a8f9df9f4b5e0d87605962c3bd8dcbaef28aea.
--- conf/layer.conf | 2 -- 1 file changed, 2 deletions(-)
conf/layer.conf +0 -2
@@ -13,5 +13,3 @@ BBFILE_PRIORITY_gplv2 = "1" LAYERVERSION_gplv2 = "1" LAYERDEPENDS_gplv2 = "core" - -RDEPENDS_packagegroup-core-full-cmdline-utils_remove_pn-packagegroup-core-full-cmdline = "mc mc-fish mc-helpers mc-helpers-perl"
Signature · 1 line
2.8.1
PATCH 2/3 Revert "mc: Drop from meta-gplv2 as incompatible with newer ncurses versions"
In reply to Hongxu JiaThis reverts commit ec80d2cac67a952b06ed27fbd4d71f17641e9a7c.
--- recipes-extended/mc/mc/mc-CTRL.patch | 31 ++++++++++++++++++++++++ recipes-extended/mc/mc_4.7.5.2.bb | 47 ++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 recipes-extended/mc/mc/mc-CTRL.patch create mode 100644 recipes-extended/mc/mc_4.7.5.2.bb
recipes-extended/mc/mc/mc-CTRL.patch new file +31 -0
@@ -0,0 +1,31 @@ +Fix build with musl by ensuring CTRL is defined. + +musl does not define CTRL in <termios.h>, we could include <sys/ttydefaults.h> +explicitly but it's easier just to ensure CTRL is defined. + +This patch is taken from Sabotage Linux, the license statement for patches and +build scripts in Sabotage Linux says: + + To the extent possible under law, Christian Neukirchen has waived + all copyright and related or neighboring rights to this work. + + http://creativecommons.org/publicdomain/zero/1.0/ + +Therefore this should be good to include in OpenEmbedded. + +Signed-off-by: Paul Barker <[email protected]> + +Upstream-Status: Accepted (should be included in v4.8.14) + +diff -u mc-4.8.1.7.org/lib/tty/tty-ncurses.c mc-4.8.1.7/lib/tty/tty-ncurses.c +--- mc-4.8.1.7.org/lib/tty/tty-ncurses.c ++++ mc-4.8.1.7/lib/tty/tty-ncurses.c +@@ -65,7 +65,7 @@ + + /*** file scope macro definitions ****************************************************************/ + +-#if defined(_AIX) && !defined(CTRL) ++#if !defined(CTRL) + #define CTRL(x) ((x) & 0x1f) + #endif +
recipes-extended/mc/mc_4.7.5.2.bb new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.8.1
PATCH 3/3 mc: unify curses initialization
In reply to Hongxu JiaSince ncurses upgraded to 6.0+20170715, it compile failed
...
| ../../../mc-4.7.5.2/lib/tty/tty-ncurses.c: In function 'tty_init':
| ../../../mc-4.7.5.2/lib/tty/tty-ncurses.c:163:13: error:
dereferencing pointer to incomplete type 'TERMINAL {aka struct term}'
| cur_term->Nttyb.c_cc[VINTR] = CTRL ('g'); /* ^g */
...
Backport a patch from upstream and rebase to 4.7.5.2 could fix the issue.
--- ...3697-tty_init-unify-curses-initialization.patch | 51 ++++++++++++++++++++++ recipes-extended/mc/mc_4.7.5.2.bb | 1 + 2 files changed, 52 insertions(+) create mode 100644 recipes-extended/mc/mc/0001-Ticket-3697-tty_init-unify-curses-initialization.patch
recipes-extended/mc/mc/0001-Ticket-3697-tty_init-unify-curses-initialization.patch new file +51 -0
@@ -0,0 +1,51 @@ +From 4d46a108629beb66a293672db7b44f863b6598ba Mon Sep 17 00:00:00 2001 +From: Thomas Dickey <[email protected]> +Date: Fri, 14 Apr 2017 14:06:13 +0300 +Subject: [PATCH] Ticket #3697: (tty_init): unify curses initialization + +...for various curses implementations. + +Signed-off-by: Andrew Borodin <[email protected]> + +Upstream-Status: Backport [https://github.com/MidnightCommander/mc.git] + +Signed-off-by: Hongxu Jia <[email protected]> +--- + lib/tty/tty-ncurses.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c +index ab61891..47e537e 100644 +--- a/lib/tty/tty-ncurses.c ++++ b/lib/tty/tty-ncurses.c +@@ -144,6 +144,8 @@ tty_init (gboolean slow, gboolean ugly_lines) + slow_tty = slow; + (void) ugly_lines; + ++ struct termios mode; ++ + initscr (); + + #ifdef HAVE_ESCDELAY +@@ -159,11 +161,15 @@ tty_init (gboolean slow, gboolean ugly_lines) + ESCDELAY = 200; + #endif /* HAVE_ESCDELAY */ + ++ tcgetattr (STDIN_FILENO, &mode); + /* use Ctrl-g to generate SIGINT */ +- cur_term->Nttyb.c_cc[VINTR] = CTRL ('g'); /* ^g */ ++ mode.c_cc[VINTR] = CTRL ('g'); /* ^g */ + /* disable SIGQUIT to allow use Ctrl-\ key */ +- cur_term->Nttyb.c_cc[VQUIT] = NULL_VALUE; +- tcsetattr (cur_term->Filedes, TCSANOW, &cur_term->Nttyb); ++ mode.c_cc[VQUIT] = NULL_VALUE; ++ tcsetattr (STDIN_FILENO, TCSANOW, &mode); ++ ++ /* curses remembers the "in-program" modes after this call */ ++ def_prog_mode (); + + tty_start_interrupt_key (); + +-- +1.8.3.1 +
recipes-extended/mc/mc_4.7.5.2.bb +1 -0
@@ -10,6 +10,7 @@ PR = "r3" SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \ file://mc-CTRL.patch \ + file://0001-Ticket-3697-tty_init-unify-curses-initialization.patch \ " SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
Signature · 1 line
2.8.1