From c3ed1d11c0bbea22d855f5bd8066eb0d9cacf392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Mon, 3 Sep 2018 11:31:34 +0200 Subject: Create bundle with GStreamer and Servo installers --- python/servo/package_commands.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'python/servo/package_commands.py') diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 9a3c8f62d63..cbbd22596c5 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, @@ -330,7 +331,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, @@ -351,6 +352,35 @@ 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 os.path.exists(gstreamer_msi_path): + shutil.copy(gstreamer_msi_path, dir_to_gst_deps) + else: + print('Fetching GStreamer installer. This may take a while...') + urllib.urlretrieve('https://gstreamer.freedesktop.org/data/pkg/windows/1.14.2/gstreamer-1.0-x86-1.14.2.msi', gstreamer_msi_path) + + # 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') + dir_to_bundle_msi = path.join(dir_to_msi, 'Servo.msi') + 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") -- cgit v1.2.3 From a56dc489d5d6f8e04d9606ca45c4f71d810b3caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Tue, 11 Sep 2018 17:44:10 +0200 Subject: Package generated nspr4.dll --- python/servo/package_commands.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'python/servo/package_commands.py') diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index cbbd22596c5..b9cd1f1d501 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -146,6 +146,19 @@ 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") -- cgit v1.2.3 From 84160613413aa3f9bfc447d4c0e61e7b846b9392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Tue, 11 Sep 2018 17:51:46 +0200 Subject: Make tidy happy --- python/servo/package_commands.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'python/servo/package_commands.py') diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index b9cd1f1d501..020a0492cd1 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -160,6 +160,7 @@ def copy_windows_dependencies(binary_path, destination): else: shutil.copy(nspr4_path, destination) + def change_prefs(resources_path, platform): print("Swapping prefs") prefs_path = path.join(resources_path, "prefs.json") @@ -368,19 +369,19 @@ class PackageCommands(CommandBase): 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'); + dir_to_gst_deps = path.join(dir_to_msi, 'Gstreamer.msi') + gstreamer_msi_path = path.join(target_dir, 'Gstreamer.msi') if os.path.exists(gstreamer_msi_path): shutil.copy(gstreamer_msi_path, dir_to_gst_deps) else: print('Fetching GStreamer installer. This may take a while...') - urllib.urlretrieve('https://gstreamer.freedesktop.org/data/pkg/windows/1.14.2/gstreamer-1.0-x86-1.14.2.msi', gstreamer_msi_path) + 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) # 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') - dir_to_bundle_msi = path.join(dir_to_msi, 'Servo.msi') try: with cd(dir_to_msi): subprocess.check_call(['candle', bundle_wxs_path, '-ext', 'WixBalExtension']) -- cgit v1.2.3 From 3c5c01a109eb5d673fb24a59557b85562635e307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Wed, 12 Sep 2018 07:18:52 +0200 Subject: Move gstreamer msi to msi folder after download --- python/servo/package_commands.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'python/servo/package_commands.py') diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 020a0492cd1..093b634766d 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -371,12 +371,11 @@ class PackageCommands(CommandBase): # 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 os.path.exists(gstreamer_msi_path): - shutil.copy(gstreamer_msi_path, dir_to_gst_deps) - else: + 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") -- cgit v1.2.3