@@ -85,6 +85,16 @@ def copy_file(self, src, dst, preserve_mode=True):
85
85
_patched_copy_file (src , dst , preserve_mode = preserve_mode )
86
86
return (dst , 1 )
87
87
88
+ def build_package_data (self ):
89
+ """Copy data files into build directory"""
90
+ for package , src_dir , build_dir , filenames in self .data_files :
91
+ for filename in filenames :
92
+ target = os .path .join (build_dir , filename )
93
+ self .mkpath (os .path .dirname (target ))
94
+ srcfile = os .path .join (src_dir , filename )
95
+ outf , copied = self .copy_file (srcfile , target )
96
+ srcfile = os .path .abspath (srcfile )
97
+
88
98
89
99
class InstallCmd (_skbuild_install ):
90
100
def run (self ):
@@ -93,13 +103,19 @@ def run(self):
93
103
this_dir = os .path .dirname (os .path .abspath (__file__ ))
94
104
dpctl_build_dir = os .path .join (this_dir , self .build_lib , "dpctl" )
95
105
dpctl_install_dir = os .path .join (self .install_libbase , "dpctl" )
96
- for fn in glob .glob (
97
- os .path .join (dpctl_install_dir , "*DPCTLSyclInterface.so*" )
98
- ):
99
- os .remove (fn )
106
+ sofiles = glob .glob (
107
+ os .path .join (dpctl_build_dir , "*DPCTLSyclInterface.so*" )
108
+ )
109
+ # insert actual file at the beginning of the list
110
+ pos = [i for i , fn in enumerate (sofiles ) if not os .path .islink (fn )]
111
+ if pos :
112
+ hard_file = sofiles .pop (pos [0 ])
113
+ sofiles .insert (0 , hard_file )
114
+ for fn in sofiles :
100
115
base_fn = os .path .basename (fn )
101
116
src_file = os .path .join (dpctl_build_dir , base_fn )
102
117
dst_file = os .path .join (dpctl_install_dir , base_fn )
118
+ os .remove (dst_file )
103
119
_patched_copy_file (src_file , dst_file )
104
120
return ret
105
121
0 commit comments