@@ -50,6 +50,11 @@ def resolve(path, pkgroot):
50
50
else :
51
51
return path
52
52
53
+
54
+ def join_paths (paths ):
55
+ return ["/" .join (ps ) for ps in paths if not None in ps ]
56
+
57
+
53
58
symlinks = {}
54
59
55
60
def path_to_label (path , pkgroot , output = None ):
@@ -218,36 +223,36 @@ def hs_library_pattern(name, mode = "static", profiling = False):
218
223
name = pkg .name ,
219
224
id = pkg .id ,
220
225
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 ]
223
228
for include_dir in pkg .include_dirs
224
229
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 )]
228
233
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 ]
232
237
for hs_library in pkg .hs_libraries
233
238
for pattern in hs_library_pattern (hs_library , mode = "static" , profiling = False )
234
239
for library_dir in pkg .library_dirs
235
240
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 ]
239
244
for hs_library in pkg .hs_libraries
240
245
for pattern in hs_library_pattern (hs_library , mode = "static" , profiling = True )
241
246
for library_dir in pkg .library_dirs
242
247
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 ]
246
251
for hs_library in pkg .hs_libraries
247
252
for pattern in hs_library_pattern (hs_library , mode = "dynamic" , profiling = False )
248
253
for dynamic_library_dir in set (pkg .dynamic_library_dirs + pkg .library_dirs )
249
254
for library in match_glob (resolve (dynamic_library_dir , pkgroot ), pattern )
250
- ],
255
+ ]) ,
251
256
haddock_html = repr (haddock_html ),
252
257
haddock_interfaces = repr (haddock_interfaces ),
253
258
deps = pkg .depends ,
0 commit comments