fix mc compile failure while ncurses upgraded
v2 cover fix mc compile failure while ncurses upgraded
Changed in V2:
We could not backport fix from the latest master which introduce gplv3 contamination, but we could revert to disable Ctrl-g key and Ctrl-\ key
//Hongxu
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: disable Ctrl-g key and Ctrl-\ key
conf/layer.conf | 2 - .../mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch | 86 ++++++++++++++++++++++ recipes-extended/mc/mc/mc-CTRL.patch | 31 ++++++++ recipes-extended/mc/mc_4.7.5.2.bb | 48 ++++++++++++ 4 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.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 v2 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 v2 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 v2 3/3 mc: disable Ctrl-g key and Ctrl-\ key
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 */
...
We could not backport fix from the latest master which introduce gplv3 contamination, but we could revert to disable Ctrl-g key and Ctrl-\ key
--- .../mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch | 86 ++++++++++++++++++++++ recipes-extended/mc/mc_4.7.5.2.bb | 1 + 2 files changed, 87 insertions(+) create mode 100644 recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch
recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch new file +86 -0
@@ -0,0 +1,86 @@ +From 91a1068015a09232bacac9b86fc13b318860f44e Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <[email protected]> +Date: Fri, 18 Aug 2017 17:05:42 +0800 +Subject: [PATCH] disable Ctrl-g key and Ctrl-\ key + +Since 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 */ +... + +We could not backport fix from the latest master which introduce +gplv3 contamination, but we could revert the following commits. +... +commit a20ebb38184e177f2ead8466f3ef1f131352aba7 +Author: Andrew Borodin <[email protected]> +Date: Wed Dec 23 16:18:25 2009 +0000 + + Ticket #1876: use Ctrl-g key to generate SIGINT signal. + +commit 56bf77ae57ba493126a2d1a1e0dd56eb947ccca1 +Author: Andrew Borodin <[email protected]> +Date: Sat Feb 6 13:07:35 2010 +0300 + + Ticket #1926: Ctrl-\ key behaviour in NCurses-based MC. +... + +Upstream-Status: Inappropriate [gplv2 specific] +https://github.com/MidnightCommander/mc.git + +Signed-off-by: Hongxu Jia <[email protected]> +--- + lib/tty/tty-ncurses.c | 6 ------ + lib/tty/tty-slang.c | 4 ++-- + src/keybind-defaults.c | 1 - + 3 files changed, 2 insertions(+), 9 deletions(-) + +diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c +index ab61891..6c614ac 100644 +--- a/lib/tty/tty-ncurses.c ++++ b/lib/tty/tty-ncurses.c +@@ -159,12 +159,6 @@ tty_init (gboolean slow, gboolean ugly_lines) + ESCDELAY = 200; + #endif /* HAVE_ESCDELAY */ + +- /* use Ctrl-g to generate SIGINT */ +- cur_term->Nttyb.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); +- + tty_start_interrupt_key (); + + do_enter_ca_mode (); +diff --git a/lib/tty/tty-slang.c b/lib/tty/tty-slang.c +index f42fd4a..0e92c52 100644 +--- a/lib/tty/tty-slang.c ++++ b/lib/tty/tty-slang.c +@@ -268,8 +268,8 @@ tty_init (gboolean slow, gboolean ugly_lines) + + tcgetattr (fileno (stdin), &boot_mode); + /* 255 = ignore abort char; XCTRL('g') for abort char = ^g */ +- SLang_init_tty (XCTRL ('g'), 1, 0); +- ++ /* SLang_init_tty (XCTRL ('c'), 1, 0); */ ++ SLang_init_tty (255, 1, 0); + if (ugly_lines) + SLtt_Has_Alt_Charset = 0; + +diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c +index 28e3613..075e6b6 100644 +--- a/src/keybind-defaults.c ++++ b/src/keybind-defaults.c +@@ -368,7 +368,6 @@ const global_keymap_t default_dialog_keymap[] = { + {'\n', CK_DialogOK, "Enter"}, + {KEY_ENTER, CK_DialogOK, "Enter"}, + {ESC_CHAR, CK_DialogCancel, "Esc"}, +- {XCTRL ('g'), CK_DialogCancel, "C-g"}, + {KEY_F (10), CK_DialogCancel, "F10"}, + {KEY_LEFT, CK_DialogPrevItem, "Left"}, + {KEY_UP, CK_DialogPrevItem, "Up"}, +-- +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-disable-Ctrl-g-key-and-Ctrl-key.patch \ " SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
Signature · 1 line
2.8.1
Re: [PATCH 3/3] mc: disable Ctrl-g key and Ctrl-\ key
I'm fine with this. But as a non-mc user. I'm not entirely sure what the missing ctl-g and ctrl-\ will affect. But since this is only for the 'gplv2' version which isn't as used as the main version, that should be fine.
Quoted 124 lines · Hongxu Jia
Since 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 */
...We could not backport fix from the latest master which introduce gplv3 contamination, but we could revert to disable Ctrl-g key and Ctrl-\ key
Signed-off-by Hongxu Jia <[email protected]>--- .../mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch | 86 ++++++++++++++++++++++ recipes-extended/mc/mc_4.7.5.2.bb | 1 + 2 files changed, 87 insertions(+) create mode 100644 recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patchrecipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch new file +86
-0@@ -0,0 +1,86 @@ +From 91a1068015a09232bacac9b86fc13b318860f44e Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <[email protected]> +Date: Fri, 18 Aug 2017 17:05:42 +0800 +Subject: [PATCH] disable Ctrl-g key and Ctrl-\ key + +Since 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 */ +... + +We could not backport fix from the latest master which introduce +gplv3 contamination, but we could revert the following commits. +... +commit a20ebb38184e177f2ead8466f3ef1f131352aba7 +Author: Andrew Borodin <[email protected]> +Date: Wed Dec 23 16:18:25 2009 +0000 + + Ticket #1876: use Ctrl-g key to generate SIGINT signal. + +commit 56bf77ae57ba493126a2d1a1e0dd56eb947ccca1 +Author: Andrew Borodin <[email protected]> +Date: Sat Feb 6 13:07:35 2010 +0300 + + Ticket #1926: Ctrl-\ key behaviour in NCurses-based MC. +... + +Upstream-Status: Inappropriate [gplv2 specific] +https://github.com/MidnightCommander/mc.git + +Signed-off-by: Hongxu Jia <[email protected]> +--- + lib/tty/tty-ncurses.c | 6 ------ + lib/tty/tty-slang.c | 4 ++-- + src/keybind-defaults.c | 1 - + 3 files changed, 2 insertions(+), 9 deletions(-) + +diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c +index ab61891..6c614ac 100644 +--- a/lib/tty/tty-ncurses.c ++++ b/lib/tty/tty-ncurses.c +@@ -159,12 +159,6 @@ tty_init (gboolean slow, gboolean ugly_lines) + ESCDELAY = 200; + #endif /* HAVE_ESCDELAY */ + +- /* use Ctrl-g to generate SIGINT */ +- cur_term->Nttyb.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); +- + tty_start_interrupt_key (); + + do_enter_ca_mode (); +diff --git a/lib/tty/tty-slang.c b/lib/tty/tty-slang.c +index f42fd4a..0e92c52 100644 +--- a/lib/tty/tty-slang.c ++++ b/lib/tty/tty-slang.c +@@ -268,8 +268,8 @@ tty_init (gboolean slow, gboolean ugly_lines) + + tcgetattr (fileno (stdin), &boot_mode); + /* 255 = ignore abort char; XCTRL('g') for abort char = ^g */ +- SLang_init_tty (XCTRL ('g'), 1, 0); +- ++ /* SLang_init_tty (XCTRL ('c'), 1, 0); */ ++ SLang_init_tty (255, 1, 0); + if (ugly_lines) + SLtt_Has_Alt_Charset = 0; + +diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c +index 28e3613..075e6b6 100644 +--- a/src/keybind-defaults.c ++++ b/src/keybind-defaults.c +@@ -368,7 +368,6 @@ const global_keymap_t default_dialog_keymap[] = { + {'\n', CK_DialogOK, "Enter"}, + {KEY_ENTER, CK_DialogOK, "Enter"}, + {ESC_CHAR, CK_DialogCancel, "Esc"}, +- {XCTRL ('g'), CK_DialogCancel, "C-g"}, + {KEY_F (10), CK_DialogCancel, "F10"}, + {KEY_LEFT, CK_DialogPrevItem, "Left"}, + {KEY_UP, CK_DialogPrevItem, "Up"}, +-- +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-disable-Ctrl-g-key-and-Ctrl-key.patch \ " SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
Re: [PATCH 3/3] mc: disable Ctrl-g key and Ctrl-\ key
In reply to Hongxu JiaQuoted 4 lines · Hongxu Jia
We could not backport fix from the latest master which introduce gplv3 contamination, but we could revert to disable Ctrl-g key and Ctrl-\ key
Considering how small the upstream fix is, reimplementing it using just the knowledge of what the ncurses API change was should be fairly trivial.
Ross
Add Mark to the loop
//Hongxu
Quoted 33 lines · Hongxu Jia
Changed in V2:
We could not backport fix from the latest master which introduce gplv3 contamination, but we could revert to disable Ctrl-g key and Ctrl-\ key
//Hongxu
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-contribhongxu/fix-gplv2-mc
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=hongxu/fix-gplv2-mcHongxu 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: disable Ctrl-g key and Ctrl-\ keyconf/layer.conf | 2 - .../mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patch | 86 ++++++++++++++++++++++ recipes-extended/mc/mc/mc-CTRL.patch | 31 ++++++++ recipes-extended/mc/mc_4.7.5.2.bb | 48 ++++++++++++ 4 files changed, 165 insertions(+), 2 deletions(-)create mode 100644
recipes-extended/mc/mc/0001-disable-Ctrl-g-key-and-Ctrl-key.patchcreate mode 100644recipes-extended/mc/mc/mc-CTRL.patch
create mode 100644 recipes-extended/mc/mc_4.7.5.2.bb