summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pypy3-bin/files/2.4.0-ncurses6.patch')
-rw-r--r--dev-python/pypy3-bin/files/2.4.0-ncurses6.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/dev-python/pypy3-bin/files/2.4.0-ncurses6.patch b/dev-python/pypy3-bin/files/2.4.0-ncurses6.patch
new file mode 100644
index 000000000000..63a450ff423a
--- /dev/null
+++ b/dev-python/pypy3-bin/files/2.4.0-ncurses6.patch
@@ -0,0 +1,34 @@
+Patch by Vadim A. Misbakh-Soloviov (mva)
+https://bugs.gentoo.org/show_bug.cgi?id=564454
+
+--- lib_pypy/_curses.py.old 2016-01-18 19:13:00.241886442 +0000
++++ lib_pypy/_curses.py 2016-01-18 19:26:01.061885605 +0000
+@@ -1,6 +1,7 @@
+ """Reimplementation of the standard extension module '_curses' using cffi."""
+
+ import sys
++import platform
+ if sys.platform == 'win32':
+ #This module does not exist in windows
+ raise ImportError('No module named _curses')
+@@ -10,12 +11,18 @@
+
+ ffi = FFI()
+
++# Monkeypatch to make it build against ncurses-6.
++# Inspired by https://goo.gl/xvjQcd
++_type = "uint32_t"
++if platform.machine() == "x86_64":
++ _type = "unsigned"
++
+ ffi.cdef("""
+ typedef ... WINDOW;
+ typedef ... SCREEN;
+-typedef unsigned long mmask_t;
++typedef """+_type+""" mmask_t;
+ typedef unsigned char bool;
+-typedef unsigned long chtype;
++typedef """+_type+""" chtype;
+ typedef chtype attr_t;
+
+ typedef struct