@@ -107,30 +107,23 @@ def run(self):
107
107
if os .environ .get ("MASON_BUILD" , "false" ) == "true" :
108
108
# run bootstrap.sh to get mason builds
109
109
subprocess .call (['./bootstrap.sh' ])
110
- mapnik_config = 'mason_packages/.link/bin/mapnik-config'
111
110
mason_build = True
112
111
else :
113
- mapnik_config = 'mapnik-config'
114
112
mason_build = False
115
113
116
114
117
115
linkflags = []
118
- lib_path = os .path .join (check_output ([mapnik_config , '--prefix' ]),'lib' )
119
- linkflags .extend (check_output ([mapnik_config , '--libs' ]).split (' ' ))
120
- linkflags .extend (check_output ([mapnik_config , '--ldflags' ]).split (' ' ))
121
- linkflags .extend (check_output ([mapnik_config , '--dep-libs' ]).split (' ' ))
122
- linkflags .extend ([
123
- '-lmapnik-wkt' ,
124
- '-lmapnik-json' ,
125
- ] + ['-l%s' % i for i in get_boost_library_names ()])
116
+ lib_path = os .path .join (check_output (['pkg-config' , '--variable=prefix' , 'libmapnik' ]),'lib' )
117
+ linkflags .extend (check_output (['pkg-config' , '--libs' , 'libmapnik' ]).split (' ' ))
118
+ linkflags .extend (['-l%s' % i for i in get_boost_library_names ()])
126
119
127
120
# Dynamically make the mapnik/paths.py file
128
121
f_paths = open ('mapnik/paths.py' , 'w' )
129
122
f_paths .write ('import os\n ' )
130
123
f_paths .write ('\n ' )
131
124
132
- input_plugin_path = check_output ([mapnik_config , '--input-plugins ' ])
133
- font_path = check_output ([mapnik_config , '--fonts ' ])
125
+ input_plugin_path = check_output (['pkg-config' , '--variable=plugins_dir' , 'libmapnik ' ])
126
+ font_path = check_output (['pkg-config' , '--variable=fonts_dir' , 'libmapnik ' ])
134
127
135
128
if mason_build :
136
129
try :
@@ -225,7 +218,7 @@ def run(self):
225
218
except shutil .Error :
226
219
pass
227
220
228
- extra_comp_args = check_output ([mapnik_config , '--cflags' ]).split (' ' )
221
+ extra_comp_args = check_output (['pkg-config' , '--cflags' , 'libmapnik ' ]).split (' ' )
229
222
230
223
extra_comp_args = list (filter (lambda arg : arg != "-fvisibility=hidden" , extra_comp_args ))
231
224
@@ -253,9 +246,12 @@ def run(self):
253
246
linkflags .append ('-Wl,-rpath=$ORIGIN/lib' )
254
247
255
248
if os .environ .get ("CC" , False ) == False :
256
- os .environ ["CC" ] = check_output ([ mapnik_config , '--cxx' ])
249
+ os .environ ["CC" ] = 'c++'
257
250
if os .environ .get ("CXX" , False ) == False :
258
- os .environ ["CXX" ] = check_output ([mapnik_config , '--cxx' ])
251
+ os .environ ["CXX" ] = 'c++'
252
+
253
+ extra_comp_args = list (filter (lambda arg : arg != "" , extra_comp_args ))
254
+ linkflags = list (filter (lambda arg : arg != "" , linkflags ))
259
255
260
256
setup (
261
257
name = "mapnik" ,
0 commit comments