From cbb102e3d0735028c624583264ce5243d93ef844 Mon Sep 17 00:00:00 2001 From: Steve Chaplin <> Date: Wed, 23 May 2012 08:07:51 +0800 Subject: Update waf to check for xpyb. Bug #50134. --- src/surface.c | 6 ++++-- wscript | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/surface.c b/src/surface.c index 0578639..d98c498 100644 --- a/src/surface.c +++ b/src/surface.c @@ -453,7 +453,9 @@ image_surface_create_for_data (PyTypeObject *type, PyObject *args) { Py_END_ALLOW_THREADS; o = PycairoSurface_FromSurface(surface, NULL); - ((PycairoSurface *)o)->buffer = buffer; + if (o != NULL) { + ((PycairoSurface *)o)->buffer = buffer; + } return o; } @@ -571,7 +573,7 @@ http://www.python.org/dev/peps/pep-3118/ */ static int image_surface_buffer_getbufferproc (PycairoImageSurface *o, Py_buffer *view, - int flags) { + int flags) { cairo_surface_t *surface = o->surface; int height, stride; void *data; diff --git a/wscript b/wscript index 7a8c75f..3c2b6ed 100644 --- a/wscript +++ b/wscript @@ -9,6 +9,7 @@ d = top APPNAME='pycairo' VERSION='1.10.1' cairo_version_required = '1.10.2' +xpyb_version_required = '1.3' # optional def options(ctx): @@ -27,9 +28,16 @@ def configure(ctx): ctx.check_tool('python') ctx.check_python_version((3,1,0)) ctx.check_python_headers() - ctx.check_cfg(package='cairo', atleast_version=cairo_version_required, + + ctx.check_cfg(package='cairo', + atleast_version=cairo_version_required, args='--cflags --libs') + ctx.check_cfg(package='xpyb', + atleast_version=xpyb_version_required, + args='--cflags --libs', + mandatory=False) + # add gcc options if env['CC_NAME'] == 'gcc': env.append_unique('CCFLAGS', ['-std=c99', '-Wall']) -- cgit v1.2.1