Skip to content

Commit 55de6d8

Browse files
committed
Added test to link pycairo if needed.
1 parent 427fc78 commit 55de6d8

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

setup.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,25 @@
142142

143143
extra_comp_args = subprocess.check_output([mapnik_config, '--cflags']).rstrip('\n').split(' ')
144144

145+
# Test to build with pycairo (has been moved out of mapnik proper)
146+
include_pycairo = False
147+
if "-DHAVE_CAIRO" in extra_comp_args:
148+
# Mapnik was built with Cairo
149+
try:
150+
from cairo import CAPI
151+
include_pycairo = True
152+
except ImportError:
153+
pass
154+
155+
if include_pycairo:
156+
# Get compiler flags for pycairo (PKG_CONFIG_PATH must be correct)
157+
extra_comp_args.append('-DHAVE_PYCAIRO')
158+
lib = "pycairo"
159+
if sys.version_info[0] > 3:
160+
lib = "py3cairo"
161+
args = subprocess.check_output(["pkg-config","--cflags",lib]).rstrip('\n').split(' ')
162+
extra_comp_args += args
163+
145164
if sys.platform == 'darwin':
146165
extra_comp_args.append('-mmacosx-version-min=10.8')
147166
linkflags.append('-mmacosx-version-min=10.8')
@@ -215,7 +234,7 @@
215234
'mapnik',
216235
'mapnik-wkt',
217236
'mapnik-json',
218-
'boost_thread',
237+
'boost_thread-mt',
219238
'boost_system',
220239
boost_python_lib,
221240
],

0 commit comments

Comments
 (0)