diff options
author | yyamano <yyamano@pkgsrc.org> | 2011-09-30 08:34:26 +0000 |
---|---|---|
committer | yyamano <yyamano@pkgsrc.org> | 2011-09-30 08:34:26 +0000 |
commit | 5e61f383212eee018bd465a9f9d5a263ecdbcec9 (patch) | |
tree | 4788a60756d13ab87bee7c6f0a9540c2606be460 /lang/python26 | |
parent | fdd8152a02ad78dd9eade20c78afbb280c09d528 (diff) | |
download | pkgsrc-5e61f383212eee018bd465a9f9d5a263ecdbcec9.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')
-rw-r--r-- | lang/python26/distinfo | 5 | ||||
-rw-r--r-- | lang/python26/patches/patch-Mac_Modules_fm___Fmmodule.c | 61 | ||||
-rw-r--r-- | lang/python26/patches/patch-Mac_Modules_qd___Qdmodule.c | 88 | ||||
-rw-r--r-- | lang/python26/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c | 75 |
4 files changed, 228 insertions, 1 deletions
diff --git a/lang/python26/distinfo b/lang/python26/distinfo index b8d9f9f0536..2b09a920d6c 100644 --- a/lang/python26/distinfo +++ b/lang/python26/distinfo @@ -1,8 +1,11 @@ -$NetBSD: distinfo,v 1.36 2011/09/14 17:07:01 hans Exp $ +$NetBSD: distinfo,v 1.37 2011/09/30 08:34:26 yyamano Exp $ SHA1 (Python-2.6.7.tar.bz2) = 5d35eb746e85fb3deaff8518448137c9b9fb6daa RMD160 (Python-2.6.7.tar.bz2) = 513e84a7cb76ca876e3803bb03ed558bd0378063 Size (Python-2.6.7.tar.bz2) = 11084667 bytes +SHA1 (patch-Mac_Modules_fm___Fmmodule.c) = b9314bccb51b4fe672b81559068f7a79d2965f94 +SHA1 (patch-Mac_Modules_qd___Qdmodule.c) = 45c748b15b9436d45ba137460389638aa7108c8d +SHA1 (patch-Mac_Modules_qdoffs___Qdoffsmodule.c) = 9994f0c1a908f18f1f3df3f05b184f082c018365 SHA1 (patch-SA43463) = a0285ce9eb1d994bb05cd54812f3fc9cb678fe7f SHA1 (patch-aa) = 0528fc5da76d5f1d19586ea3dda1acd09a4b0113 SHA1 (patch-ab) = b47aa9d18a7c1a99ac8cc8b29c64867443f303e5 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 ======================= */ |