Mc 4.8.26 fails to compile on LibreELEC. - https://libreelec.tv/ - the
Tagline being Just enough OS for KODI
We use --disable-widec in the ncurses build,
https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/devel/ncurses/package.mk
Reverting the whole patch fixes the compile, but it would be ideal to use
alternatives or limit shadows if wchar is not available.
Results of the failed compile
./.libs/libinternal.a(tty-ncurses.o):tty-ncurses.c:function
tty_colorize_area: error: undefined reference to 'mvin_wchnstr'
./.libs/libinternal.a(tty-ncurses.o):tty-ncurses.c:function
tty_colorize_area: error: undefined reference to 'getcchar'
./.libs/libinternal.a(tty-ncurses.o):tty-ncurses.c:function
tty_colorize_area: error: undefined reference to 'setcchar'
./.libs/libinternal.a(tty-ncurses.o):tty-ncurses.c:function
tty_colorize_area: error: undefined reference to 'mvadd_wchnstr'
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200>
Midnight Commander <https://midnight-commander.org>
Midnight Development Center
Comment (by mrbump):
The code that has the wchar is
+++ b/lib/tty/tty-ncurses.c
@@ -533,6 +550,38
/*
---------------------------------------------------------------------------------------------
*/
+void
+tty_colorize_area (int y, int x, int rows, int cols, int color)
+{
+ cchar_t *ctext;
+ wchar_t wch[10]; /* TODO not sure if the length is correct */
+ attr_t attrs;
+ short color_pair;
+
+ if (!use_colors || !tty_clip (&y, &x, &rows, &cols))
+ return;
+
+ tty_setcolor (color);
+ ctext = g_malloc (sizeof (cchar_t) * (cols + 1));
+
+ for (int row = 0; row < rows; row++)
+ {
+ mvin_wchnstr (y + row, x, ctext, cols);
+
+ for (int col = 0; col < cols; col++)
+ {
+ getcchar (&ctext[col], wch, &attrs, &color_pair, NULL);
+ setcchar (&ctext[col], wch, attrs, color, NULL);
+ }
+
+ mvadd_wchnstr (y + row, x, ctext, cols);
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:1>
Comment (by mrbump):
Original change that created the issue #4102
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:2>
* status: new => closed
* resolution: => invalid
* component: mc-core => mc-tty
* milestone: Future Releases =>
Comment:
Fixed as #4181.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:3>
Comment (by mrbump):
Whilst that patch fixed MacOS it doesn’t fix LibreELEC as wide char is not
included. I had tested that patch as I had compiled against master
https://github.com/MidnightCommander/mc/commits/master . If you could
suggest a direction of what would be acceptable to the mc team, I would be
happy to develop a code fix. As in tty-slang I see that tty_colorize_area
is essentially a noop.
Should I write a —without-wchar configure option?
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:4>
Comment (by zaytsev):
How is it possible that LibreELEC doesn't have a definition of `wchar_t`?
Kodi itself seems to use it all over the place... How do you solve this
problem?
To me it seems that of course you do have `wchar_t`, only for some reason
we cannot understand yet you compile ncurses with `--disable-widec`, so
even though mc does compile against ncurses, according to your log the
linking fails, because `mvadd_wchnstr` function cannot be found. Just
compile ncurses `--enable-widec` to solve this problem if you can. I would
be surprised if mc interface will be rendered correctly if you compile
against ncurses with `--disable-widec` anyways.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:5>
Comment (by andrew_b):
Please test the attached patch.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:6>
Comment (by andrew_b):
ping
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:7>
Comment (by andrew_b):
@mrbump, please let me know if this patch works or not.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:8>
Comment (by mrbump):
Hi @andrew_b
we just pulled the patch into 4.8.27. And removed the previous revert
patch. All works as expected.
https://github.com/LibreELEC/LibreELEC.tv/pull/5562
Regards
Rudi
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:9>
* status: closed => reopened
* resolution: invalid =>
* branch_state: no branch => on review
* milestone: => 4.8.28
Comment:
Branch: 4200_ncurses_disable_widec
changeset:e7bbf72544ab62db9c92bfe7bd1155227e78c621
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:10>
* status: reopened => closed
* votes: mrbump andrew_b => committed-master
* resolution: => fixed
* branch_state: approved => merged
Comment:
Merged to master: [375f2a764dc0d276e98cdcf0e9f890f41250c041].
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:12>
* votes: => mrbump andrew_b
* branch_state: on review => approved
--
Ticket URL: <http://www.midnight-commander.org/ticket/4200#comment:11>