summaryrefslogtreecommitdiff
path: root/lang/python26/patches
diff options
context:
space:
mode:
authoryyamano <yyamano>2011-09-30 08:34:26 +0000
committeryyamano <yyamano>2011-09-30 08:34:26 +0000
commit420bbd4030154475dc1721fd295f9f0d3f4b9ac4 (patch)
tree4788a60756d13ab87bee7c6f0a9540c2606be460 /lang/python26/patches
parente2e8c20173adb56a567b68c13ea1bf13486143ee (diff)
downloadpkgsrc-420bbd4030154475dc1721fd295f9f0d3f4b9ac4.tar.gz
Make this build on Mac OS X Lion. Fixes PR pkg/45389.
It is not a leaf package, but the changes affect Mac OS X only. Test builds on 10.5/i386, 10.6/i386 (thanks tron@), 10.7/i386 and 10.7/x86_64 (thanks ryoon@).
Diffstat (limited to 'lang/python26/patches')
-rw-r--r--lang/python26/patches/patch-Mac_Modules_fm___Fmmodule.c61
-rw-r--r--lang/python26/patches/patch-Mac_Modules_qd___Qdmodule.c88
-rw-r--r--lang/python26/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c75
3 files changed, 224 insertions, 0 deletions
diff --git a/lang/python26/patches/patch-Mac_Modules_fm___Fmmodule.c b/lang/python26/patches/patch-Mac_Modules_fm___Fmmodule.c
new file mode 100644
index 00000000000..29a785ca17a
--- /dev/null
+++ b/lang/python26/patches/patch-Mac_Modules_fm___Fmmodule.c
@@ -0,0 +1,61 @@
+$NetBSD: patch-Mac_Modules_fm___Fmmodule.c,v 1.1 2011/09/30 08:34:26 yyamano Exp $
+
+Fix build errors on Mac OS XLion.
+
+--- Mac/Modules/fm/_Fmmodule.c.orig 2010-05-09 15:15:40.000000000 +0000
++++ Mac/Modules/fm/_Fmmodule.c
+@@ -3,8 +3,14 @@
+
+ #include "Python.h"
+
+-#ifndef __LP64__
++#include <AvailabilityMacros.h>
++#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) || defined(__LP64__)
++#undef HAVE_CARBON
++#else
++#define HAVE_CARBON
++#endif
+
++#ifdef HAVE_CARBON
+
+ #include "pymactoolbox.h"
+
+@@ -336,32 +342,32 @@ static PyMethodDef Fm_methods[] = {
+ {NULL, NULL, 0}
+ };
+
+-#else /* __LP64__ */
++#else /* HAVE_CARBON */
+
+ static PyMethodDef Fm_methods[] = {
+ {NULL, NULL, 0}
+ };
+
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+
+ void init_Fm(void)
+ {
+ PyObject *m;
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ PyObject *d;
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+
+
+
+
+ m = Py_InitModule("_Fm", Fm_methods);
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ d = PyModule_GetDict(m);
+ Fm_Error = PyMac_GetOSErrException();
+ if (Fm_Error == NULL ||
+ PyDict_SetItemString(d, "Error", Fm_Error) != 0)
+ return;
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+ }
+
+ /* ========================= End module _Fm ========================= */
diff --git a/lang/python26/patches/patch-Mac_Modules_qd___Qdmodule.c b/lang/python26/patches/patch-Mac_Modules_qd___Qdmodule.c
new file mode 100644
index 00000000000..55b069436e7
--- /dev/null
+++ b/lang/python26/patches/patch-Mac_Modules_qd___Qdmodule.c
@@ -0,0 +1,88 @@
+$NetBSD: patch-Mac_Modules_qd___Qdmodule.c,v 1.1 2011/09/30 08:34:26 yyamano Exp $
+
+Fix build errors on Mac OS XLion.
+
+--- Mac/Modules/qd/_Qdmodule.c.orig 2010-05-09 15:15:40.000000000 +0000
++++ Mac/Modules/qd/_Qdmodule.c
+@@ -3,8 +3,14 @@
+
+ #include "Python.h"
+
++#include <AvailabilityMacros.h>
++#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) || defined(__LP64__)
++#undef HAVE_CARBON
++#else
++#define HAVE_CARBON
++#endif
+
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+
+ #include "pymactoolbox.h"
+
+@@ -6545,10 +6551,10 @@ static PyObject *Qd_RawBitMap(PyObject *
+ return _res;
+
+ }
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+
+ static PyMethodDef Qd_methods[] = {
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ {"GetPort", (PyCFunction)Qd_GetPort, 1,
+ PyDoc_STR("() -> (GrafPtr port)")},
+ {"GrafDevice", (PyCFunction)Qd_GrafDevice, 1,
+@@ -7083,12 +7089,12 @@ static PyMethodDef Qd_methods[] = {
+ PyDoc_STR("Take (string, int, Rect) argument and create BitMap")},
+ {"RawBitMap", (PyCFunction)Qd_RawBitMap, 1,
+ PyDoc_STR("Take string BitMap and turn into BitMap object")},
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+ {NULL, NULL, 0}
+ };
+
+
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+
+ /* Like BMObj_New, but the original bitmap data structure is copied (and
+ ** released when the object is released)
+@@ -7106,13 +7112,13 @@ PyObject *BMObj_NewCopied(BitMapPtr itse
+ return (PyObject *)it;
+ }
+
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+
+
+ void init_Qd(void)
+ {
+ PyObject *m;
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ PyObject *d;
+
+
+@@ -7124,10 +7130,10 @@ void init_Qd(void)
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(RGBColorPtr, QdRGB_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColor, QdRGB_Convert);
+
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+
+ m = Py_InitModule("_Qd", Qd_methods);
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ d = PyModule_GetDict(m);
+ Qd_Error = PyMac_GetOSErrException();
+ if (Qd_Error == NULL ||
+@@ -7147,7 +7153,7 @@ void init_Qd(void)
+ /* Backward-compatible name */
+ Py_INCREF(&BitMap_Type);
+ PyModule_AddObject(m, "BitMapType", (PyObject *)&BitMap_Type);
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+ }
+
+ /* ========================= End module _Qd ========================= */
diff --git a/lang/python26/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c b/lang/python26/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c
new file mode 100644
index 00000000000..ec8e023c328
--- /dev/null
+++ b/lang/python26/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c
@@ -0,0 +1,75 @@
+$NetBSD: patch-Mac_Modules_qdoffs___Qdoffsmodule.c,v 1.1 2011/09/30 08:34:26 yyamano Exp $
+
+Fix build errors on Mac OS XLion.
+
+--- Mac/Modules/qdoffs/_Qdoffsmodule.c.orig 2010-05-09 15:15:40.000000000 +0000
++++ Mac/Modules/qdoffs/_Qdoffsmodule.c
+@@ -3,8 +3,14 @@
+
+ #include "Python.h"
+
++#include <AvailabilityMacros.h>
++#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) || defined(__LP64__)
++#undef HAVE_CARBON
++#else
++#define HAVE_CARBON
++#endif
+
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+
+ #include "pymactoolbox.h"
+
+@@ -631,10 +637,10 @@ static PyObject *Qdoffs_PutPixMapBytes(P
+ return _res;
+
+ }
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+
+ static PyMethodDef Qdoffs_methods[] = {
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ {"NewGWorld", (PyCFunction)Qdoffs_NewGWorld, 1,
+ PyDoc_STR("(short PixelDepth, Rect boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags) -> (GWorldPtr offscreenGWorld)")},
+ {"LockPixels", (PyCFunction)Qdoffs_LockPixels, 1,
+@@ -681,7 +687,7 @@ static PyMethodDef Qdoffs_methods[] = {
+ PyDoc_STR("(pixmap, int start, int size) -> string. Return bytes from the pixmap")},
+ {"PutPixMapBytes", (PyCFunction)Qdoffs_PutPixMapBytes, 1,
+ PyDoc_STR("(pixmap, int start, string data). Store bytes into the pixmap")},
+-#endif /* __LP64__ */
++#endif /* CARBON */
+ {NULL, NULL, 0}
+ };
+
+@@ -691,7 +697,7 @@ static PyMethodDef Qdoffs_methods[] = {
+ void init_Qdoffs(void)
+ {
+ PyObject *m;
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ PyObject *d;
+
+
+@@ -699,10 +705,10 @@ void init_Qdoffs(void)
+ PyMac_INIT_TOOLBOX_OBJECT_NEW(GWorldPtr, GWorldObj_New);
+ PyMac_INIT_TOOLBOX_OBJECT_CONVERT(GWorldPtr, GWorldObj_Convert);
+
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+
+ m = Py_InitModule("_Qdoffs", Qdoffs_methods);
+-#ifndef __LP64__
++#ifdef HAVE_CARBON
+ d = PyModule_GetDict(m);
+ Qdoffs_Error = PyMac_GetOSErrException();
+ if (Qdoffs_Error == NULL ||
+@@ -715,7 +721,7 @@ void init_Qdoffs(void)
+ /* Backward-compatible name */
+ Py_INCREF(&GWorld_Type);
+ PyModule_AddObject(m, "GWorldType", (PyObject *)&GWorld_Type);
+-#endif /* __LP64__ */
++#endif /* HAVE_CARBON */
+ }
+
+ /* ======================= End module _Qdoffs ======================= */