summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/common.gypi14
-rwxr-xr-xbuild/mac/remove_target_headers12
-rwxr-xr-xbuild/mac/tweak_app_infoplist28
-rw-r--r--chrome/chrome.gyp19
4 files changed, 65 insertions, 8 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 3219a26..c64efd7 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -354,6 +354,20 @@
['_mac_bundle', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
}],
+ ['_type=="executable" and _mac_bundle', {
+ 'postbuilds': [
+ {
+ 'variables': {
+ # Define remove_target_headers in a variable ending in _path
+ # so that gyp understands it's a path and performs proper
+ # relativization during dict merging.
+ 'remove_target_headers_path': 'mac/remove_target_headers',
+ },
+ 'postbuild_name': 'Remove Target Headers',
+ 'action': ['<(remove_target_headers_path)'],
+ },
+ ],
+ }],
['_type=="executable"', {
'postbuilds': [
{
diff --git a/build/mac/remove_target_headers b/build/mac/remove_target_headers
new file mode 100755
index 0000000..a7e73ac
--- /dev/null
+++ b/build/mac/remove_target_headers
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Copyright (c) 2009 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.
+
+set -e
+
+find "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}" -iname '*.h' -delete
+find "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}" -iname 'Headers' -type l -delete
+find "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}" -iname 'Headers' -type d -prune \
+ -delete
diff --git a/build/mac/tweak_app_infoplist b/build/mac/tweak_app_infoplist
index 3a1f350..1a2cc8d 100755
--- a/build/mac/tweak_app_infoplist
+++ b/build/mac/tweak_app_infoplist
@@ -7,12 +7,16 @@
set -e
# Pull off the optional args
-INCLUDE_BREAKPAD=0
+USE_BREAKPAD=0
+USE_KEYSTONE=0
OPTERR=0
-while getopts ":b:" an_opt ; do
+while getopts ":b:k:" an_opt ; do
case $an_opt in
b)
- INCLUDE_BREAKPAD=$OPTARG
+ USE_BREAKPAD=$OPTARG
+ ;;
+ k)
+ USE_KEYSTONE=$OPTARG
;;
\?)
echo "Unknown option $OPTARG"
@@ -111,7 +115,7 @@ defaults write "${TMP_INFO_PLIST_DEFAULTS}" \
NSHumanReadableCopyright -string "${COPYRIGHT_STRING}"
# Add/Remove the breakpad keys
-if [ "${INCLUDE_BREAKPAD}" == "1" ] ; then
+if [ "${USE_BREAKPAD}" = "1" ] ; then
defaults write "${TMP_INFO_PLIST_DEFAULTS}" \
BreakpadURL "https://clients2.google.com/cr/report"
defaults write "${TMP_INFO_PLIST_DEFAULTS}" BreakpadReportInterval "3600"
@@ -134,6 +138,22 @@ else
defaults delete "${TMP_INFO_PLIST_DEFAULTS}" BreakpadSkipConfirm || true
fi
+# Add/Remove keystone keys (only supported in release builds)
+if [ "${USE_KEYSTONE}" = "1" ] && [ "${CONFIGURATION}" = "Release" ] ; then
+ KEYSTONE_URL="https://tools.google.com/service/update2"
+ KEYSTONE_APP_ID=$(defaults read "${TMP_INFO_PLIST_DEFAULTS}" \
+ CFBundleIdentifier)
+ defaults write "${TMP_INFO_PLIST_DEFAULTS}" \
+ KSVersion -string "${FULL_VERSION}"
+ defaults write "${TMP_INFO_PLIST_DEFAULTS}" KSProductID "${KEYSTONE_APP_ID}"
+ defaults write "${TMP_INFO_PLIST_DEFAULTS}" KSUpdateURL "${KEYSTONE_URL}"
+else
+ # Make sure the keys aren't there, || true to avoid errors if they aren't.
+ defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSVersion || true
+ defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSProductID || true
+ defaults delete "${TMP_INFO_PLIST_DEFAULTS}" KSUpdateURL || true
+fi
+
# Info.plist will work perfectly well in any plist format, but traditionally
# applications use xml1 for this, so convert it back after whatever defaults
# might have done.
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index cce4985..ef6a616 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -2022,6 +2022,14 @@
}],
],
}], # mac_breakpad
+ ['mac_keystone==1', {
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/<(mac_product_name).app/Contents/Frameworks/',
+ 'files': ['../third_party/googlemac/Releases/Keystone/KeystoneRegistration.framework'],
+ },
+ ],
+ }], # mac_keystone
],
'product_name': '<(mac_product_name)',
'xcode_settings': {
@@ -2062,7 +2070,8 @@
'inputs': [],
'outputs': [],
'action': ['<(DEPTH)/build/mac/tweak_app_infoplist',
- '-b', '<(mac_breakpad)',
+ '-b<(mac_breakpad)',
+ '-k<(mac_keystone)',
'<(branding)'],
},
],
@@ -3024,9 +3033,9 @@
},
],
'conditions': [
- # We set a feature variable so the different parts that need to check for
- # the mac build use of breakpad, check that flag instead of coding it based
- # on branding.
+ # We set feature variables so the different parts that need to check for
+ # the mac build use of breakpad/keystone, check that flag instead of coding
+ # it based on branding.
# We need the Mac app name on disk, so we stick this into a variable so
# the different places that need it can use the common variable.
# NOTE: chrome/app/theme/chromium/BRANDING and
@@ -3036,11 +3045,13 @@
['OS=="mac" and branding=="Chrome"', {
'variables': {
'mac_breakpad%': 1,
+ 'mac_keystone%': 1,
'mac_product_name%': 'Google Chrome',
}
}, {
'variables': {
'mac_breakpad%': 0,
+ 'mac_keystone%': 0,
'mac_product_name%': 'Chromium',
}
}],