New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix curses module compilation with ncurses6 #69906
Comments
ncurses6 turned on NCURSES_OPAQUE, so now you have to use some helper functions instead of accessing the structs directly. This _should_ be compatible with ncurses5 though I didn't test it. Original patch is from openSUSE. |
Any patch review/comment ? |
configure.ac directly uses w->_flags in a check. It looks that this check always fails with ncurses6. |
Thats not an issue for ncurses because Include/py_curses.h does: #ifdef HAVE_NCURSES_H
/* configure was checking <curses.h>, but we will
use <ncurses.h>, which has all these features. */
#ifndef WINDOW_HAS_FLAGS
#define WINDOW_HAS_FLAGS 1
#endif
#ifndef MVWDELCH_IS_EXPRESSION
#define MVWDELCH_IS_EXPRESSION 1
#endif
#endif So it overrides WINDOW_HAS_FLAGS for ncurses case. |
ping? |
I suspect that the patch can break build with non-ncurses implementations or with old ncurses (when is_pad() was added?). Needed more direct feature check. |
is_pad is added in ncurses 5.7-20090906 [1]. At least Mac OS X still ships ancient ncurses 5.7-20081102 [2], so an check in configure.ac is necessary. I'm trying it out. [1] http://invisible-island.net/ncurses/NEWS.html#t20090906 |
Mark, do you have relation to this? |
I tried to build curses module on Cygwin (Vista x86) using bpo-25720 patch. And it has been succeeded. I found out build success reasons for cases of applying patch: All case tests on Cygwin have failed at unget_wch. |
Sorry, no. Whatever ncurses knowledge I may once have had has long since vanished. |
I updated the patch that add configuration check for is_pad. the is_pad is wrapped into py_is_pad at Modules/_cursesmodule.c:932 by either of three ways. Case one -- is_pad is found: Define the macro that is simple wrapping. I succeeded to build curses module on Cygwin (Vista x86) using this patch. |
@masamoto thank you! |
Added a comment on Rietveld. |
Thanks masamoto! There's another minor issue about this patch: if there's no curses.h (ncurses built with --without-curses-h), the detection always fails. |
Added comment in review. Yen, I tried to build without curses.h file (overwrite to ncurses.h). It was failed on checking header. Hence, I confirmed curses headers on Cygwin and Ubuntu. I found out that curses.h includes the directive "#include <unctrl.h>". And unctrl.h has "#include <curses.h>". Therefore, I think that some platforms require curses.h. |
headers.sh in ncurses changes "#include <curses.h>" to the actual path. For example here's a line in my unctrl.h: #include <ncursesw/ncurses.h> |
Thanks, building is fine here. By the way, testing is broken due to other bugs (/tmp not available on Android). It's unrelated and I'll open a new issue for that. |
What's the status on this? Can you please create a pull request on Github so we can continue there? |
Hi, I finished various things and tackle the issue again, I opened PR 1689 at last. Changes from previous patch:
|
Ping. I updated PR a bit: macOS is joined to new compile condition and remove platform-specific condition. |
I opened PR 4164 to improve the is_pad configure check and previous PR was closed. |
I'll try to test this on NetBSD after fixing curses on NetBSD. It uses a different implementation of curses which don't support is_pad. |
Thank you for your contribution Masayuki! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: