1
+ # mypy: ignore-errors
2
+ # pylint: skip-file
3
+
1
4
import os
2
5
import os .path
3
6
import shutil
@@ -72,7 +75,7 @@ class VtdConan(ConanFile):
72
75
options = {
73
76
"with_osi" : [True , False ],
74
77
"with_road_designer" : [True , False ],
75
- "with_image_generator" : [True , False ],
78
+ "with_image_generator" : [True , False ],
76
79
}
77
80
default_options = {
78
81
"with_osi" : True ,
@@ -95,7 +98,8 @@ def export_sources(self):
95
98
96
99
def configure (self ):
97
100
if self .settings .os == "Windows" :
98
- raise ConanInvalidConfiguration ("VTD binaries do not exist for Windows" )
101
+ raise ConanInvalidConfiguration (
102
+ "VTD binaries do not exist for Windows" )
99
103
100
104
def build (self ):
101
105
src = Path (self .source_folder )
@@ -106,7 +110,7 @@ def build(self):
106
110
def extract_archive (archive ):
107
111
print (f"Extracting: { archive } " )
108
112
tools .untargz (src / archive , dst )
109
-
113
+
110
114
extract_archive (self ._archive_base )
111
115
libdir .mkdir ()
112
116
if self .options .with_osi :
@@ -118,73 +122,61 @@ def extract_archive(archive):
118
122
shutil .rmtree (path )
119
123
Path (vtddir / "Runtime/Core/ImageGenerator" ).unlink ()
120
124
remove_broken_symlinks ()
121
-
125
+
122
126
# Patch RPATH of several critical binaries.
123
127
patch_rpath (
124
128
vtddir / "Runtime/Core/ModuleManager/moduleManager.2022.3.40_flexlm" ,
125
129
["$ORIGIN/../Lib" , "$ORIGIN/lib" ],
126
130
)
127
-
128
131
patch_rpath (
129
132
vtddir / "Runtime/Core/ModuleManager/lib/libVTDModulePlugin.so.2022" ,
130
133
["$ORIGIN/../../Lib" ]
131
134
)
132
-
133
135
patch_rpath (
134
136
vtddir / "Runtime/Core/ModuleManager/lib/libprotobuf.so.9" ,
135
137
["$ORIGIN/../../Lib" ]
136
138
)
137
-
138
139
patch_rpath (
139
140
vtddir / "Runtime/Core/ModuleManager/lib/libopen_simulation_interface.so" ,
140
141
["$ORIGIN/../../Lib" , "$ORIGIN" ],
141
142
)
142
-
143
143
patch_rpath (
144
144
vtddir / "Runtime/Core/ModuleManager.cxx98/moduleManager.2022.3.40_flexlm" ,
145
145
["$ORIGIN/../Lib" , "$ORIGIN/lib" ],
146
146
)
147
-
148
147
patch_rpath (
149
148
vtddir / "Runtime/Core/ModuleManager.cxx98/lib/libopen_simulation_interface.so" ,
150
149
["$ORIGIN/../../Lib" , "$ORIGIN" ],
151
150
)
152
-
153
151
patch_rpath (
154
152
vtddir / "Runtime/Core/ModuleManager.cxx98/lib/libprotobuf.so.9" ,
155
153
["$ORIGIN/../../Lib" ],
156
154
)
157
-
158
155
patch_rpath (
159
156
vtddir / "Runtime/Core/ModuleManager.cxx98/lib/libVTDModulePlugin.so" ,
160
157
["$ORIGIN/../../Lib" ],
161
158
)
162
-
163
159
patch_rpath (
164
160
vtddir / "Runtime/Core/ModuleManager.cxx11/moduleManager.2022.3.40_flexlm" ,
165
161
["$ORIGIN/../Lib" , "$ORIGIN/lib" ],
166
162
)
167
-
168
-
169
163
patch_rpath (
170
164
vtddir / "Runtime/Core/ModuleManager.cxx11/lib/libVTDModulePlugin.so.2022" ,
171
165
["$ORIGIN/../../Lib" ],
172
166
)
173
-
174
167
patch_rpath (
175
168
vtddir / "Runtime/Core/ModuleManager.cxx11/lib/libopen_simulation_interface.so" ,
176
169
["$ORIGIN/../../Lib" , "$ORIGIN" ],
177
170
)
178
-
179
171
patch_rpath (
180
172
vtddir / "Runtime/Core/ModuleManager.cxx11/lib/libprotobuf.so.9" ,
181
173
["$ORIGIN/../../Lib" ],
182
174
)
183
-
184
175
patch_rpath (
185
- vtddir / "Runtime/Core/ParamServer/paramServer.2022.3.40" , ["$ORIGIN/../Lib" ]
176
+ vtddir /
177
+ "Runtime/Core/ParamServer/paramServer.2022.3.40" , [
178
+ "$ORIGIN/../Lib" ]
186
179
)
187
-
188
180
patch_rpath (
189
181
vtddir / "Runtime/Core/Traffic/ghostdriver.2022.3.40_flexlm" ,
190
182
["$ORIGIN/../Lib" ],
@@ -194,7 +186,8 @@ def extract_archive(archive):
194
186
for file in find_binary_files ():
195
187
try :
196
188
patch_rpath (
197
- file , [f"$ORIGIN/{ os .path .relpath (libdir , (dst / file ).parent )} " ]
189
+ file , [
190
+ f"$ORIGIN/{ os .path .relpath (libdir , (dst / file ).parent )} " ]
198
191
)
199
192
except :
200
193
# Not all files can be set, but even if this happens it doesn't appear
0 commit comments