summaryrefslogtreecommitdiff
blob: c136cb0c39a1def2faefeffad43f9e636eb613a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- py2cairo-1.10.0/wscript
+++ py2cairo-1.10.0/wscript
@@ -10,6 +10,7 @@
 APPNAME='py2cairo'
 VERSION='1.10.0'
 cairo_version_required = '1.10.0'
+xpyb_version_required  = '1.3'
 
 
 def check_svg():
@@ -23,6 +24,17 @@
     return False
 
 
+def check_xpyb():
+  if os.environ.get('PYCAIRO_DISABLE_XPYB', None) is None:
+    return_code = subprocess.call(['pkg-config', '--exists', 'xpyb'])
+    if return_code == 0:
+      return True
+    else:
+      return False
+  else:
+    return False
+
+
 def options(ctx):
   print('  %s/options()' %d)
   ctx.tool_options('gnu_dirs')
@@ -41,6 +53,9 @@
   ctx.check_python_headers()
   ctx.check_cfg(package='cairo', atleast_version=cairo_version_required,
                  args='--cflags --libs')
+  if check_xpyb():
+    ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required,
+                  args='--cflags --libs', mandatory=False)
 
   # add gcc options
   if env['CC_NAME'] == 'gcc':