summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-21 19:38:40 -0700
committerGary E. Miller <gem@rellim.com>2018-09-21 19:38:40 -0700
commit0e58206bf0993c6c6d901ac85683cbf0073989ba (patch)
treeed3f3d9fa1f2bf1fa91d00e6ffa400c1a0778061 /SConstruct
parente6d209947d200e835cc8e94cf9273bc0f0b5c462 (diff)
downloadgpsd-0e58206bf0993c6c6d901ac85683cbf0073989ba.tar.gz
SConstruct: do not build xgps and xgpsspeed if pycairo not found.
Used to not be a problem, but now 'scons check' tests the python programs, and those two fail without pycairo.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct11
1 files changed, 11 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index df3c48a6..f500bd8a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -34,6 +34,7 @@ from __future__ import print_function
import ast
import copy
import glob
+import imp # for imp.find_module('gps'), imp deprecated in 3.4
import operator
import os
import platform
@@ -1364,6 +1365,16 @@ if not env['python']:
python_progs = []
else:
python_progs = ["gegps", "gpscat", "gpsfake", "gpsprof"]
+
+ # check for pycairo
+ try:
+ imp.find_module('cairo')
+ except ImportError:
+ # no pycairo, can't build xgps, xgpsspeed
+ announce("Python module pycairo not found, "
+ "xgps and xgpsspeed will not be installed")
+ env['xgps'] = False
+
if env['xgps']:
python_progs.extend(["xgps", "xgpsspeed"])
python_modules = Glob('gps/*.py')