diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-09-12 03:42:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-12 03:42:19 -0400 |
commit | 4c4c2515a244474bc1f6fd95646ba4c5799cde7d (patch) | |
tree | d2de022de1a71bcf0125802ccfd605fb6da36fb7 /python/servo/package_commands.py | |
parent | 8c3b1924661e34923663a184d81366cbc8c3eaff (diff) | |
parent | 3c5c01a109eb5d673fb24a59557b85562635e307 (diff) | |
download | servo-4c4c2515a244474bc1f6fd95646ba4c5799cde7d.tar.gz servo-4c4c2515a244474bc1f6fd95646ba4c5799cde7d.zip |
Auto merge of #21545 - ferjm:windows.nightly.gst.fix, r=Manishearth
Fix Windows nightly build
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21545)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo/package_commands.py')
-rw-r--r-- | python/servo/package_commands.py | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 1e91032dea6..40cf9ddadbb 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -18,6 +18,7 @@ import shutil import subprocess import sys import tempfile +import urllib from mach.decorators import ( CommandArgument, @@ -145,6 +146,20 @@ def copy_windows_dependencies(binary_path, destination): for d in deps: shutil.copy(path.join(binary_path, d), destination) + # Search for the generated nspr4.dll + build_path = path.join(binary_path, "build") + nspr4 = "nspr4.dll" + nspr4_path = None + for root, dirs, files in os.walk(build_path): + if nspr4 in files: + nspr4_path = path.join(root, nspr4) + break + + if nspr4_path is None: + print("WARNING: could not find nspr4.dll") + else: + shutil.copy(nspr4_path, destination) + def change_prefs(resources_path, platform): print("Swapping prefs") @@ -332,7 +347,7 @@ class PackageCommands(CommandBase): import mako.template template_path = path.join(dir_to_root, "support", "windows", "Servo.wxs.mako") template = mako.template.Template(open(template_path).read()) - wxs_path = path.join(dir_to_msi, "Servo.wxs") + wxs_path = path.join(dir_to_msi, "Installer.wxs") open(wxs_path, "w").write(template.render( exe_path=target_dir, dir_to_temp=dir_to_temp_servo, @@ -353,6 +368,34 @@ class PackageCommands(CommandBase): except subprocess.CalledProcessError as e: print("WiX light exited with return value %d" % e.returncode) return e.returncode + print("Packaged Servo into " + path.join(dir_to_msi, "Installer.msi")) + + # Download GStreamer installer. Only once. + dir_to_gst_deps = path.join(dir_to_msi, 'Gstreamer.msi') + gstreamer_msi_path = path.join(target_dir, 'Gstreamer.msi') + if not os.path.exists(gstreamer_msi_path): + print('Fetching GStreamer installer. This may take a while...') + gstreamer_url = 'https://gstreamer.freedesktop.org/data/pkg/windows/1.14.2/gstreamer-1.0-x86-1.14.2.msi' + urllib.urlretrieve(gstreamer_url, gstreamer_msi_path) + shutil.copy(gstreamer_msi_path, dir_to_gst_deps) + + # Generate bundle with GStreamer and Servo installers. + print("Creating bundle") + shutil.copy(path.join(dir_to_root, 'support', 'windows', 'Servo.wxs'), dir_to_msi) + bundle_wxs_path = path.join(dir_to_msi, 'Servo.wxs') + try: + with cd(dir_to_msi): + subprocess.check_call(['candle', bundle_wxs_path, '-ext', 'WixBalExtension']) + except subprocess.CalledProcessError as e: + print("WiX candle exited with return value %d" % e.returncode) + return e.returncode + try: + wxsobj_path = "{}.wixobj".format(path.splitext(bundle_wxs_path)[0]) + with cd(dir_to_msi): + subprocess.check_call(['light', wxsobj_path, '-ext', 'WixBalExtension']) + except subprocess.CalledProcessError as e: + print("WiX light exited with return value %d" % e.returncode) + return e.returncode print("Packaged Servo into " + path.join(dir_to_msi, "Servo.msi")) print("Creating ZIP") |