blob: f6395606f720765e086b82cee8985dfc0201258e [file] [log] [blame]
# Copyright 2019 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.
import("//build/apple/tweak_info_plist.gni")
import("//build/config/mac/rules.gni")
import("//build/config/python.gni")
import("//build/util/version.gni")
import("//chrome/updater/branding.gni")
group("mac") {
deps = [
":browser_install_script",
":privileged_helper",
":updater_bundle",
":updater_bundle_test",
":updater_install_script",
"//chrome/updater/mac/signing",
]
}
tweak_info_plist("updater_plist") {
info_plist = "Info.plist"
}
mac_app_bundle("updater_bundle") {
info_plist_target = ":updater_plist"
output_name = updater_product_full_name
extra_substitutions =
[ "MAC_BUNDLE_IDENTIFIER=$mac_updater_bundle_identifier" ]
sources = [ "main.cc" ]
deps = [
":keystone_agent_bundle_resource_executable",
":keystone_agent_bundle_resource_plist",
":updater_bundle_keystone_executable",
":updater_bundle_keystone_helpers",
":updater_bundle_keystone_plist",
"//chrome/updater:base",
"//chrome/updater:constants_prod",
]
}
mac_app_bundle("updater_bundle_test") {
info_plist_target = ":updater_plist"
output_name = updater_product_full_name + "_test"
extra_substitutions =
[ "MAC_BUNDLE_IDENTIFIER=$mac_updater_bundle_identifier" ]
sources = [ "main.cc" ]
deps = [
":keystone_agent_bundle_resource_executable",
":keystone_agent_bundle_resource_plist",
":updater_bundle_keystone_executable",
":updater_bundle_keystone_helpers",
":updater_bundle_keystone_plist",
"//chrome/updater:base",
"//chrome/updater:constants_test",
]
}
source_set("privileged_helper_sources") {
sources = [
"privileged_helper/server.h",
"privileged_helper/server.mm",
"privileged_helper/service.h",
"privileged_helper/service.mm",
"privileged_helper/service_protocol.h",
]
deps = [
"//base",
"//chrome/updater:base",
"//chrome/updater:branding_header",
"//chrome/updater:constants_prod",
]
}
executable("privileged_helper") {
output_name = privileged_helper_name
sources = [ "privileged_helper/main.mm" ]
deps = [
":privileged_helper_sources",
"//base",
]
frameworks = [ "Foundation.framework" ]
inputs = [ "privileged_helper/Info.plist" ]
ldflags = [
"-sectcreate",
"__TEXT",
"__info_plist",
rebase_path(inputs[0], root_build_dir),
]
}
action("updater_install_script") {
script = "embed_variables.py"
inputs = [
script,
"setup/.install.sh",
]
outputs = [ "$root_out_dir/chrome/updater/.install" ]
args = [
"-i",
rebase_path("setup/.install.sh"),
"-o",
rebase_path(root_out_dir + "/chrome/updater/.install"),
"-p",
updater_product_full_name,
]
}
action("browser_install_script") {
script = "embed_variables.py"
inputs = [
script,
".install.sh",
]
outputs = [ "$root_out_dir/$browser_product_name Packaging/updater/.install" ]
args = [
"-i",
rebase_path(".install.sh"),
"-o",
rebase_path(
root_out_dir + "/$browser_product_name Packaging/updater/.install"),
"-v",
chrome_version_full,
]
}
source_set("ksadmin_lib") {
sources = [
"keystone/ksadmin.h",
"keystone/ksadmin.mm",
]
deps = [
"//base",
"//chrome/updater:base",
"//chrome/updater:version_header",
]
visibility = [
":ksadmin",
"//chrome/updater:updater_test_sources",
]
}
executable("ksadmin") {
output_name = "ksadmin"
sources = [ "keystone/ksadmin_main.cc" ]
public_deps = [ ":ksadmin_lib" ]
deps = [
"//base",
"//chrome/updater:constants_prod",
]
frameworks = [ "CoreFoundation.framework" ]
if (is_asan) {
# asan injects a dylib that we package in ../MacOS.
ldflags = [ "-Wl,-rpath,@executable_path/../MacOS" ]
}
}
executable("ksinstall") {
output_name = "ksinstall"
sources = [
"keystone/ksinstall.h",
"keystone/ksinstall.mm",
"keystone/ksinstall_main.cc",
]
deps = [
"//base",
"//chrome/updater:base",
"//chrome/updater:constants_prod",
"//chrome/updater:version_header",
]
frameworks = [ "CoreFoundation.framework" ]
if (is_asan) {
# asan injects a dylib that we package in ../MacOS.
ldflags = [ "-Wl,-rpath,@executable_path/../MacOS" ]
}
}
bundle_data("keystone_helpers") {
sources = [
"$root_out_dir/ksadmin",
"$root_out_dir/ksinstall",
]
outputs = [ "{{bundle_contents_dir}}/Helpers/{{source_file_part}}" ]
public_deps = [
":ksadmin",
":ksinstall",
]
}
mac_app_bundle("keystone_agent_bundle") {
info_plist = "keystone/Info.plist"
sources = [ "keystone/agent_main.cc" ]
output_name = keystone_app_name + "Agent"
extra_substitutions = [
"MAC_BUNDLE_IDENTIFIER=${keystone_app_name}Agent",
"PACKAGE_TYPE=APPL",
]
}
bundle_data("keystone_agent_bundle_resource_executable") {
sources = [ "$root_out_dir/${keystone_app_name}Agent.app/Contents/MacOS/${keystone_app_name}Agent" ]
outputs = [ "{{bundle_contents_dir}}/Helpers/$keystone_app_name.bundle/Contents/Resources/${keystone_app_name}Agent.app/Contents/MacOS/{{source_file_part}}" ]
public_deps = [ ":keystone_agent_bundle" ]
}
bundle_data("keystone_agent_bundle_resource_plist") {
sources =
[ "$root_out_dir/${keystone_app_name}Agent.app/Contents/Info.plist" ]
outputs = [ "{{bundle_contents_dir}}/Helpers/$keystone_app_name.bundle/Contents/Resources/${keystone_app_name}Agent.app/Contents/MacOS/{{source_file_part}}" ]
public_deps = [ ":keystone_agent_bundle" ]
}
mac_app_bundle("keystone_bundle") {
info_plist = "keystone/Info.plist"
sources = [ "keystone/keystone_main.cc" ]
output_name = keystone_app_name
package_type = "bundle"
extra_substitutions = [
"MAC_BUNDLE_IDENTIFIER=$keystone_app_name",
"PACKAGE_TYPE=BNDL",
]
public_deps = [ ":keystone_helpers" ]
}
bundle_data("updater_bundle_keystone_executable") {
sources = [
"$root_out_dir/$keystone_app_name.bundle/Contents/MacOS/$keystone_app_name",
]
outputs = [ "{{bundle_contents_dir}}/Helpers/$keystone_app_name.bundle/Contents/MacOS/{{source_file_part}}" ]
public_deps = [ ":keystone_bundle" ]
}
bundle_data("updater_bundle_keystone_plist") {
sources = [ "$root_out_dir/$keystone_app_name.bundle/Contents/Info.plist" ]
outputs = [ "{{bundle_contents_dir}}/Helpers/$keystone_app_name.bundle/Contents/{{source_file_part}}" ]
public_deps = [ ":keystone_bundle" ]
}
bundle_data("updater_bundle_keystone_helpers") {
sources = [
"$root_out_dir/$keystone_app_name.bundle/Contents/Helpers/ksadmin",
"$root_out_dir/$keystone_app_name.bundle/Contents/Helpers/ksinstall",
]
outputs = [ "{{bundle_contents_dir}}/Helpers/$keystone_app_name.bundle/Contents/Helpers/{{source_file_part}}" ]
public_deps = [ ":keystone_bundle" ]
}