@@ -50,6 +50,11 @@ def resolve(path, pkgroot):
5050 else :
5151 return path
5252
53+
54+ def join_paths (paths ):
55+ return ["/" .join (ps ) for ps in paths if not None in ps ]
56+
57+
5358symlinks = {}
5459
5560def path_to_label (path , pkgroot , output = None ):
@@ -218,36 +223,36 @@ def hs_library_pattern(name, mode = "static", profiling = False):
218223 name = pkg .name ,
219224 id = pkg .id ,
220225 version = pkg .version ,
221- hdrs = [
222- "/" . join ( [path_to_label (include_dir , pkgroot , output ), header ])
226+ hdrs = join_paths ( [
227+ [path_to_label (include_dir , pkgroot , output ), header ]
223228 for include_dir in pkg .include_dirs
224229 for header in match_glob (resolve (include_dir , pkgroot ), "**/*.h" )
225- ],
226- includes = [
227- "/" . join ( [repo_dir , path_to_label (include_dir , pkgroot , output )])
230+ ]) ,
231+ includes = join_paths ( [
232+ [repo_dir , path_to_label (include_dir , pkgroot , output )]
228233 for include_dir in pkg .include_dirs
229- ],
230- static_libraries = [
231- "/" . join ( [path_to_label (library_dir , pkgroot , output ), library ])
234+ ]) ,
235+ static_libraries = join_paths ( [
236+ [path_to_label (library_dir , pkgroot , output ), library ]
232237 for hs_library in pkg .hs_libraries
233238 for pattern in hs_library_pattern (hs_library , mode = "static" , profiling = False )
234239 for library_dir in pkg .library_dirs
235240 for library in match_glob (resolve (library_dir , pkgroot ), pattern )
236- ],
237- static_profiling_libraries = [
238- "/" . join ( [path_to_label (library_dir , pkgroot , output ), library ])
241+ ]) ,
242+ static_profiling_libraries = join_paths ( [
243+ [path_to_label (library_dir , pkgroot , output ), library ]
239244 for hs_library in pkg .hs_libraries
240245 for pattern in hs_library_pattern (hs_library , mode = "static" , profiling = True )
241246 for library_dir in pkg .library_dirs
242247 for library in match_glob (resolve (library_dir , pkgroot ), pattern )
243- ],
244- shared_libraries = [
245- "/" . join ( [path_to_label (dynamic_library_dir , pkgroot , output ), library ])
248+ ]) ,
249+ shared_libraries = join_paths ( [
250+ [path_to_label (dynamic_library_dir , pkgroot , output ), library ]
246251 for hs_library in pkg .hs_libraries
247252 for pattern in hs_library_pattern (hs_library , mode = "dynamic" , profiling = False )
248253 for dynamic_library_dir in set (pkg .dynamic_library_dirs + pkg .library_dirs )
249254 for library in match_glob (resolve (dynamic_library_dir , pkgroot ), pattern )
250- ],
255+ ]) ,
251256 haddock_html = repr (haddock_html ),
252257 haddock_interfaces = repr (haddock_interfaces ),
253258 deps = pkg .depends ,
0 commit comments