summaryrefslogtreecommitdiff
path: root/lang/python27
diff options
context:
space:
mode:
authoryyamano <yyamano@pkgsrc.org>2011-09-30 08:37:24 +0000
committeryyamano <yyamano@pkgsrc.org>2011-09-30 08:37:24 +0000
commitec4e743c2e410dc639ad410cf447fcedf44d4328 (patch)
tree4166ccc4c82cbb23b6e679fec30d837728f4639c /lang/python27
parent5e61f383212eee018bd465a9f9d5a263ecdbcec9 (diff)
downloadpkgsrc-ec4e743c2e410dc639ad410cf447fcedf44d4328.tar.gz
Make this build on Mac OS X Lion. Same issue as pkg/45389.
It is not a leaf package, but the changes affect Mac OS X only. Test builds on 10.5/i386, 10.7/i386 and 10.7/x86_64 (thanks ryoon@).
Diffstat (limited to 'lang/python27')
-rw-r--r--lang/python27/distinfo5
-rw-r--r--lang/python27/patches/patch-Mac_Modules_fm___Fmmodule.c61
-rw-r--r--lang/python27/patches/patch-Mac_Modules_qd___Qdmodule.c88
-rw-r--r--lang/python27/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c75
4 files changed, 228 insertions, 1 deletions
diff --git a/lang/python27/distinfo b/lang/python27/distinfo
index 60c6d6adc91..63789d81c7e 100644
--- a/lang/python27/distinfo
+++ b/lang/python27/distinfo
@@ -1,8 +1,11 @@
-$NetBSD: distinfo,v 1.8 2011/09/16 19:17:52 bsiegert Exp $
+$NetBSD: distinfo,v 1.9 2011/09/30 08:37:24 yyamano Exp $
SHA1 (Python-2.7.2.tar.bz2) = 417bdeea77abfaf1b9257fc6b4a04aaa209f4547
RMD160 (Python-2.7.2.tar.bz2) = c3bf4f09b7c429a4d9f4cc251c795304cd5232c5
Size (Python-2.7.2.tar.bz2) = 11754834 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-aa) = 990e4025bb6a37715e1f5df1831499f0ab08acfa
SHA1 (patch-ab) = 8c44f60d9ed0babb107bc4643b0437e2dd55d03a
SHA1 (patch-ad) = de730b9f5a5efb56afa8bed05824b5f6579242ec
diff --git a/lang/python27/patches/patch-Mac_Modules_fm___Fmmodule.c b/lang/python27/patches/patch-Mac_Modules_fm___Fmmodule.c
new file mode 100644
index 00000000000..0334d57deed
--- /dev/null
+++ b/lang/python27/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:37:24 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/python27/patches/patch-Mac_Modules_qd___Qdmodule.c b/lang/python27/patches/patch-Mac_Modules_qd___Qdmodule.c
new file mode 100644
index 00000000000..23f612c147d
--- /dev/null
+++ b/lang/python27/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:37:24 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/python27/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c b/lang/python27/patches/patch-Mac_Modules_qdoffs___Qdoffsmodule.c
new file mode 100644
index 00000000000..7403b6a0486
--- /dev/null
+++ b/lang/python27/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:37:24 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 ======================= */