summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorroy <roy@pkgsrc.org>2017-01-02 20:52:46 +0000
committerroy <roy@pkgsrc.org>2017-01-02 20:52:46 +0000
commitd9dcf4787280e0db40f39a3e4878be3ab30f05e7 (patch)
tree8543e7a0f4b2b953a7d0f5e36c44634d23096cd3 /lang
parent4ae7831e056ce65e24ef4409fcc4604fe8c8d078 (diff)
downloadpkgsrc-d9dcf4787280e0db40f39a3e4878be3ab30f05e7.tar.gz
se ncurses is_keypad function rather than directly looking at the
WINDOW structure. Include <term.h> when needed and rename lines and columns vars to avoid conflicts. Builds and works with NetBSD-8 curses, so use mk/curses.buildlink3.mk and test for getsyx(3) in curses rather than indescriminately linking to ncurses.
Diffstat (limited to 'lang')
-rw-r--r--lang/python27/distinfo4
-rw-r--r--lang/python27/patches/patch-ah113
-rw-r--r--lang/python34/distinfo4
-rw-r--r--lang/python34/patches/patch-ah136
-rw-r--r--lang/python35/distinfo4
-rw-r--r--lang/python35/patches/patch-Modules___cursesmodule.c135
6 files changed, 359 insertions, 37 deletions
diff --git a/lang/python27/distinfo b/lang/python27/distinfo
index b7c29a4a425..20ef45a17ba 100644
--- a/lang/python27/distinfo
+++ b/lang/python27/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.59 2016/12/30 10:53:21 adam Exp $
+$NetBSD: distinfo,v 1.60 2017/01/02 20:52:46 roy Exp $
SHA1 (Python-2.7.13.tar.xz) = 18a8f30a0356c751b8d0ea6f76e764cab13ee046
RMD160 (Python-2.7.13.tar.xz) = be09518cdc335314de1c5ebe181690082ce780d7
@@ -18,7 +18,7 @@ SHA1 (patch-aa) = d9626c1648d7ff2a7da7352665bcb05f4ab0412a
SHA1 (patch-ab) = ea4feba4e93dbcff07050c82a00d591bb650e934
SHA1 (patch-ad) = 96ae702995d434e2d7ec0ac62e37427a90b61d13
SHA1 (patch-ae) = d836d77854a2b3d79fa34a06a8e2493bf0a503e6
-SHA1 (patch-ah) = 90b19239d8a7c8abc3bbc05d49408a2c5da6174d
+SHA1 (patch-ah) = f6e7ad94501bfee30dc7bb8336dbb4284e5ee84e
SHA1 (patch-al) = 541936b79f281db06761f4fa6a65a04e852b02b4
SHA1 (patch-am) = cf82bd1996aea8a8536bd37a74563bb85817c968
SHA1 (patch-an) = 9aad78714c4fe1a21cf66a6627d97d164ecea196
diff --git a/lang/python27/patches/patch-ah b/lang/python27/patches/patch-ah
index e0136241c8a..a38f9d74c56 100644
--- a/lang/python27/patches/patch-ah
+++ b/lang/python27/patches/patch-ah
@@ -1,8 +1,24 @@
-$NetBSD: patch-ah,v 1.4 2015/04/24 03:01:36 rodent Exp $
+$NetBSD: patch-ah,v 1.5 2017/01/02 20:52:46 roy Exp $
---- Modules/_cursesmodule.c.orig 2014-12-10 15:59:53.000000000 +0000
+Allow py-curses to use NetBSD curses as well as ncurses
+http://bugs.python.org/issue21457
+
+--- Modules/_cursesmodule.c.orig 2016-06-25 21:49:31.000000000 +0000
+++ Modules/_cursesmodule.c
-@@ -322,17 +322,9 @@ Window_NoArg2TupleReturnFunction(getpary
+@@ -117,9 +117,10 @@ char *PyCursesVersion = "2.2";
+ #defines many common symbols (such as "lines") which breaks the
+ curses module in other ways. So the code will just specify
+ explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
+-#ifdef __sgi
++#if defined(__NetBSD__) || defined(__sgi)
+ #include <term.h>
++#else
++extern int setupterm(char *, int, int *);
+ #endif
+
+ #if !defined(HAVE_NCURSES_H) && (defined(sgi) || defined(__sun) || defined(SCO5))
+@@ -322,17 +323,9 @@ Window_NoArg2TupleReturnFunction(getpary
Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)")
@@ -20,7 +36,43 @@ $NetBSD: patch-ah,v 1.4 2015/04/24 03:01:36 rodent Exp $
Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines")
-@@ -2110,7 +2102,6 @@ PyCurses_Is_Term_Resized(PyObject *self,
+@@ -807,7 +800,7 @@ PyCursesWindow_EchoChar(PyCursesWindowOb
+ }
+
+ #ifdef WINDOW_HAS_FLAGS
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ return PyCursesCheckERR(pechochar(self->win, ch | attr),
+ "echochar");
+ else
+@@ -1237,7 +1230,7 @@ PyCursesWindow_NoOutRefresh(PyCursesWind
+ #ifndef WINDOW_HAS_FLAGS
+ if (0)
+ #else
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ #endif
+ {
+ switch(PyTuple_Size(args)) {
+@@ -1380,7 +1373,7 @@ PyCursesWindow_Refresh(PyCursesWindowObj
+ #ifndef WINDOW_HAS_FLAGS
+ if (0)
+ #else
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ #endif
+ {
+ switch(PyTuple_Size(args)) {
+@@ -1447,7 +1440,7 @@ PyCursesWindow_SubWin(PyCursesWindowObje
+
+ /* printf("Subwin: %i %i %i %i \n", nlines, ncols, begin_y, begin_x); */
+ #ifdef WINDOW_HAS_FLAGS
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ win = subpad(self->win, nlines, ncols, begin_y, begin_x);
+ else
+ #endif
+@@ -2110,7 +2103,6 @@ PyCurses_Is_Term_Resized(PyObject *self,
}
#endif /* HAVE_CURSES_IS_TERM_RESIZED */
@@ -28,7 +80,7 @@ $NetBSD: patch-ah,v 1.4 2015/04/24 03:01:36 rodent Exp $
static PyObject *
PyCurses_KeyName(PyObject *self, PyObject *args)
{
-@@ -2129,7 +2120,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
+@@ -2129,7 +2121,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
return PyString_FromString((knp == NULL) ? "" : (char *)knp);
}
@@ -36,7 +88,50 @@ $NetBSD: patch-ah,v 1.4 2015/04/24 03:01:36 rodent Exp $
static PyObject *
PyCurses_KillChar(PyObject *self)
-@@ -2674,9 +2664,7 @@ static PyMethodDef PyCurses_methods[] =
+@@ -2383,16 +2374,16 @@ update_lines_cols(void)
+ static PyObject *
+ PyCurses_ResizeTerm(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+ PyObject *result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:resizeterm", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:resizeterm", &nlines, &ncolumns))
+ return NULL;
+
+- result = PyCursesCheckERR(resizeterm(lines, columns), "resizeterm");
++ result = PyCursesCheckERR(resizeterm(nlines, ncolumns), "resizeterm");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+@@ -2406,17 +2397,17 @@ PyCurses_ResizeTerm(PyObject *self, PyOb
+ static PyObject *
+ PyCurses_Resize_Term(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+
+ PyObject *result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:resize_term", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:resize_term", &nline, &ncolumns))
+ return NULL;
+
+- result = PyCursesCheckERR(resize_term(lines, columns), "resize_term");
++ result = PyCursesCheckERR(resize_term(nlines, ncolumns), "resize_term");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+@@ -2674,9 +2665,7 @@ static PyMethodDef PyCurses_methods[] =
#ifdef HAVE_CURSES_IS_TERM_RESIZED
{"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS},
#endif
@@ -46,7 +141,7 @@ $NetBSD: patch-ah,v 1.4 2015/04/24 03:01:36 rodent Exp $
{"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS},
{"longname", (PyCFunction)PyCurses_longname, METH_NOARGS},
{"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS},
-@@ -2785,9 +2773,7 @@ init_curses(void)
+@@ -2785,9 +2774,7 @@ init_curses(void)
SetDictInt("A_DIM", A_DIM);
SetDictInt("A_BOLD", A_BOLD);
SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
@@ -56,7 +151,7 @@ $NetBSD: patch-ah,v 1.4 2015/04/24 03:01:36 rodent Exp $
SetDictInt("A_PROTECT", A_PROTECT);
SetDictInt("A_CHARTEXT", A_CHARTEXT);
SetDictInt("A_COLOR", A_COLOR);
-@@ -2859,7 +2845,6 @@ init_curses(void)
+@@ -2859,7 +2846,6 @@ init_curses(void)
int key;
char *key_n;
char *key_n2;
@@ -64,7 +159,7 @@ $NetBSD: patch-ah,v 1.4 2015/04/24 03:01:36 rodent Exp $
for (key=KEY_MIN;key < KEY_MAX; key++) {
key_n = (char *)keyname(key);
if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
-@@ -2887,7 +2872,6 @@ init_curses(void)
+@@ -2887,7 +2873,6 @@ init_curses(void)
if (key_n2 != key_n)
free(key_n2);
}
diff --git a/lang/python34/distinfo b/lang/python34/distinfo
index 82a2ccc8f12..3558eec11cf 100644
--- a/lang/python34/distinfo
+++ b/lang/python34/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.21 2016/07/02 15:23:33 adam Exp $
+$NetBSD: distinfo,v 1.22 2017/01/02 20:52:46 roy Exp $
SHA1 (Python-3.4.5.tar.xz) = 882e83e0286b253ee651aa3f9a5d27ebc46e6632
RMD160 (Python-3.4.5.tar.xz) = 47604be01f37671a16c17e27316af327a1048fd6
@@ -6,7 +6,7 @@ SHA512 (Python-3.4.5.tar.xz) = b548a5338d141b3086dea372fa2cc245ba5350ee9f0d1304e
Size (Python-3.4.5.tar.xz) = 14516820 bytes
SHA1 (patch-Lib_distutils_unixccompiler.py) = 7d6df07921ad3357757d4681a964256b560b3f57
SHA1 (patch-aa) = 14359f8d0527eff08073c0aea60dfe8961d9255d
-SHA1 (patch-ah) = 1c4eec742ab26f77c6326b7d12e44e26be493c0f
+SHA1 (patch-ah) = f5e6ee512df69b6f0718c8d303e5b8ede39357ed
SHA1 (patch-al) = 7239d10b67c739c3ee33dd2fc95bb770360d152f
SHA1 (patch-am) = 1752a06fec7626af57e85b6cbd9b6cc38b99272f
SHA1 (patch-an) = c9b571eb54fdf0b1e93524a6de6780e8c4119221
diff --git a/lang/python34/patches/patch-ah b/lang/python34/patches/patch-ah
index 0a6a16ca234..75eab13fbc5 100644
--- a/lang/python34/patches/patch-ah
+++ b/lang/python34/patches/patch-ah
@@ -1,11 +1,26 @@
-$NetBSD: patch-ah,v 1.3 2014/10/09 09:15:38 adam Exp $
+$NetBSD: patch-ah,v 1.4 2017/01/02 20:52:46 roy Exp $
-Ncurses will be used by devel/py-curses and devel/py-cursespanel.
+Allow py-curses to use NetBSD curses as well as ncurses
http://bugs.python.org/issue21457
---- Modules/_cursesmodule.c.orig 2014-05-04 20:59:51.000000000 +0000
+--- Modules/_cursesmodule.c.orig 2016-06-25 21:52:32.000000000 +0000
+++ Modules/_cursesmodule.c
-@@ -484,17 +484,9 @@ Window_NoArg2TupleReturnFunction(getpary
+@@ -112,14 +112,7 @@ char *PyCursesVersion = "2.2";
+ #define CURSES_MODULE
+ #include "py_curses.h"
+
+-/* These prototypes are in <term.h>, but including this header
+- #defines many common symbols (such as "lines") which breaks the
+- curses module in other ways. So the code will just specify
+- explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
+-#ifdef __sgi
+ #include <term.h>
+-#endif
+
+ #ifdef HAVE_LANGINFO_H
+ #include <langinfo.h>
+@@ -484,17 +477,9 @@ Window_NoArg2TupleReturnFunction(getpary
Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)")
@@ -23,7 +38,16 @@ http://bugs.python.org/issue21457
Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines")
-@@ -1219,11 +1211,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje
+@@ -1133,7 +1118,7 @@ PyCursesWindow_EchoChar(PyCursesWindowOb
+ return NULL;
+
+ #ifdef WINDOW_HAS_FLAGS
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ return PyCursesCheckERR(pechochar(self->win, ch | attr),
+ "echochar");
+ else
+@@ -1219,11 +1204,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje
return Py_BuildValue("C", rtn);
} else {
const char *knp;
@@ -35,7 +59,54 @@ http://bugs.python.org/issue21457
return PyUnicode_FromString((knp == NULL) ? "" : knp);
}
}
-@@ -2658,7 +2646,6 @@ PyCurses_Is_Term_Resized(PyObject *self,
+@@ -1656,7 +1637,7 @@ PyCursesWindow_NoOutRefresh(PyCursesWind
+ #ifndef WINDOW_HAS_FLAGS
+ if (0)
+ #else
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ #endif
+ {
+ switch(PyTuple_Size(args)) {
+@@ -1831,7 +1812,7 @@ PyCursesWindow_Refresh(PyCursesWindowObj
+ #ifndef WINDOW_HAS_FLAGS
+ if (0)
+ #else
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ #endif
+ {
+ switch(PyTuple_Size(args)) {
+@@ -1898,7 +1879,7 @@ PyCursesWindow_SubWin(PyCursesWindowObje
+
+ /* printf("Subwin: %i %i %i %i \n", nlines, ncols, begin_y, begin_x); */
+ #ifdef WINDOW_HAS_FLAGS
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ win = subpad(self->win, nlines, ncols, begin_y, begin_x);
+ else
+ #endif
+@@ -2639,15 +2620,15 @@ PyCurses_IntrFlush(PyObject *self, PyObj
+ static PyObject *
+ PyCurses_Is_Term_Resized(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+ int result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:is_term_resized", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:is_term_resized", &nlines, &ncolumns))
+ return NULL;
+- result = is_term_resized(lines, columns);
++ result = is_term_resized(nlines, ncolumns);
+ if (result == TRUE) {
+ Py_INCREF(Py_True);
+ return Py_True;
+@@ -2658,7 +2639,6 @@ PyCurses_Is_Term_Resized(PyObject *self,
}
#endif /* HAVE_CURSES_IS_TERM_RESIZED */
@@ -43,7 +114,7 @@ http://bugs.python.org/issue21457
static PyObject *
PyCurses_KeyName(PyObject *self, PyObject *args)
{
-@@ -2677,7 +2664,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
+@@ -2677,7 +2657,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
return PyBytes_FromString((knp == NULL) ? "" : (char *)knp);
}
@@ -51,7 +122,50 @@ http://bugs.python.org/issue21457
static PyObject *
PyCurses_KillChar(PyObject *self)
-@@ -3284,9 +3270,7 @@ static PyMethodDef PyCurses_methods[] =
+@@ -2935,16 +2914,16 @@ update_lines_cols(void)
+ static PyObject *
+ PyCurses_ResizeTerm(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+ PyObject *result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:resizeterm", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:resizeterm", &nlines, &ncolumns))
+ return NULL;
+
+- result = PyCursesCheckERR(resizeterm(lines, columns), "resizeterm");
++ result = PyCursesCheckERR(resizeterm(nlines, ncolumns), "resizeterm");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+@@ -2958,17 +2937,17 @@ PyCurses_ResizeTerm(PyObject *self, PyOb
+ static PyObject *
+ PyCurses_Resize_Term(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+
+ PyObject *result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:resize_term", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:resize_term", &nlines, &ncolumns))
+ return NULL;
+
+- result = PyCursesCheckERR(resize_term(lines, columns), "resize_term");
++ result = PyCursesCheckERR(resize_term(nlines, ncolumns), "resize_term");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+@@ -3284,9 +3263,7 @@ static PyMethodDef PyCurses_methods[] =
#ifdef HAVE_CURSES_IS_TERM_RESIZED
{"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS},
#endif
@@ -61,7 +175,7 @@ http://bugs.python.org/issue21457
{"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS},
{"longname", (PyCFunction)PyCurses_longname, METH_NOARGS},
{"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS},
-@@ -3412,9 +3396,7 @@ PyInit__curses(void)
+@@ -3412,9 +3389,7 @@ PyInit__curses(void)
SetDictInt("A_DIM", A_DIM);
SetDictInt("A_BOLD", A_BOLD);
SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
@@ -71,7 +185,7 @@ http://bugs.python.org/issue21457
SetDictInt("A_PROTECT", A_PROTECT);
SetDictInt("A_CHARTEXT", A_CHARTEXT);
SetDictInt("A_COLOR", A_COLOR);
-@@ -3486,7 +3468,6 @@ PyInit__curses(void)
+@@ -3486,7 +3461,6 @@ PyInit__curses(void)
int key;
char *key_n;
char *key_n2;
@@ -79,7 +193,7 @@ http://bugs.python.org/issue21457
for (key=KEY_MIN;key < KEY_MAX; key++) {
key_n = (char *)keyname(key);
if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
-@@ -3514,7 +3495,6 @@ PyInit__curses(void)
+@@ -3514,7 +3488,6 @@ PyInit__curses(void)
if (key_n2 != key_n)
PyMem_Free(key_n2);
}
diff --git a/lang/python35/distinfo b/lang/python35/distinfo
index dfd007c51eb..c58fa67ac20 100644
--- a/lang/python35/distinfo
+++ b/lang/python35/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2016/07/02 15:07:47 adam Exp $
+$NetBSD: distinfo,v 1.7 2017/01/02 20:52:46 roy Exp $
SHA1 (Python-3.5.2.tar.xz) = 4843aabacec5bc0cdd3e1f778faa926e532794d2
RMD160 (Python-3.5.2.tar.xz) = 709be7df28045c4fc8ed40cadd299478439f9522
@@ -8,7 +8,7 @@ SHA1 (patch-Include_py__curses.h) = 14359f8d0527eff08073c0aea60dfe8961d9255d
SHA1 (patch-Lib_distutils_command_install.py) = 9b44f339f65f029b7f17dbc654739a7ae3c12780
SHA1 (patch-Lib_distutils_unixccompiler.py) = 7d6df07921ad3357757d4681a964256b560b3f57
SHA1 (patch-Makefile.pre.in) = 5a27e9bc405b515f10b972ba9fc9421e05e4b7f1
-SHA1 (patch-Modules___cursesmodule.c) = 6bc66c9cb5320b4f90872024fc9c1e43d0b34928
+SHA1 (patch-Modules___cursesmodule.c) = cb3960bc91a5f815c8c4755e60124484b8c68266
SHA1 (patch-Modules_makesetup) = c9b571eb54fdf0b1e93524a6de6780e8c4119221
SHA1 (patch-Modules_nismodule.c) = bd290417c265846e238660180e60e76c0f5f696a
SHA1 (patch-Python_thread__pthread.h) = fb81eaa604b4ed7c1b64c3f4731d58a8aee257be
diff --git a/lang/python35/patches/patch-Modules___cursesmodule.c b/lang/python35/patches/patch-Modules___cursesmodule.c
index b9a2d6a9919..1408ba85273 100644
--- a/lang/python35/patches/patch-Modules___cursesmodule.c
+++ b/lang/python35/patches/patch-Modules___cursesmodule.c
@@ -1,11 +1,25 @@
-$NetBSD: patch-Modules___cursesmodule.c,v 1.2 2015/12/07 09:07:43 wiz Exp $
+$NetBSD: patch-Modules___cursesmodule.c,v 1.3 2017/01/02 20:52:46 roy Exp $
-Ncurses will be used by devel/py-curses and devel/py-cursespanel.
+Allow py-curses to use NetBSD curses as well as ncurses
http://bugs.python.org/issue21457
---- Modules/_cursesmodule.c.orig 2015-09-13 11:41:24.000000000 +0000
+--- Modules/_cursesmodule.c.orig 2016-06-25 21:38:38.000000000 +0000
+++ Modules/_cursesmodule.c
-@@ -486,17 +486,9 @@ Window_NoArg2TupleReturnFunction(getpary
+@@ -112,12 +112,7 @@ char *PyCursesVersion = "2.2";
+ #define CURSES_MODULE
+ #include "py_curses.h"
+
+-/* These prototypes are in <term.h>, but including this header
+- #defines many common symbols (such as "lines") which breaks the
+- curses module in other ways. So the code will just specify
+- explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
+-#ifdef __sgi
++#ifdef HAVE_TERM_H
+ #include <term.h>
+ #endif
+
+@@ -486,17 +481,9 @@ Window_NoArg2TupleReturnFunction(getpary
Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)")
@@ -23,7 +37,16 @@ http://bugs.python.org/issue21457
Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines")
-@@ -1156,11 +1148,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje
+@@ -1070,7 +1057,7 @@ PyCursesWindow_EchoChar(PyCursesWindowOb
+ return NULL;
+
+ #ifdef WINDOW_HAS_FLAGS
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ return PyCursesCheckERR(pechochar(self->win, ch | attr),
+ "echochar");
+ else
+@@ -1156,11 +1143,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje
return Py_BuildValue("C", rtn);
} else {
const char *knp;
@@ -35,7 +58,54 @@ http://bugs.python.org/issue21457
return PyUnicode_FromString((knp == NULL) ? "" : knp);
}
}
-@@ -2595,7 +2583,6 @@ PyCurses_Is_Term_Resized(PyObject *self,
+@@ -1593,7 +1576,7 @@ PyCursesWindow_NoOutRefresh(PyCursesWind
+ #ifndef WINDOW_HAS_FLAGS
+ if (0)
+ #else
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ #endif
+ {
+ switch(PyTuple_Size(args)) {
+@@ -1768,7 +1751,7 @@ PyCursesWindow_Refresh(PyCursesWindowObj
+ #ifndef WINDOW_HAS_FLAGS
+ if (0)
+ #else
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ #endif
+ {
+ switch(PyTuple_Size(args)) {
+@@ -1835,7 +1818,7 @@ PyCursesWindow_SubWin(PyCursesWindowObje
+
+ /* printf("Subwin: %i %i %i %i \n", nlines, ncols, begin_y, begin_x); */
+ #ifdef WINDOW_HAS_FLAGS
+- if (self->win->_flags & _ISPAD)
++ if (is_keypad(self->win))
+ win = subpad(self->win, nlines, ncols, begin_y, begin_x);
+ else
+ #endif
+@@ -2576,15 +2559,15 @@ PyCurses_IntrFlush(PyObject *self, PyObj
+ static PyObject *
+ PyCurses_Is_Term_Resized(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+ int result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:is_term_resized", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:is_term_resized", &nlines, &ncolumns))
+ return NULL;
+- result = is_term_resized(lines, columns);
++ result = is_term_resized(nlines, ncolumns);
+ if (result == TRUE) {
+ Py_INCREF(Py_True);
+ return Py_True;
+@@ -2595,7 +2578,6 @@ PyCurses_Is_Term_Resized(PyObject *self,
}
#endif /* HAVE_CURSES_IS_TERM_RESIZED */
@@ -43,7 +113,7 @@ http://bugs.python.org/issue21457
static PyObject *
PyCurses_KeyName(PyObject *self, PyObject *args)
{
-@@ -2614,7 +2601,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
+@@ -2614,7 +2596,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
return PyBytes_FromString((knp == NULL) ? "" : knp);
}
@@ -51,7 +121,50 @@ http://bugs.python.org/issue21457
static PyObject *
PyCurses_KillChar(PyObject *self)
-@@ -3228,9 +3214,7 @@ static PyMethodDef PyCurses_methods[] =
+@@ -2879,16 +2860,16 @@ PyCurses_update_lines_cols(PyObject *sel
+ static PyObject *
+ PyCurses_ResizeTerm(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+ PyObject *result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:resizeterm", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:resizeterm", &nlines, &ncolumns))
+ return NULL;
+
+- result = PyCursesCheckERR(resizeterm(lines, columns), "resizeterm");
++ result = PyCursesCheckERR(resizeterm(nlines, ncolumns), "resizeterm");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+@@ -2902,17 +2883,17 @@ PyCurses_ResizeTerm(PyObject *self, PyOb
+ static PyObject *
+ PyCurses_Resize_Term(PyObject *self, PyObject *args)
+ {
+- int lines;
+- int columns;
++ int nlines;
++ int ncolumns;
+
+ PyObject *result;
+
+ PyCursesInitialised;
+
+- if (!PyArg_ParseTuple(args,"ii:resize_term", &lines, &columns))
++ if (!PyArg_ParseTuple(args,"ii:resize_term", &nlines, &ncolumns))
+ return NULL;
+
+- result = PyCursesCheckERR(resize_term(lines, columns), "resize_term");
++ result = PyCursesCheckERR(resize_term(nlines, ncolumns), "resize_term");
+ if (!result)
+ return NULL;
+ if (!update_lines_cols())
+@@ -3228,9 +3209,7 @@ static PyMethodDef PyCurses_methods[] =
#ifdef HAVE_CURSES_IS_TERM_RESIZED
{"is_term_resized", (PyCFunction)PyCurses_Is_Term_Resized, METH_VARARGS},
#endif
@@ -61,7 +174,7 @@ http://bugs.python.org/issue21457
{"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS},
{"longname", (PyCFunction)PyCurses_longname, METH_NOARGS},
{"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS},
-@@ -3359,9 +3343,7 @@ PyInit__curses(void)
+@@ -3359,9 +3338,7 @@ PyInit__curses(void)
SetDictInt("A_DIM", A_DIM);
SetDictInt("A_BOLD", A_BOLD);
SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
@@ -71,7 +184,7 @@ http://bugs.python.org/issue21457
SetDictInt("A_PROTECT", A_PROTECT);
SetDictInt("A_CHARTEXT", A_CHARTEXT);
SetDictInt("A_COLOR", A_COLOR);
-@@ -3433,7 +3415,6 @@ PyInit__curses(void)
+@@ -3433,7 +3410,6 @@ PyInit__curses(void)
int key;
char *key_n;
char *key_n2;
@@ -79,7 +192,7 @@ http://bugs.python.org/issue21457
for (key=KEY_MIN;key < KEY_MAX; key++) {
key_n = (char *)keyname(key);
if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
-@@ -3461,7 +3442,6 @@ PyInit__curses(void)
+@@ -3461,7 +3437,6 @@ PyInit__curses(void)
if (key_n2 != key_n)
PyMem_Free(key_n2);
}