diff --git a/wscript b/wscript index cb55348..206922e 100644 --- a/wscript +++ b/wscript @@ -1,6 +1,7 @@ # -*- python -*- import os +import subprocess top = '.' out = 'build_directory' @@ -33,12 +34,19 @@ def configure(ctx): atleast_version=cairo_version_required, args='--cflags --libs') -# xpyb for Python 3 is not available yet. -# the Python 3 version should probably have a different name than 'xpyb' -# ctx.check_cfg(package='xpyb', -# atleast_version=xpyb_version_required, -# args='--cflags --libs', -# mandatory=False) + try: + p = subprocess.Popen([ctx.env['PYTHON'][0], '-c', 'import xcb'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p.wait() + p.stdout.close() + p.stderr.close() + except OSError: + pass + else: + if p.returncode == 0: + ctx.check_cfg(package='xpyb', + atleast_version=xpyb_version_required, + args='--cflags --libs', + mandatory=False) # add gcc options if env['CC_NAME'] == 'gcc':