diff options
author | 2019-09-09 07:53:40 +0200 | |
---|---|---|
committer | 2019-09-09 07:53:40 +0200 | |
commit | c531927e18b4ac22ec12b95aa2f8313e2f705b97 (patch) | |
tree | 1bd3a0afdbc53e0d2fdffff2f74f7389e4c83f4a /lib_pypy/_curses_build.py | |
parent | Test that shows that sys._current_frames() appears to work fine now (diff) | |
download | pypy-c531927e18b4ac22ec12b95aa2f8313e2f705b97.tar.gz pypy-c531927e18b4ac22ec12b95aa2f8313e2f705b97.tar.bz2 pypy-c531927e18b4ac22ec12b95aa2f8313e2f705b97.zip |
Some linux distributions place ncurses under /usr/include/ncurses and tcl/tk under /usr/lib64.
Added more paths to include and link ncurses and tcl-tk.
Diffstat (limited to 'lib_pypy/_curses_build.py')
-rw-r--r-- | lib_pypy/_curses_build.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py index bacf511670..c7f212e4c6 100644 --- a/lib_pypy/_curses_build.py +++ b/lib_pypy/_curses_build.py @@ -1,4 +1,15 @@ from cffi import FFI +import os + +# On some systems, the ncurses library is +# located at /usr/include/ncurses, so we must check this case. +# Let's iterate over well known paths +incdirs = [] +for _path in ['/usr/include/ncurses']: + if os.path.isfile(os.path.join(_path, 'panel.h')): + incdirs.append(_path) + break + ffi = FFI() @@ -10,6 +21,13 @@ ffi.set_source("_curses_cffi", """ #define NCURSES_OPAQUE 0 #endif + +/* ncurses 6 change behaviour and makes all pointers opaque, + lets define backward compatibility. It doesn't harm + previous versions */ + +#define NCURSES_INTERNALS 1 +#define NCURSES_REENTRANT 0 #include <ncurses.h> #include <panel.h> #include <term.h> @@ -41,7 +59,8 @@ int _m_ispad(WINDOW *win) { void _m_getsyx(int *yx) { getsyx(yx[0], yx[1]); } -""", libraries=['ncurses', 'panel']) +""", include_dirs=incdirs, + libraries=['ncurses', 'panel']) ffi.cdef(""" |