From 0c38147fcbefb4d1fd17ed651b297e7ac601d0a2 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Sat, 20 Jul 2013 20:53:38 +0900 Subject: [PATCH] Fix build of native modules of Carbon/ncurses on OS X 10.7 --- .../Python-2.5.1/005_osx_failed_modules.patch | 124 ++++++++++++++++++ .../Python-2.5.2/005_osx_failed_modules.patch | 124 ++++++++++++++++++ .../Python-2.5.3/005_osx_failed_modules.patch | 124 ++++++++++++++++++ .../Python-2.5.4/005_osx_failed_modules.patch | 124 ++++++++++++++++++ .../Python-2.5.5/005_osx_failed_modules.patch | 124 ++++++++++++++++++ .../Python-2.5.6/005_osx_failed_modules.patch | 124 ++++++++++++++++++ .../Python-2.5/005_osx_failed_modules.patch | 124 ++++++++++++++++++ 7 files changed, 868 insertions(+) create mode 100644 plugins/python-build/share/python-build/patches/2.5.1/Python-2.5.1/005_osx_failed_modules.patch create mode 100644 plugins/python-build/share/python-build/patches/2.5.2/Python-2.5.2/005_osx_failed_modules.patch create mode 100644 plugins/python-build/share/python-build/patches/2.5.3/Python-2.5.3/005_osx_failed_modules.patch create mode 100644 plugins/python-build/share/python-build/patches/2.5.4/Python-2.5.4/005_osx_failed_modules.patch create mode 100644 plugins/python-build/share/python-build/patches/2.5.5/Python-2.5.5/005_osx_failed_modules.patch create mode 100644 plugins/python-build/share/python-build/patches/2.5.6/Python-2.5.6/005_osx_failed_modules.patch create mode 100644 plugins/python-build/share/python-build/patches/2.5/Python-2.5/005_osx_failed_modules.patch diff --git a/plugins/python-build/share/python-build/patches/2.5.1/Python-2.5.1/005_osx_failed_modules.patch b/plugins/python-build/share/python-build/patches/2.5.1/Python-2.5.1/005_osx_failed_modules.patch new file mode 100644 index 00000000..12d3d9b8 --- /dev/null +++ b/plugins/python-build/share/python-build/patches/2.5.1/Python-2.5.1/005_osx_failed_modules.patch @@ -0,0 +1,124 @@ +diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c +index 8115614..e36fce9 100755 +--- ./Mac/Modules/cg/_CGmodule.c ++++ ./Mac/Modules/cg/_CGmodule.c +@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject + return _res; + } + ++#ifndef __LP64__ + static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self + _res = Py_None; + return _res; + } ++#endif + + static PyMethodDef CGContextRefObj_methods[] = { + {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, +@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = { + PyDoc_STR("() -> None")}, + {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, + PyDoc_STR("(int shouldAntialias) -> None")}, ++#ifndef __LP64__ + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + PyDoc_STR("(CGrafPtr port) -> None")}, + {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, + PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, ++#endif + {NULL, NULL, 0} + }; + +@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = { + /* ------------------ End object type CGContextRef ------------------ */ + + ++#ifndef __LP64__ + static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + return _res; + + } ++#endif + + static PyMethodDef CG_methods[] = { ++#ifndef __LP64__ + {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, + PyDoc_STR("(CGrafPtr) -> CGContextRef")}, ++#endif + {NULL, NULL, 0} + }; + +diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c +index 0acf3fd..1728b59 100644 +--- ./Modules/_curses_panel.c ++++ ./Modules/_curses_panel.c +@@ -56,7 +56,7 @@ typedef struct { + + PyTypeObject PyCursesPanel_Type; + +-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type) ++#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type) + + /* Some helper functions. The problem is that there's always a window + associated with a panel. To ensure that Python's GC doesn't pull +@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) + po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type); + if (po == NULL) return NULL; + po->pan = pan; +- po->wo = wo; +- Py_INCREF(wo); + if (insert_lop(po) < 0) { +- PyObject_DEL(po); +- return NULL; ++ po->wo = NULL; ++ Py_DECREF(po); ++ return NULL; + } ++ po->wo = wo; ++ Py_INCREF(wo); + return (PyObject *)po; + } + +@@ -191,8 +192,10 @@ static void + PyCursesPanel_Dealloc(PyCursesPanelObject *po) + { + (void)del_panel(po->pan); +- Py_DECREF(po->wo); +- remove_lop(po); ++ if (po->wo != NULL) { ++ Py_DECREF(po->wo); ++ remove_lop(po); ++ } + PyObject_DEL(po); + } + +@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name) + /* -------------------------------------------------------*/ + + PyTypeObject PyCursesPanel_Type = { +- PyObject_HEAD_INIT(NULL) +- 0, /*ob_size*/ +- "_curses_panel.curses panel", /*tp_name*/ +- sizeof(PyCursesPanelObject), /*tp_basicsize*/ +- 0, /*tp_itemsize*/ ++ PyVarObject_HEAD_INIT(NULL, 0) ++ "_curses_panel.curses panel", /*tp_name*/ ++ sizeof(PyCursesPanelObject), /*tp_basicsize*/ ++ 0, /*tp_itemsize*/ + /* methods */ + (destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ +@@ -458,7 +460,7 @@ init_curses_panel(void) + PyObject *m, *d, *v; + + /* Initialize object type */ +- PyCursesPanel_Type.ob_type = &PyType_Type; ++ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type; + + import_curses(); + diff --git a/plugins/python-build/share/python-build/patches/2.5.2/Python-2.5.2/005_osx_failed_modules.patch b/plugins/python-build/share/python-build/patches/2.5.2/Python-2.5.2/005_osx_failed_modules.patch new file mode 100644 index 00000000..12d3d9b8 --- /dev/null +++ b/plugins/python-build/share/python-build/patches/2.5.2/Python-2.5.2/005_osx_failed_modules.patch @@ -0,0 +1,124 @@ +diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c +index 8115614..e36fce9 100755 +--- ./Mac/Modules/cg/_CGmodule.c ++++ ./Mac/Modules/cg/_CGmodule.c +@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject + return _res; + } + ++#ifndef __LP64__ + static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self + _res = Py_None; + return _res; + } ++#endif + + static PyMethodDef CGContextRefObj_methods[] = { + {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, +@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = { + PyDoc_STR("() -> None")}, + {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, + PyDoc_STR("(int shouldAntialias) -> None")}, ++#ifndef __LP64__ + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + PyDoc_STR("(CGrafPtr port) -> None")}, + {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, + PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, ++#endif + {NULL, NULL, 0} + }; + +@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = { + /* ------------------ End object type CGContextRef ------------------ */ + + ++#ifndef __LP64__ + static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + return _res; + + } ++#endif + + static PyMethodDef CG_methods[] = { ++#ifndef __LP64__ + {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, + PyDoc_STR("(CGrafPtr) -> CGContextRef")}, ++#endif + {NULL, NULL, 0} + }; + +diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c +index 0acf3fd..1728b59 100644 +--- ./Modules/_curses_panel.c ++++ ./Modules/_curses_panel.c +@@ -56,7 +56,7 @@ typedef struct { + + PyTypeObject PyCursesPanel_Type; + +-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type) ++#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type) + + /* Some helper functions. The problem is that there's always a window + associated with a panel. To ensure that Python's GC doesn't pull +@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) + po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type); + if (po == NULL) return NULL; + po->pan = pan; +- po->wo = wo; +- Py_INCREF(wo); + if (insert_lop(po) < 0) { +- PyObject_DEL(po); +- return NULL; ++ po->wo = NULL; ++ Py_DECREF(po); ++ return NULL; + } ++ po->wo = wo; ++ Py_INCREF(wo); + return (PyObject *)po; + } + +@@ -191,8 +192,10 @@ static void + PyCursesPanel_Dealloc(PyCursesPanelObject *po) + { + (void)del_panel(po->pan); +- Py_DECREF(po->wo); +- remove_lop(po); ++ if (po->wo != NULL) { ++ Py_DECREF(po->wo); ++ remove_lop(po); ++ } + PyObject_DEL(po); + } + +@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name) + /* -------------------------------------------------------*/ + + PyTypeObject PyCursesPanel_Type = { +- PyObject_HEAD_INIT(NULL) +- 0, /*ob_size*/ +- "_curses_panel.curses panel", /*tp_name*/ +- sizeof(PyCursesPanelObject), /*tp_basicsize*/ +- 0, /*tp_itemsize*/ ++ PyVarObject_HEAD_INIT(NULL, 0) ++ "_curses_panel.curses panel", /*tp_name*/ ++ sizeof(PyCursesPanelObject), /*tp_basicsize*/ ++ 0, /*tp_itemsize*/ + /* methods */ + (destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ +@@ -458,7 +460,7 @@ init_curses_panel(void) + PyObject *m, *d, *v; + + /* Initialize object type */ +- PyCursesPanel_Type.ob_type = &PyType_Type; ++ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type; + + import_curses(); + diff --git a/plugins/python-build/share/python-build/patches/2.5.3/Python-2.5.3/005_osx_failed_modules.patch b/plugins/python-build/share/python-build/patches/2.5.3/Python-2.5.3/005_osx_failed_modules.patch new file mode 100644 index 00000000..12d3d9b8 --- /dev/null +++ b/plugins/python-build/share/python-build/patches/2.5.3/Python-2.5.3/005_osx_failed_modules.patch @@ -0,0 +1,124 @@ +diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c +index 8115614..e36fce9 100755 +--- ./Mac/Modules/cg/_CGmodule.c ++++ ./Mac/Modules/cg/_CGmodule.c +@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject + return _res; + } + ++#ifndef __LP64__ + static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self + _res = Py_None; + return _res; + } ++#endif + + static PyMethodDef CGContextRefObj_methods[] = { + {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, +@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = { + PyDoc_STR("() -> None")}, + {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, + PyDoc_STR("(int shouldAntialias) -> None")}, ++#ifndef __LP64__ + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + PyDoc_STR("(CGrafPtr port) -> None")}, + {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, + PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, ++#endif + {NULL, NULL, 0} + }; + +@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = { + /* ------------------ End object type CGContextRef ------------------ */ + + ++#ifndef __LP64__ + static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + return _res; + + } ++#endif + + static PyMethodDef CG_methods[] = { ++#ifndef __LP64__ + {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, + PyDoc_STR("(CGrafPtr) -> CGContextRef")}, ++#endif + {NULL, NULL, 0} + }; + +diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c +index 0acf3fd..1728b59 100644 +--- ./Modules/_curses_panel.c ++++ ./Modules/_curses_panel.c +@@ -56,7 +56,7 @@ typedef struct { + + PyTypeObject PyCursesPanel_Type; + +-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type) ++#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type) + + /* Some helper functions. The problem is that there's always a window + associated with a panel. To ensure that Python's GC doesn't pull +@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) + po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type); + if (po == NULL) return NULL; + po->pan = pan; +- po->wo = wo; +- Py_INCREF(wo); + if (insert_lop(po) < 0) { +- PyObject_DEL(po); +- return NULL; ++ po->wo = NULL; ++ Py_DECREF(po); ++ return NULL; + } ++ po->wo = wo; ++ Py_INCREF(wo); + return (PyObject *)po; + } + +@@ -191,8 +192,10 @@ static void + PyCursesPanel_Dealloc(PyCursesPanelObject *po) + { + (void)del_panel(po->pan); +- Py_DECREF(po->wo); +- remove_lop(po); ++ if (po->wo != NULL) { ++ Py_DECREF(po->wo); ++ remove_lop(po); ++ } + PyObject_DEL(po); + } + +@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name) + /* -------------------------------------------------------*/ + + PyTypeObject PyCursesPanel_Type = { +- PyObject_HEAD_INIT(NULL) +- 0, /*ob_size*/ +- "_curses_panel.curses panel", /*tp_name*/ +- sizeof(PyCursesPanelObject), /*tp_basicsize*/ +- 0, /*tp_itemsize*/ ++ PyVarObject_HEAD_INIT(NULL, 0) ++ "_curses_panel.curses panel", /*tp_name*/ ++ sizeof(PyCursesPanelObject), /*tp_basicsize*/ ++ 0, /*tp_itemsize*/ + /* methods */ + (destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ +@@ -458,7 +460,7 @@ init_curses_panel(void) + PyObject *m, *d, *v; + + /* Initialize object type */ +- PyCursesPanel_Type.ob_type = &PyType_Type; ++ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type; + + import_curses(); + diff --git a/plugins/python-build/share/python-build/patches/2.5.4/Python-2.5.4/005_osx_failed_modules.patch b/plugins/python-build/share/python-build/patches/2.5.4/Python-2.5.4/005_osx_failed_modules.patch new file mode 100644 index 00000000..12d3d9b8 --- /dev/null +++ b/plugins/python-build/share/python-build/patches/2.5.4/Python-2.5.4/005_osx_failed_modules.patch @@ -0,0 +1,124 @@ +diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c +index 8115614..e36fce9 100755 +--- ./Mac/Modules/cg/_CGmodule.c ++++ ./Mac/Modules/cg/_CGmodule.c +@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject + return _res; + } + ++#ifndef __LP64__ + static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self + _res = Py_None; + return _res; + } ++#endif + + static PyMethodDef CGContextRefObj_methods[] = { + {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, +@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = { + PyDoc_STR("() -> None")}, + {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, + PyDoc_STR("(int shouldAntialias) -> None")}, ++#ifndef __LP64__ + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + PyDoc_STR("(CGrafPtr port) -> None")}, + {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, + PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, ++#endif + {NULL, NULL, 0} + }; + +@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = { + /* ------------------ End object type CGContextRef ------------------ */ + + ++#ifndef __LP64__ + static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + return _res; + + } ++#endif + + static PyMethodDef CG_methods[] = { ++#ifndef __LP64__ + {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, + PyDoc_STR("(CGrafPtr) -> CGContextRef")}, ++#endif + {NULL, NULL, 0} + }; + +diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c +index 0acf3fd..1728b59 100644 +--- ./Modules/_curses_panel.c ++++ ./Modules/_curses_panel.c +@@ -56,7 +56,7 @@ typedef struct { + + PyTypeObject PyCursesPanel_Type; + +-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type) ++#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type) + + /* Some helper functions. The problem is that there's always a window + associated with a panel. To ensure that Python's GC doesn't pull +@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) + po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type); + if (po == NULL) return NULL; + po->pan = pan; +- po->wo = wo; +- Py_INCREF(wo); + if (insert_lop(po) < 0) { +- PyObject_DEL(po); +- return NULL; ++ po->wo = NULL; ++ Py_DECREF(po); ++ return NULL; + } ++ po->wo = wo; ++ Py_INCREF(wo); + return (PyObject *)po; + } + +@@ -191,8 +192,10 @@ static void + PyCursesPanel_Dealloc(PyCursesPanelObject *po) + { + (void)del_panel(po->pan); +- Py_DECREF(po->wo); +- remove_lop(po); ++ if (po->wo != NULL) { ++ Py_DECREF(po->wo); ++ remove_lop(po); ++ } + PyObject_DEL(po); + } + +@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name) + /* -------------------------------------------------------*/ + + PyTypeObject PyCursesPanel_Type = { +- PyObject_HEAD_INIT(NULL) +- 0, /*ob_size*/ +- "_curses_panel.curses panel", /*tp_name*/ +- sizeof(PyCursesPanelObject), /*tp_basicsize*/ +- 0, /*tp_itemsize*/ ++ PyVarObject_HEAD_INIT(NULL, 0) ++ "_curses_panel.curses panel", /*tp_name*/ ++ sizeof(PyCursesPanelObject), /*tp_basicsize*/ ++ 0, /*tp_itemsize*/ + /* methods */ + (destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ +@@ -458,7 +460,7 @@ init_curses_panel(void) + PyObject *m, *d, *v; + + /* Initialize object type */ +- PyCursesPanel_Type.ob_type = &PyType_Type; ++ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type; + + import_curses(); + diff --git a/plugins/python-build/share/python-build/patches/2.5.5/Python-2.5.5/005_osx_failed_modules.patch b/plugins/python-build/share/python-build/patches/2.5.5/Python-2.5.5/005_osx_failed_modules.patch new file mode 100644 index 00000000..12d3d9b8 --- /dev/null +++ b/plugins/python-build/share/python-build/patches/2.5.5/Python-2.5.5/005_osx_failed_modules.patch @@ -0,0 +1,124 @@ +diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c +index 8115614..e36fce9 100755 +--- ./Mac/Modules/cg/_CGmodule.c ++++ ./Mac/Modules/cg/_CGmodule.c +@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject + return _res; + } + ++#ifndef __LP64__ + static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self + _res = Py_None; + return _res; + } ++#endif + + static PyMethodDef CGContextRefObj_methods[] = { + {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, +@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = { + PyDoc_STR("() -> None")}, + {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, + PyDoc_STR("(int shouldAntialias) -> None")}, ++#ifndef __LP64__ + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + PyDoc_STR("(CGrafPtr port) -> None")}, + {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, + PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, ++#endif + {NULL, NULL, 0} + }; + +@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = { + /* ------------------ End object type CGContextRef ------------------ */ + + ++#ifndef __LP64__ + static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + return _res; + + } ++#endif + + static PyMethodDef CG_methods[] = { ++#ifndef __LP64__ + {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, + PyDoc_STR("(CGrafPtr) -> CGContextRef")}, ++#endif + {NULL, NULL, 0} + }; + +diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c +index 0acf3fd..1728b59 100644 +--- ./Modules/_curses_panel.c ++++ ./Modules/_curses_panel.c +@@ -56,7 +56,7 @@ typedef struct { + + PyTypeObject PyCursesPanel_Type; + +-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type) ++#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type) + + /* Some helper functions. The problem is that there's always a window + associated with a panel. To ensure that Python's GC doesn't pull +@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) + po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type); + if (po == NULL) return NULL; + po->pan = pan; +- po->wo = wo; +- Py_INCREF(wo); + if (insert_lop(po) < 0) { +- PyObject_DEL(po); +- return NULL; ++ po->wo = NULL; ++ Py_DECREF(po); ++ return NULL; + } ++ po->wo = wo; ++ Py_INCREF(wo); + return (PyObject *)po; + } + +@@ -191,8 +192,10 @@ static void + PyCursesPanel_Dealloc(PyCursesPanelObject *po) + { + (void)del_panel(po->pan); +- Py_DECREF(po->wo); +- remove_lop(po); ++ if (po->wo != NULL) { ++ Py_DECREF(po->wo); ++ remove_lop(po); ++ } + PyObject_DEL(po); + } + +@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name) + /* -------------------------------------------------------*/ + + PyTypeObject PyCursesPanel_Type = { +- PyObject_HEAD_INIT(NULL) +- 0, /*ob_size*/ +- "_curses_panel.curses panel", /*tp_name*/ +- sizeof(PyCursesPanelObject), /*tp_basicsize*/ +- 0, /*tp_itemsize*/ ++ PyVarObject_HEAD_INIT(NULL, 0) ++ "_curses_panel.curses panel", /*tp_name*/ ++ sizeof(PyCursesPanelObject), /*tp_basicsize*/ ++ 0, /*tp_itemsize*/ + /* methods */ + (destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ +@@ -458,7 +460,7 @@ init_curses_panel(void) + PyObject *m, *d, *v; + + /* Initialize object type */ +- PyCursesPanel_Type.ob_type = &PyType_Type; ++ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type; + + import_curses(); + diff --git a/plugins/python-build/share/python-build/patches/2.5.6/Python-2.5.6/005_osx_failed_modules.patch b/plugins/python-build/share/python-build/patches/2.5.6/Python-2.5.6/005_osx_failed_modules.patch new file mode 100644 index 00000000..12d3d9b8 --- /dev/null +++ b/plugins/python-build/share/python-build/patches/2.5.6/Python-2.5.6/005_osx_failed_modules.patch @@ -0,0 +1,124 @@ +diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c +index 8115614..e36fce9 100755 +--- ./Mac/Modules/cg/_CGmodule.c ++++ ./Mac/Modules/cg/_CGmodule.c +@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject + return _res; + } + ++#ifndef __LP64__ + static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self + _res = Py_None; + return _res; + } ++#endif + + static PyMethodDef CGContextRefObj_methods[] = { + {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, +@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = { + PyDoc_STR("() -> None")}, + {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, + PyDoc_STR("(int shouldAntialias) -> None")}, ++#ifndef __LP64__ + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + PyDoc_STR("(CGrafPtr port) -> None")}, + {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, + PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, ++#endif + {NULL, NULL, 0} + }; + +@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = { + /* ------------------ End object type CGContextRef ------------------ */ + + ++#ifndef __LP64__ + static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + return _res; + + } ++#endif + + static PyMethodDef CG_methods[] = { ++#ifndef __LP64__ + {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, + PyDoc_STR("(CGrafPtr) -> CGContextRef")}, ++#endif + {NULL, NULL, 0} + }; + +diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c +index 0acf3fd..1728b59 100644 +--- ./Modules/_curses_panel.c ++++ ./Modules/_curses_panel.c +@@ -56,7 +56,7 @@ typedef struct { + + PyTypeObject PyCursesPanel_Type; + +-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type) ++#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type) + + /* Some helper functions. The problem is that there's always a window + associated with a panel. To ensure that Python's GC doesn't pull +@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) + po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type); + if (po == NULL) return NULL; + po->pan = pan; +- po->wo = wo; +- Py_INCREF(wo); + if (insert_lop(po) < 0) { +- PyObject_DEL(po); +- return NULL; ++ po->wo = NULL; ++ Py_DECREF(po); ++ return NULL; + } ++ po->wo = wo; ++ Py_INCREF(wo); + return (PyObject *)po; + } + +@@ -191,8 +192,10 @@ static void + PyCursesPanel_Dealloc(PyCursesPanelObject *po) + { + (void)del_panel(po->pan); +- Py_DECREF(po->wo); +- remove_lop(po); ++ if (po->wo != NULL) { ++ Py_DECREF(po->wo); ++ remove_lop(po); ++ } + PyObject_DEL(po); + } + +@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name) + /* -------------------------------------------------------*/ + + PyTypeObject PyCursesPanel_Type = { +- PyObject_HEAD_INIT(NULL) +- 0, /*ob_size*/ +- "_curses_panel.curses panel", /*tp_name*/ +- sizeof(PyCursesPanelObject), /*tp_basicsize*/ +- 0, /*tp_itemsize*/ ++ PyVarObject_HEAD_INIT(NULL, 0) ++ "_curses_panel.curses panel", /*tp_name*/ ++ sizeof(PyCursesPanelObject), /*tp_basicsize*/ ++ 0, /*tp_itemsize*/ + /* methods */ + (destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ +@@ -458,7 +460,7 @@ init_curses_panel(void) + PyObject *m, *d, *v; + + /* Initialize object type */ +- PyCursesPanel_Type.ob_type = &PyType_Type; ++ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type; + + import_curses(); + diff --git a/plugins/python-build/share/python-build/patches/2.5/Python-2.5/005_osx_failed_modules.patch b/plugins/python-build/share/python-build/patches/2.5/Python-2.5/005_osx_failed_modules.patch new file mode 100644 index 00000000..12d3d9b8 --- /dev/null +++ b/plugins/python-build/share/python-build/patches/2.5/Python-2.5/005_osx_failed_modules.patch @@ -0,0 +1,124 @@ +diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c +index 8115614..e36fce9 100755 +--- ./Mac/Modules/cg/_CGmodule.c ++++ ./Mac/Modules/cg/_CGmodule.c +@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject + return _res; + } + ++#ifndef __LP64__ + static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self + _res = Py_None; + return _res; + } ++#endif + + static PyMethodDef CGContextRefObj_methods[] = { + {"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1, +@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = { + PyDoc_STR("() -> None")}, + {"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1, + PyDoc_STR("(int shouldAntialias) -> None")}, ++#ifndef __LP64__ + {"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1, + PyDoc_STR("(CGrafPtr port) -> None")}, + {"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1, + PyDoc_STR("(Rect portRect, RgnHandle region) -> None")}, ++#endif + {NULL, NULL, 0} + }; + +@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = { + /* ------------------ End object type CGContextRef ------------------ */ + + ++#ifndef __LP64__ + static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; +@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args) + return _res; + + } ++#endif + + static PyMethodDef CG_methods[] = { ++#ifndef __LP64__ + {"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1, + PyDoc_STR("(CGrafPtr) -> CGContextRef")}, ++#endif + {NULL, NULL, 0} + }; + +diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c +index 0acf3fd..1728b59 100644 +--- ./Modules/_curses_panel.c ++++ ./Modules/_curses_panel.c +@@ -56,7 +56,7 @@ typedef struct { + + PyTypeObject PyCursesPanel_Type; + +-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type) ++#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type) + + /* Some helper functions. The problem is that there's always a window + associated with a panel. To ensure that Python's GC doesn't pull +@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) + po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type); + if (po == NULL) return NULL; + po->pan = pan; +- po->wo = wo; +- Py_INCREF(wo); + if (insert_lop(po) < 0) { +- PyObject_DEL(po); +- return NULL; ++ po->wo = NULL; ++ Py_DECREF(po); ++ return NULL; + } ++ po->wo = wo; ++ Py_INCREF(wo); + return (PyObject *)po; + } + +@@ -191,8 +192,10 @@ static void + PyCursesPanel_Dealloc(PyCursesPanelObject *po) + { + (void)del_panel(po->pan); +- Py_DECREF(po->wo); +- remove_lop(po); ++ if (po->wo != NULL) { ++ Py_DECREF(po->wo); ++ remove_lop(po); ++ } + PyObject_DEL(po); + } + +@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name) + /* -------------------------------------------------------*/ + + PyTypeObject PyCursesPanel_Type = { +- PyObject_HEAD_INIT(NULL) +- 0, /*ob_size*/ +- "_curses_panel.curses panel", /*tp_name*/ +- sizeof(PyCursesPanelObject), /*tp_basicsize*/ +- 0, /*tp_itemsize*/ ++ PyVarObject_HEAD_INIT(NULL, 0) ++ "_curses_panel.curses panel", /*tp_name*/ ++ sizeof(PyCursesPanelObject), /*tp_basicsize*/ ++ 0, /*tp_itemsize*/ + /* methods */ + (destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ +@@ -458,7 +460,7 @@ init_curses_panel(void) + PyObject *m, *d, *v; + + /* Initialize object type */ +- PyCursesPanel_Type.ob_type = &PyType_Type; ++ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type; + + import_curses(); +