blob: a2d2713e1961ecfa321b7d6b34d4f32dc619e3c7 [file] [log] [blame]
# Copyright 2016 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/config/features.gni")
import("//build/config/mac/mac_sdk.gni")
import("//build/util/branding.gni")
import("//build/util/version.gni")
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")
import("mac_signing_sources.gni")
if (is_chrome_branded) {
import("//third_party/widevine/scripts/widevine_signing_sources.gni")
}
group("mac") {
public_deps = [ ":copies" ]
}
_packaging_dir = "$root_out_dir/$chrome_product_full_name Packaging"
process_version_rc_template("sign_config") {
visibility = [ ":copy_signing" ]
process_only = true
template_file = "signing/build_props_config.py.in"
output = "$_packaging_dir/signing/build_props_config.py"
_full_target_name = get_label_info(target_name, "label_no_toolchain")
_file_path = rebase_path(template_file)
_local_chrome_branded = "False"
if (is_chrome_branded) {
_local_chrome_branded = "True"
}
extra_args = [
"-e",
"GEN_HEADER=\"THIS FILE IS AUTOMATICALLY GENERATED BY $_full_target_name.\n# The original copy is at $_file_path.\n\"",
"-e",
"IS_CHROME_BRANDED=$_local_chrome_branded",
]
}
copy("copy_signing") {
visibility = [ ":copies" ]
deps = [ ":sign_config" ]
sources = mac_signing_sources
if (is_chrome_branded) {
sources += [ "internal/internal_config.py" ]
}
outputs = [ "$_packaging_dir/signing/{{source_file_part}}" ]
}
if (is_chrome_branded) {
copy("copy_widevine_signing") {
visibility = [ ":copies" ]
sources = rebase_path(widevine_signing_sources,
"",
"//third_party/widevine/scripts")
outputs = [ "$_packaging_dir/widevine/{{source_file_part}}" ]
}
}
copy("copies") {
visibility = [ ":mac" ]
deps = [
":copy_signing",
"//chrome:entitlements",
"//chrome/installer/mac/third_party/bsdiff:goobsdiff",
"//chrome/installer/mac/third_party/bsdiff:goobspatch",
"//chrome/installer/mac/third_party/xz:lzma_decompress",
"//chrome/installer/mac/third_party/xz:xz",
"//chrome/installer/mac/third_party/xz:xzdec",
]
sources = [
"$root_gen_dir/chrome/app-entitlements.plist",
"$root_out_dir/goobsdiff",
"$root_out_dir/goobspatch",
"$root_out_dir/liblzma_decompress.dylib",
"$root_out_dir/xz",
"$root_out_dir/xzdec",
"//chrome/app/helper-gpu-entitlements.plist",
"//chrome/app/helper-plugin-entitlements.plist",
"//chrome/app/helper-renderer-entitlements.plist",
"dirdiffer.sh",
"dirpatcher.sh",
"dmgdiffer.sh",
"notarize_thing.py",
"pkg-dmg",
"pkg_postinstall.in",
"sign_chrome.py",
"universalizer.py",
]
if (is_chrome_branded) {
deps += [ ":copy_widevine_signing" ]
sources += [
"//chrome/app/theme/google_chrome/mac/app_beta.icns",
"//chrome/app/theme/google_chrome/mac/app_canary.icns",
"//chrome/app/theme/google_chrome/mac/app_dev.icns",
"//chrome/app/theme/google_chrome/mac/document_beta.icns",
"//chrome/app/theme/google_chrome/mac/document_canary.icns",
"//chrome/app/theme/google_chrome/mac/document_dev.icns",
"internal/Google_Chrome.provisionprofile",
"internal/Google_Chrome_Beta.provisionprofile",
"internal/Google_Chrome_Canary.provisionprofile",
"internal/Google_Chrome_Dev.provisionprofile",
"internal/chrome_beta_dmg_dsstore",
"internal/chrome_beta_dmg_icon.icns",
"internal/chrome_canary_dmg_dsstore",
"internal/chrome_canary_dmg_icon.icns",
"internal/chrome_dev_dmg_dsstore",
"internal/chrome_dev_dmg_icon.icns",
"internal/chrome_dmg_background.png",
"internal/chrome_dmg_dsstore",
"internal/chrome_dmg_icon.icns",
"keystone_install.sh",
]
}
outputs = [ "$_packaging_dir/{{source_file_part}}" ]
}
script_test("mac_signing_tests") {
script = "//testing/scripts/run_isolated_script_test.py"
args = [ "@WrappedPath(" + rebase_path(
"//chrome/installer/mac/signing/run_mac_signing_tests.py",
root_build_dir) + ")" ]
data = mac_signing_sources + [
"signing/commands_test.py",
"signing/model_test.py",
"signing/modification_test.py",
"signing/notarize_test.py",
"signing/parts_test.py",
"signing/pipeline_test.py",
"signing/run_mac_signing_tests.py",
"signing/signing_test.py",
"signing/test_common.py",
"signing/test_config.py",
"//third_party/catapult/third_party/typ/",
]
}
config("fat_binary_config") {
visibility = [ "./*" ]
# Always build arm64 targets as universal (fat) binaries, since these need to
# run on both the install machine and the machine where the diff installers
# are created, and the latter is probably not arm64.
if (current_cpu == "arm64") {
fat_binary_flags = [
# Help the compiler find lipo for creating fat binaries.
"-B",
mac_bin_path,
"-arch",
"x86_64",
"-arch",
"arm64",
]
cflags = fat_binary_flags
ldflags = fat_binary_flags
}
}