- Fix build on 64-bit platforms

This commit is contained in:
Pietro Cerutti 2009-05-13 17:59:41 +00:00
parent f4f49ff0b2
commit d145d1a02d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=233846
3 changed files with 44 additions and 5 deletions

View file

@ -30,10 +30,13 @@ PYDISTUTILS_NOEGGINFO= yes
USE_WX= 2.4
DEMO_DIR= ${PYTHONPREFIX_SITELIBDIR}/wxPython/demo
post-extract:
@${RM} ${WRKSRC}/demo/dllwidget/test_dll.so
post-build:
@${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${WRKSRC}/demo
.if !defined(DEBUG_FLAGS)
@${FIND} ${WRKSRC} -name "*.so" | ${XARGS} strip
@${FIND} ${WRKSRC} -name "*.so" | ${XARGS} ${STRIP_CMD}
.endif
post-install:
@ -50,10 +53,6 @@ post-install:
.include <bsd.port.pre.mk>
.if ${ARCH} == "amd64" || ${ARCH} == "ia64" || ${ARCH} == "sparc64"
BROKEN= Does not build on 64-bit architectures
.endif
CONFIGURE_ARGS+= --enable-gtk2
PYDISTUTILS_BUILDARGS+= WXPORT=gtk2
PYDISTUTILS_INSTALLARGS:= ${PYDISTUTILS_INSTALLARGS} ${PYDISTUTILS_BUILDARGS}

View file

@ -0,0 +1,20 @@
--- src/gtk/gdi.cpp.orig 2003-09-23 01:06:27.000000000 +0200
+++ src/gtk/gdi.cpp 2009-05-13 17:59:41.000000000 +0200
@@ -137,7 +137,7 @@
wxBitmap* wxBitmapFromBits(PyObject* bits, int width, int height, int depth = 1 ) {
char* buf;
- int length;
+ Py_ssize_t length;
PyString_AsStringAndSize(bits, &buf, &length);
return new wxBitmap(buf, width, height, depth);
}
@@ -193,7 +193,7 @@
PyObject* maskBits=0) {
char* bitsbuf;
char* maskbuf = NULL;
- int length;
+ Py_ssize_t length;
PyString_AsStringAndSize(bits, &bitsbuf, &length);
if (maskBits)
PyString_AsStringAndSize(maskBits, &maskbuf, &length);

View file

@ -0,0 +1,20 @@
--- src/helpers.cpp.orig 2009-05-13 16:55:33.000000000 +0200
+++ src/helpers.cpp 2009-05-13 16:57:42.000000000 +0200
@@ -1656,7 +1656,7 @@
target = new wxString(tmpPtr, *wxConvCurrent, tmpSize);
}
#else
- char* tmpPtr; int tmpSize;
+ char* tmpPtr; Py_ssize_t tmpSize;
if (PyString_AsStringAndSize(source, &tmpPtr, &tmpSize) == -1) {
PyErr_SetString(PyExc_TypeError, "Unable to convert string");
return NULL;
@@ -1702,7 +1702,7 @@
target = wxString(tmpPtr, *wxConvCurrent, tmpSize);
}
#else
- char* tmpPtr; int tmpSize;
+ char* tmpPtr; Py_ssize_t tmpSize;
PyString_AsStringAndSize(source, &tmpPtr, &tmpSize);
target = wxString(tmpPtr, tmpSize);
#endif // wxUSE_UNICODE