@@ -106,6 +106,32 @@ def copy_dependencies(binary_path, lib_path):
106
106
need_checked .difference_update (checked )
107
107
108
108
109
+ def copy_windows_dependencies (binary_path , destination ):
110
+ try :
111
+ [shutil .copy (path .join (binary_path , d ), destination ) for d in ["libeay32md.dll" , "ssleay32md.dll" ]]
112
+ except :
113
+ deps = [
114
+ "libstdc++-6.dll" ,
115
+ "libwinpthread-1.dll" ,
116
+ "libbz2-1.dll" ,
117
+ "libgcc_s_seh-1.dll" ,
118
+ "libexpat-1.dll" ,
119
+ "zlib1.dll" ,
120
+ "libpng16-16.dll" ,
121
+ "libiconv-2.dll" ,
122
+ "libglib-2.0-0.dll" ,
123
+ "libgraphite2.dll" ,
124
+ "libfreetype-6.dll" ,
125
+ "libfontconfig-1.dll" ,
126
+ "libintl-8.dll" ,
127
+ "libpcre-1.dll" ,
128
+ "libeay32.dll" ,
129
+ "ssleay32.dll" ,
130
+ "libharfbuzz-0.dll" ,
131
+ ]
132
+ [shutil .copy (path .join ("C:\\ msys64\\ mingw64\\ bin" , d ), path .join (destination , d )) for d in deps ]
133
+
134
+
109
135
def change_prefs (resources_path , platform ):
110
136
print ("Swapping prefs" )
111
137
prefs_path = path .join (resources_path , "prefs.json" )
@@ -264,8 +290,14 @@ def package(self, release=False, dev=False, android=None, debug=False, debugger=
264
290
browserhtml_path = get_browserhtml_path (binary_path )
265
291
266
292
print ("Copying files" )
267
- dir_to_resources = path .join (dir_to_msi , 'resources' )
293
+ dir_to_temp = path .join (dir_to_msi , 'temp' )
294
+ dir_to_temp_servo = path .join (dir_to_temp , 'servo' )
295
+ dir_to_resources = path .join (dir_to_temp_servo , 'resources' )
268
296
shutil .copytree (path .join (dir_to_root , 'resources' ), dir_to_resources )
297
+ shutil .copytree (browserhtml_path , path .join (dir_to_temp_servo , 'browserhtml' ))
298
+ shutil .copy (binary_path , dir_to_temp_servo )
299
+ shutil .copy ("{}.manifest" .format (binary_path ), dir_to_temp_servo )
300
+ copy_windows_dependencies (target_dir , dir_to_temp_servo )
269
301
270
302
change_prefs (dir_to_resources , "windows" )
271
303
@@ -275,8 +307,8 @@ def package(self, release=False, dev=False, android=None, debug=False, debugger=
275
307
wxs_path = path .join (dir_to_msi , "Servo.wxs" )
276
308
open (wxs_path , "w" ).write (template .render (
277
309
exe_path = target_dir ,
278
- resources_path = dir_to_resources ,
279
- browserhtml_path = browserhtml_path ))
310
+ dir_to_temp = dir_to_temp_servo ,
311
+ resources_path = dir_to_resources ))
280
312
281
313
# run candle and light
282
314
print ("Creating MSI" )
@@ -293,8 +325,14 @@ def package(self, release=False, dev=False, android=None, debug=False, debugger=
293
325
except subprocess .CalledProcessError as e :
294
326
print ("WiX light exited with return value %d" % e .returncode )
295
327
return e .returncode
296
- msi_path = path .join (dir_to_msi , "Servo.msi" )
297
- print ("Packaged Servo into {}" .format (msi_path ))
328
+ print ("Packaged Servo into " + path .join (dir_to_msi , "Servo.msi" ))
329
+
330
+ print ("Creating ZIP" )
331
+ shutil .make_archive (path .join (dir_to_msi , "Servo" ), "zip" , dir_to_temp )
332
+ print ("Packaged Servo into " + path .join (dir_to_msi , "Servo.zip" ))
333
+
334
+ print ("Cleaning up" )
335
+ delete (dir_to_temp )
298
336
else :
299
337
dir_to_temp = path .join (target_dir , 'packaging-temp' )
300
338
browserhtml_path = get_browserhtml_path (binary_path )
0 commit comments