[pypy-commit] pypy compile_ncurses_tcl_tk_suse_latest: Some linux distributions place ncurses under /usr/include/ncurses and tcl/tk under /usr/lib64.
jose...@gmail.com
pypy.commits at gmail.com
Tue Sep 10 01:59:33 EDT 2019
Author: joserubiovidales at gmail.com
Branch: compile_ncurses_tcl_tk_suse_latest
Changeset: r97409:4e47fdc746fb
Date: 2019-09-09 07:53 +0200
http://bitbucket.org/pypy/pypy/changeset/4e47fdc746fb/
Log: 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.
diff --git a/lib_pypy/_curses_build.py b/lib_pypy/_curses_build.py
--- 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 @@
#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 @@
void _m_getsyx(int *yx) {
getsyx(yx[0], yx[1]);
}
-""", libraries=['ncurses', 'panel'])
+""", include_dirs=incdirs,
+ libraries=['ncurses', 'panel'])
ffi.cdef("""
diff --git a/lib_pypy/_tkinter/tklib_build.py b/lib_pypy/_tkinter/tklib_build.py
--- a/lib_pypy/_tkinter/tklib_build.py
+++ b/lib_pypy/_tkinter/tklib_build.py
@@ -36,8 +36,11 @@
for _ver in ['8.6', '8.5', '']:
incdirs = []
linklibs = ['tcl' + _ver, 'tk' + _ver]
- if os.path.isfile(''.join(['/usr/lib/lib', linklibs[1], '.so'])):
- found = True
+ for lib in ['/usr/lib/lib', '/usr/lib64/lib' ]:
+ if os.path.isfile(''.join([ lib, linklibs[1], '.so'])):
+ found = True
+ break
+ if found:
break
if not found:
sys.stderr.write("*** TCL libraries not found! Falling back...\n")
More information about the pypy-commit
mailing list