diff options
author | dpranke <dpranke@chromium.org> | 2015-11-03 17:12:46 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-04 01:14:27 +0000 |
commit | 63e164a242653dbed7932fe9213da828aa280f78 (patch) | |
tree | 2247fddc8bb9a889613c8e344455c886eb863a7b | |
parent | 1028d4b5822ef0db26d626d00e85b6b8233fb41f (diff) | |
download | chromium_src-63e164a242653dbed7932fe9213da828aa280f78.zip chromium_src-63e164a242653dbed7932fe9213da828aa280f78.tar.gz chromium_src-63e164a242653dbed7932fe9213da828aa280f78.tar.bz2 |
port remoting_me2me_host_archive to GN
This CL ports the remoting_me2me_host_archive target to GN and several
of its dependent targets. This is only a partial port of the target, as
the 'remoting_infoplist_strings' target hasn't been ported yet, but I'm
not actually sure if that's needed on Linux.
This CL also fixes the path to the remoting-webapp zip file.
Both of these targets were needed in order to flip the official
Linux x64 build over to GN.
BUG=512899, 530733
Review URL: https://codereview.chromium.org/1426113002
Cr-Commit-Position: refs/heads/master@{#357697}
-rw-r--r-- | build/util/version.gni | 7 | ||||
-rw-r--r-- | remoting/BUILD.gn | 2 | ||||
-rw-r--r-- | remoting/host/BUILD.gn | 183 | ||||
-rw-r--r-- | remoting/host/installer/linux/build_deb.py | 22 | ||||
-rw-r--r-- | remoting/remoting_host.gypi | 4 | ||||
-rw-r--r-- | remoting/remoting_options.gni | 8 | ||||
-rw-r--r-- | remoting/webapp/BUILD.gn | 8 |
7 files changed, 224 insertions, 10 deletions
diff --git a/build/util/version.gni b/build/util/version.gni index d1bf6ef..fba8d25 100644 --- a/build/util/version.gni +++ b/build/util/version.gni @@ -17,11 +17,15 @@ # all values we need at once. _version_dictionary_template = "full = \"@MAJOR@.@MINOR@.@BUILD@.@PATCH@\" " + "major = \"@MAJOR@\" minor = \"@MINOR@\" " + - "build = \"@BUILD@\" patch = \"@PATCH@\"" + "build = \"@BUILD@\" patch = \"@PATCH@\" " + + "remoting = \"@REMOTING_PATCH\" " # The file containing the Chrome version number. chrome_version_file = "//chrome/VERSION" +# The file containing the Chromoting version number. +remoting_version_file = "//remoting/VERSION" + _result = exec_script("version.py", [ "-f", @@ -40,3 +44,4 @@ chrome_version_major = _result.major chrome_version_minor = _result.minor chrome_version_build = _result.build chrome_version_patch = _result.patch +remoting_version_patch = _result.remoting diff --git a/remoting/BUILD.gn b/remoting/BUILD.gn index 832549a..51aa817 100644 --- a/remoting/BUILD.gn +++ b/remoting/BUILD.gn @@ -64,7 +64,7 @@ group("remoting_all") { if (enable_me2me_host) { deps += [ "//remoting/host:remoting_me2me_host", - #"//remoting/host:remoting_me2me_host_archive", + "//remoting/host:remoting_me2me_host_archive", ] } diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn index 124ca2a..8bf1c5e 100644 --- a/remoting/host/BUILD.gn +++ b/remoting/host/BUILD.gn @@ -2,17 +2,24 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/allocator.gni") import("//build/config/features.gni") import("//build/config/ui.gni") +import("//build/util/version.gni") import("//remoting/remoting_host.gni") import("//remoting/remoting_locales.gni") +import("//remoting/remoting_options.gni") import("//remoting/remoting_srcs.gni") import("//remoting/remoting_version.gni") import("//remoting/tools/build/remoting_localize.gni") # GYP version: remoting/remoting_host:remoting_host_credits action("credits") { - about_credits_file = "$target_gen_dir/CREDITS.txt" + # We put this in $root_build_dir/gen/remoting instead of + # $root_build_dir/gen/remoting/host (target_gen_dir) for + # compatibility w/ GYP, since the installer needs the file to + # be at the same location. + about_credits_file = "$root_build_dir/gen/remoting/CREDITS.txt" script = "//tools/licenses.py" inputs = [ @@ -419,6 +426,52 @@ if (is_mac) { # TODO(GYP) Mac build of remoting host. deps += [ "//third_party/libjingle:libjingle_webrtc" ] } } + + action_foreach("remoting_native_messaging_manifests") { + if (is_mac) { + assert(false, "not implemented on mac yet") + } else if (is_win) { + assert(false, "not implemented on win yet") + } else { + me2me_host_path = + "/opt/google/chrome-remote-desktop/native-messaging-host" + it2me_host_path = + "/opt/google/chrome-remote-desktop/remote-assistance-host" + } + + script = "../tools/build/remoting_localize.py" + + sources = [ + "it2me/com.google.chrome.remote_assistance.json.jinja2", + "setup/com.google.chrome.remote_desktop.json.jinja2", + ] + + inputs = [ + branding_path, + ] + + outputs = [ + "$root_build_dir/remoting/{{source_name_part}}", + ] + + args = [ + "--define", + "ME2ME_HOST_PATH=$me2me_host_path", + "--define", + "IT2ME_HOST_PATH=$it2me_host_path", + "--variables", + branding_path, + "--template", + "{{source}}", + "--locale_output", + "remoting/{{source_name_part}}", + "en", + ] + } + + # TODO(crbug.com/512899) This still needs to be ported to GN. + group("remoting_infoplist_strings") { + } } if (enable_me2me_host) { @@ -477,6 +530,134 @@ if (is_mac) { # TODO(GYP) Mac build of remoting host. "//build/config/sanitizers:deps", ] } + + executable("native_messaging_host") { + sources = [ + "setup/me2me_native_messaging_host_entry_point.cc", + "setup/me2me_native_messaging_host_main.cc", + "setup/me2me_native_messaging_host_main.h", + ] + + deps = [ + ":remoting_infoplist_strings", + "//base", + "//remoting/base:breakpad", + "//remoting/host", + "//remoting/host/setup", + "//remoting/host/native_messaging", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + # The |major|, |build| and |patch| versions are inherited from Chrome. + # Since Chrome's |minor| version is always '0', we replace it with a + # Chromoting-specific patch version. + defines = [ "VERSION=" + "$chrome_version_major" + "." + + "$remoting_version_patch" + "." + "$chrome_version_build" + + "." + "$chrome_version_patch" ] + + if (is_linux && use_allocator != "none") { + deps += [ "//base/allocator" ] + } else if (is_mac || is_win) { + assert(false, "not implemented on mac or win yet") + } + } + } + + if (is_chrome_branded && enable_me2me_host && !is_chromeos) { + # TODO(GYP): add support for archive_chromoting_tests variable? + + import("//build/config/zip.gni") + + build_deb_script = "installer/linux/build_deb.py" + deb_filename = + "$root_build_dir/" + exec_script(build_deb_script, + [ + "-p", + "-s", + rebase_path("//"), + ], + "string", + [ "installer/linux/build-deb.sh" ]) + changes_filename = + "$root_build_dir/" + get_path_info(deb_filename, "name") + ".changes" + + packaging_outputs = [ + deb_filename, + changes_filename, + + # TODO(GYP): These files will only be present if we're stripping + # binaries. We need to support linux_dump_symbols for this. + #"$root_build_dir/remoting_me2me_host.debug", + #"$root_build_dir/remoting_start_host.debug", + #"$root_build_dir/native_messaging_host.debug", + #"$root_build_dir/remote_assistance_host.debug", + ] + + zip("remoting_me2me_host_archive") { + # Store the installer package(s) into a zip file so there is a + # consistent filename to reference for build archiving (i.e. in + # FILES.cfg). This also avoids possible conflicts with "wildcard" + # package handling in other build/signing scripts. + inputs = packaging_outputs + output = "$root_build_dir/remoting-me2me-host-linux.zip" + deps = [ + ":remoting_me2me_host_copy", + ] + } + + copy("remoting_me2me_host_copy") { + # Copy the debian package file, which has version info in it, + # to a consistewnt filename for use on Chromoting swarming bots. + sources = [ + deb_filename, + ] + outputs = [ + "$root_build_dir/remoting-me2me-host.deb", + ] + public_deps = [ + ":remoting_me2me_host_deb_installer", + ] + } + + action("remoting_me2me_host_deb_installer") { + script = build_deb_script + inputs = [ + build_deb_script, + "installer/linux/Makefile", + "installer/linux/debian/chrome-remote-desktop.init", + "installer/linux/debian/chrome-remote-desktop.pam", + "installer/linux/debian/compat", + "installer/linux/debian/control", + "installer/linux/debian/copyright", + "installer/linux/debian/postinst", + "installer/linux/debian/preinst", + "installer/linux/debian/rules", + ] + outputs = packaging_outputs + sources = [ + "installer/linux/build-deb.sh", + ] + args = [ + "-s", + rebase_path("//"), + "-o", + rebase_path("$root_build_dir"), + ] + + deps = [ + ":native_messaging_host", + ":remoting_me2me_host", + ":remoting_native_messaging_manifests", + ":remoting_start_host", + "//remoting/host/it2me:remote_assistance_host", + "//remoting/resources", + "//third_party/icu:icudata", + ] + } + } else { + group("remoting_me2me_host_archive") { + } } } } diff --git a/remoting/host/installer/linux/build_deb.py b/remoting/host/installer/linux/build_deb.py new file mode 100644 index 0000000..3be7c42 --- /dev/null +++ b/remoting/host/installer/linux/build_deb.py @@ -0,0 +1,22 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""A simple python wrapper so GN can run build-deb.sh.""" +import os +import subprocess +import sys + + +def main(): + this_dir = os.path.dirname(os.path.abspath(__file__)) + build_deb_script = os.path.join(this_dir, 'build-deb.sh') + proc = subprocess.Popen([build_deb_script] + sys.argv[1:], + stdout=subprocess.PIPE) + out, _ = proc.communicate() + sys.stdout.write(out.strip()) + return proc.returncode + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/remoting/remoting_host.gypi b/remoting/remoting_host.gypi index 27389ee..99794b22 100644 --- a/remoting/remoting_host.gypi +++ b/remoting/remoting_host.gypi @@ -265,6 +265,7 @@ # Generates native messaging manifest files. { + # GN: //remoting/host:remoting_native_messaging_manifests 'target_name': 'remoting_native_messaging_manifests', 'type': 'none', 'conditions': [ @@ -340,6 +341,7 @@ ], }, # end of target 'remoting_start_host' { + # GN: //remoting/host:remoting_infoplist_strings 'target_name': 'remoting_infoplist_strings', 'type': 'none', 'dependencies': [ @@ -552,6 +554,7 @@ ], # end of 'conditions' }, # end of target 'remoting_me2me_host' { + # GN: //remoting/host:native_messaging_host 'target_name': 'remoting_me2me_native_messaging_host', 'type': 'executable', 'product_name': 'native_messaging_host', @@ -644,6 +647,7 @@ ['chromeos==0', { 'targets': [ { + # GN: //remoting/host/it2me:remote_assistance_host 'target_name': 'remoting_it2me_native_messaging_host', 'type': 'executable', 'product_name': 'remote_assistance_host', diff --git a/remoting/remoting_options.gni b/remoting/remoting_options.gni index 2185f21..5f3d5b9 100644 --- a/remoting/remoting_options.gni +++ b/remoting/remoting_options.gni @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/chrome_build.gni") + # These arguments can be overridden from the command line (see "gn help args"). declare_args() { # Set this to run the jscompile checks after building the webapp. @@ -26,7 +28,11 @@ if (is_win) { remoting_rdp_session = 1 -branding_path = "../remoting/branding_<(branding)" +if (is_chrome_branded) { + branding_path = rebase_path("//remoting/branding_Chrome", root_build_dir) +} else { + branding_path = rebase_path("//remoting/branding_Chromium", root_build_dir) +} # The ar_service_environment variable is used to define the target # environment for the app being built. diff --git a/remoting/webapp/BUILD.gn b/remoting/webapp/BUILD.gn index f318ec7..3bc132b 100644 --- a/remoting/webapp/BUILD.gn +++ b/remoting/webapp/BUILD.gn @@ -35,12 +35,8 @@ action("credits") { desktop_remoting_webapp("webapp") { webapp_type = "desktop" output_dir = "$root_build_dir/remoting/remoting-webapp.v2" - zip_path = "$root_build_dir/remoting/remoting-webapp.v2.zip" - extra_files = [ - "crd/remoting_client_pnacl.nmf.jinja2", - # TODO(garykac): Get correct path to this. - #"<(PRODUCT_DIR)/remoting_client_plugin_newlib.pexe", - ] + zip_path = "$root_build_dir/remoting-webapp.v2.zip" + extra_files = [ "crd/remoting_client_pnacl.nmf.jinja2" ] } app_remoting_webapp("ar_sample_app") { |