summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChristian Eggers <ceggers@arri.de>2022-02-14 11:18:14 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-16 09:46:29 +0000
commit94296651b64dadb50dd09ce420bbae98137c8e6e (patch)
tree98c8d4c5cd4eb681899fdd8eed7287618b0cc567 /meta
parente645f9ff550fbb49a04eac67e94298414f3135f6 (diff)
downloadpoky-94296651b64dadb50dd09ce420bbae98137c8e6e.tar.gz
mc: fix build if ncurses have been configured without wide characters
Some distros like poky-tiny set ENABLE_WIDEC=false, which disables wide character support for ncurses. The new patch fixes the build of mc for this case. Since 9000f8033662, NCURSES_WIDECHAR is set explicitly to 1 for musl. This doesn't work for ENABLE_WIDEC==false. In this case, NCURSES_WIDECHAR must be set explicitly to 0, as curses.h does not record whether the ncurses library has actually been built with or without wide characters. Fixes: 9000f8033662 ("mc: upgrade 4.8.25 -> 4.8.26") (From OE-Core rev: b176d86f5292c0e8cca2500be03ed392d59cedb3) Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/mc/files/0001-Ticket-4200-fix-FTBFS-with-ncurses-build-with-disabl.patch87
-rw-r--r--meta/recipes-extended/mc/mc_4.8.27.bb5
2 files changed, 91 insertions, 1 deletions
diff --git a/meta/recipes-extended/mc/files/0001-Ticket-4200-fix-FTBFS-with-ncurses-build-with-disabl.patch b/meta/recipes-extended/mc/files/0001-Ticket-4200-fix-FTBFS-with-ncurses-build-with-disabl.patch
new file mode 100644
index 0000000000..408473664f
--- /dev/null
+++ b/meta/recipes-extended/mc/files/0001-Ticket-4200-fix-FTBFS-with-ncurses-build-with-disabl.patch
@@ -0,0 +1,87 @@
1From e7bbf72544ab62db9c92bfe7bd1155227e78c621 Mon Sep 17 00:00:00 2001
2From: Andrew Borodin <aborodin@vmail.ru>
3Date: Sat, 28 Aug 2021 11:46:53 +0300
4Subject: [PATCH] Ticket #4200: fix FTBFS with ncurses build with
5 --disable-widec.
6
7Upstream-Status: Accepted [https://github.com/MidnightCommander/mc/commit/e7bbf72544]
8Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
9---
10 lib/tty/tty-ncurses.c | 8 ++++++++
11 lib/tty/tty-ncurses.h | 5 +++++
12 lib/tty/tty-slang.h | 2 ++
13 src/filemanager/boxes.c | 2 ++
14 4 files changed, 17 insertions(+)
15
16diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c
17index f619c0a7bf31..13058a624208 100644
18--- a/lib/tty/tty-ncurses.c
19+++ b/lib/tty/tty-ncurses.c
20@@ -560,6 +560,7 @@ tty_fill_region (int y, int x, int rows, int cols, unsigned char ch)
21 void
22 tty_colorize_area (int y, int x, int rows, int cols, int color)
23 {
24+#ifdef ENABLE_SHADOWS
25 cchar_t *ctext;
26 wchar_t wch[10]; /* TODO not sure if the length is correct */
27 attr_t attrs;
28@@ -585,6 +586,13 @@ tty_colorize_area (int y, int x, int rows, int cols, int color)
29 }
30
31 g_free (ctext);
32+#else
33+ (void) y;
34+ (void) x;
35+ (void) rows;
36+ (void) cols;
37+ (void) color;
38+#endif /* ENABLE_SHADOWS */
39 }
40
41 /* --------------------------------------------------------------------------------------------- */
42diff --git a/lib/tty/tty-ncurses.h b/lib/tty/tty-ncurses.h
43index d75df9533ab9..8feb17ccd045 100644
44--- a/lib/tty/tty-ncurses.h
45+++ b/lib/tty/tty-ncurses.h
46@@ -30,6 +30,11 @@
47 #define NCURSES_CONST const
48 #endif
49
50+/* do not draw shadows if NCurses is built with --disable-widec */
51+#if defined(NCURSES_WIDECHAR) && NCURSES_WIDECHAR
52+#define ENABLE_SHADOWS 1
53+#endif
54+
55 /*** typedefs(not structures) and defined constants **********************************************/
56
57 /*** enums ***************************************************************************************/
58diff --git a/lib/tty/tty-slang.h b/lib/tty/tty-slang.h
59index 5b12c6512853..eeaade388af4 100644
60--- a/lib/tty/tty-slang.h
61+++ b/lib/tty/tty-slang.h
62@@ -23,6 +23,8 @@
63 #define COLS SLtt_Screen_Cols
64 #define LINES SLtt_Screen_Rows
65
66+#define ENABLE_SHADOWS 1
67+
68 /*** enums ***************************************************************************************/
69
70 enum
71diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
72index 3eb525be4a9b..98df5ff2ed9a 100644
73--- a/src/filemanager/boxes.c
74+++ b/src/filemanager/boxes.c
75@@ -280,7 +280,9 @@ appearance_box_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm
76 switch (msg)
77 {
78 case MSG_INIT:
79+#ifdef ENABLE_SHADOWS
80 if (!tty_use_colors ())
81+#endif
82 {
83 Widget *shadow;
84
85--
862.34.1
87
diff --git a/meta/recipes-extended/mc/mc_4.8.27.bb b/meta/recipes-extended/mc/mc_4.8.27.bb
index 546e615d1d..e877780ea0 100644
--- a/meta/recipes-extended/mc/mc_4.8.27.bb
+++ b/meta/recipes-extended/mc/mc_4.8.27.bb
@@ -11,6 +11,7 @@ RRECOMMENDS:${PN} = "ncurses-terminfo"
11SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \ 11SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
12 file://0001-mc-replace-perl-w-with-use-warnings.patch \ 12 file://0001-mc-replace-perl-w-with-use-warnings.patch \
13 file://nomandate.patch \ 13 file://nomandate.patch \
14 file://0001-Ticket-4200-fix-FTBFS-with-ncurses-build-with-disabl.patch \
14 " 15 "
15SRC_URI[sha256sum] = "2f52dd9c75c20d8eac7701bd3a8c6c125aaf8cdd9cf12b78ca50a0102b543407" 16SRC_URI[sha256sum] = "2f52dd9c75c20d8eac7701bd3a8c6c125aaf8cdd9cf12b78ca50a0102b543407"
16 17
@@ -27,7 +28,9 @@ PACKAGECONFIG ??= ""
27PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba," 28PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba,"
28PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2," 29PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2,"
29 30
30CFLAGS:append:libc-musl = ' -DNCURSES_WIDECHAR=1 ' 31# enable NCURSES_WIDECHAR=1 only if ENABLE_WIDEC has not been explicitly disabled (e.g. by the distro config).
32# When compiling against the ncurses library, NCURSES_WIDECHAR needs to explicitly set to 0 in this case.
33CFLAGS:append:libc-musl = "${@' -DNCURSES_WIDECHAR=1' if bb.utils.to_boolean((d.getVar('ENABLE_WIDEC') or 'True')) else ' -DNCURSES_WIDECHAR=0'}"
31EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x --disable-configure-args" 34EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x --disable-configure-args"
32EXTRANATIVEPATH += "file-native" 35EXTRANATIVEPATH += "file-native"
33 36