Home | History | Annotate | Download | only in chrome
      1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 {
      6   'variables': {
      7     'lastchange_path': '../build/util/LASTCHANGE',
      8     'libpeer_target_type%': 'static_library',
      9     # 'branding_dir' is set in the 'conditions' section at the bottom.
     10   },
     11   'conditions': [
     12     ['OS=="win"', {
     13       'targets': [
     14         {
     15           'target_name': 'gcapi_dll',
     16           'type': 'loadable_module',
     17           'dependencies': [
     18             'gcapi_lib',
     19           ],
     20           'include_dirs': [
     21             '..',
     22           ],
     23           'sources': [
     24             'installer/gcapi/gcapi.def',
     25             'installer/gcapi/gcapi_dll.cc',
     26           ],
     27         },
     28         {
     29           'target_name': 'gcapi_lib',
     30           'type': 'static_library',
     31           'dependencies': [
     32             'installer_util',
     33             '../base/base.gyp:base',
     34             '../chrome/chrome.gyp:launcher_support',
     35             '../google_update/google_update.gyp:google_update',
     36           ],
     37           'include_dirs': [
     38             '..',
     39           ],
     40           'sources': [
     41             'installer/gcapi/gcapi.cc',
     42             'installer/gcapi/gcapi.h',
     43             'installer/gcapi/gcapi_omaha_experiment.cc',
     44             'installer/gcapi/gcapi_omaha_experiment.h',
     45             'installer/gcapi/gcapi_reactivation.cc',
     46             'installer/gcapi/gcapi_reactivation.h',
     47           ],
     48           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
     49           'msvs_disabled_warnings': [ 4267, ],
     50         },
     51         {
     52           'target_name': 'gcapi_test',
     53           'type': 'executable',
     54           'dependencies': [
     55             'common',
     56             'gcapi_dll',
     57             'gcapi_lib',
     58             'installer_util',
     59             '../base/base.gyp:base',
     60             '../base/base.gyp:test_support_base',
     61             '../testing/gtest.gyp:gtest',
     62           ],
     63           'include_dirs': [
     64             '..',
     65           ],
     66           'sources': [
     67             'installer/gcapi/gcapi_last_run_test.cc',
     68             'installer/gcapi/gcapi_omaha_experiment_test.cc',
     69             'installer/gcapi/gcapi_reactivation_test.cc',
     70             'installer/gcapi/gcapi_test_registry_overrider.cc',
     71             'installer/gcapi/gcapi_test_registry_overrider.h',
     72             'installer/gcapi/gcapi_test.cc',
     73             'installer/gcapi/gcapi_test.rc',
     74             'installer/gcapi/resource.h',
     75           ],
     76         },
     77         {
     78           'target_name': 'installer_util_unittests',
     79           'type': 'executable',
     80           'dependencies': [
     81             'installer_util',
     82             'installer_util_strings',
     83             'installer/upgrade_test.gyp:alternate_version_generator_lib',
     84             '../base/base.gyp:base',
     85             '../base/base.gyp:base_i18n',
     86             '../base/base.gyp:test_support_base',
     87             '../chrome/chrome.gyp:chrome_version_resources',
     88             '../content/content.gyp:content_common',
     89             '../testing/gmock.gyp:gmock',
     90             '../testing/gtest.gyp:gtest',
     91           ],
     92           'include_dirs': [
     93             '..',
     94           ],
     95           'sources': [
     96             'installer/setup/compat_checks_unittest.cc',
     97             'installer/setup/setup_constants.cc',
     98             'installer/util/callback_work_item_unittest.cc',
     99             'installer/util/channel_info_unittest.cc',
    100             'installer/util/copy_reg_key_work_item_unittest.cc',
    101             'installer/util/copy_tree_work_item_unittest.cc',
    102             'installer/util/create_dir_work_item_unittest.cc',
    103             'installer/util/create_reg_key_work_item_unittest.cc',
    104             'installer/util/delete_after_reboot_helper_unittest.cc',
    105             'installer/util/delete_reg_key_work_item_unittest.cc',
    106             'installer/util/delete_reg_value_work_item_unittest.cc',
    107             'installer/util/delete_tree_work_item_unittest.cc',
    108             'installer/util/duplicate_tree_detector_unittest.cc',
    109             'installer/util/fake_installation_state.h',
    110             'installer/util/fake_product_state.h',
    111             'installer/util/google_update_settings_unittest.cc',
    112             'installer/util/install_util_unittest.cc',
    113             'installer/util/installation_validation_helper.cc',
    114             'installer/util/installation_validation_helper.h',
    115             'installer/util/installation_validator_unittest.cc',
    116             'installer/util/installer_state_unittest.cc',
    117             'installer/util/installer_util_test_common.cc',
    118             'installer/util/installer_util_test_common.h',
    119             'installer/util/installer_util_unittests.rc',
    120             'installer/util/installer_util_unittests_resource.h',
    121             'installer/util/language_selector_unittest.cc',
    122             'installer/util/logging_installer_unittest.cc',
    123             'installer/util/lzma_util_unittest.cc',
    124             'installer/util/master_preferences_unittest.cc',
    125             'installer/util/move_tree_work_item_unittest.cc',
    126             'installer/util/product_state_unittest.cc',
    127             'installer/util/product_unittest.cc',
    128             'installer/util/product_unittest.h',
    129             'installer/util/registry_key_backup_unittest.cc',
    130             'installer/util/registry_test_data.cc',
    131             'installer/util/registry_test_data.h',
    132             'installer/util/run_all_unittests.cc',
    133             'installer/util/self_cleaning_temp_dir_unittest.cc',
    134             'installer/util/set_reg_value_work_item_unittest.cc',
    135             'installer/util/shell_util_unittest.cc',
    136             'installer/util/uninstall_metrics_unittest.cc',
    137             'installer/util/wmi_unittest.cc',
    138             'installer/util/work_item_list_unittest.cc',
    139             '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc',
    140           ],
    141           'msvs_settings': {
    142             'VCManifestTool': {
    143               'AdditionalManifestFiles': [
    144                 '$(ProjectDir)\\installer\\mini_installer\\mini_installer.exe.manifest',
    145               ],
    146             },
    147           },
    148           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
    149           'msvs_disabled_warnings': [ 4267, ],
    150         },
    151         {
    152           'target_name': 'installer_util_strings',
    153           'type': 'none',
    154           'rules': [
    155             {
    156               'rule_name': 'installer_util_strings',
    157               'extension': 'grd',
    158               'variables': {
    159                 'create_string_rc_py' : 'installer/util/prebuild/create_string_rc.py',
    160               },
    161               'inputs': [
    162                 '<(create_string_rc_py)',
    163                 '<(RULE_INPUT_PATH)',
    164               ],
    165               'outputs': [
    166                 # Don't use <(RULE_INPUT_ROOT) to create the output file
    167                 # name, because the base name of the input
    168                 # (generated_resources.grd) doesn't match the generated file
    169                 # (installer_util_strings.h).
    170                 '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.h',
    171                 '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc',
    172               ],
    173               'action': ['python',
    174                          '<(create_string_rc_py)',
    175                          '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings',
    176                          '<(branding)',],
    177               'message': 'Generating resources from <(RULE_INPUT_PATH)',
    178               'msvs_cygwin_shell': 1,
    179             },
    180           ],
    181           'sources': [
    182             'app/chromium_strings.grd',
    183           ],
    184           'direct_dependent_settings': {
    185             'include_dirs': [
    186               '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings',
    187             ],
    188           },
    189         },
    190         {
    191           'target_name': 'launcher_support',
    192           'type': 'static_library',
    193           'include_dirs': [
    194             '..',
    195           ],
    196           'direct_dependent_settings': {
    197             'include_dirs': [
    198               '..',
    199             ],
    200           },
    201           'dependencies': [
    202             '<(DEPTH)/base/base.gyp:base',
    203           ],
    204           'sources': [
    205             'installer/launcher_support/chrome_launcher_support.cc',
    206             'installer/launcher_support/chrome_launcher_support.h',
    207           ],
    208         },
    209         {
    210           'target_name': 'mini_installer_test',
    211           'type': 'executable',
    212           'dependencies': [
    213             'installer_util',
    214             'installer_util_strings',
    215             '../base/base.gyp:base',
    216             '../base/base.gyp:base_i18n',
    217             '../base/base.gyp:test_support_base',
    218             '../chrome/chrome.gyp:test_support_common',
    219             '../testing/gtest.gyp:gtest',
    220           ],
    221           'include_dirs': [
    222             '..',
    223           ],
    224           'sources': [
    225             '<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc',
    226             'installer/util/installation_validation_helper.cc',
    227             'installer/util/installation_validation_helper.h',
    228             'test/mini_installer_test/installer_path_provider.cc',
    229             'test/mini_installer_test/installer_path_provider.h',
    230             'test/mini_installer_test/installer_test_util.cc',
    231             'test/mini_installer_test/installer_test_util.h',
    232             'test/mini_installer_test/mini_installer_test_constants.cc',
    233             'test/mini_installer_test/mini_installer_test_constants.h',
    234             'test/mini_installer_test/run_all_unittests.cc',
    235             'test/mini_installer_test/switch_builder.cc',
    236             'test/mini_installer_test/switch_builder.h',
    237             'test/mini_installer_test/test.cc',
    238           ],
    239           'msvs_settings': {
    240             'VCManifestTool': {
    241               'AdditionalManifestFiles': [
    242                 '$(ProjectDir)\\installer\\mini_installer\\mini_installer.exe.manifest',
    243               ],
    244             },
    245           },
    246         },
    247         {
    248           'target_name': 'setup',
    249           'type': 'executable',
    250           'dependencies': [
    251             'installer_util',
    252             'installer_util_strings',
    253             'launcher_support',
    254             '../base/base.gyp:base',
    255             '../breakpad/breakpad.gyp:breakpad_handler',
    256             '../chrome/common_constants.gyp:common_constants',
    257             '../rlz/rlz.gyp:rlz_lib',
    258             '../third_party/zlib/zlib.gyp:zlib',
    259           ],
    260           'include_dirs': [
    261             '..',
    262             '<(INTERMEDIATE_DIR)',
    263             '<(SHARED_INTERMEDIATE_DIR)/setup',
    264           ],
    265           'direct_dependent_settings': {
    266             'include_dirs': [
    267               '<(SHARED_INTERMEDIATE_DIR)/setup',
    268             ],
    269           },
    270           'sources': [
    271             'installer/mini_installer/chrome.release',
    272             'installer/setup/archive_patch_helper.cc',
    273             'installer/setup/archive_patch_helper.h',
    274             'installer/setup/install.cc',
    275             'installer/setup/install.h',
    276             'installer/setup/install_worker.cc',
    277             'installer/setup/install_worker.h',
    278             'installer/setup/setup_main.cc',
    279             'installer/setup/setup_main.h',
    280             'installer/setup/setup.ico',
    281             'installer/setup/setup.rc',
    282             'installer/setup/setup_constants.cc',
    283             'installer/setup/setup_constants.h',
    284             'installer/setup/setup_exe_version.rc.version',
    285             'installer/setup/setup_resource.h',
    286             'installer/setup/setup_util.cc',
    287             'installer/setup/setup_util.h',
    288             'installer/setup/uninstall.cc',
    289             'installer/setup/uninstall.h',
    290           ],
    291           'msvs_settings': {
    292             'VCLinkerTool': {
    293               'SubSystem': '2',     # Set /SUBSYSTEM:WINDOWS
    294             },
    295             'VCManifestTool': {
    296               'AdditionalManifestFiles': [
    297                 '$(ProjectDir)\\installer\\setup\\setup.exe.manifest',
    298               ],
    299             },
    300           },
    301           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
    302           'msvs_disabled_warnings': [ 4267, ],
    303           'rules': [
    304             {
    305               'rule_name': 'setup_version',
    306               'extension': 'version',
    307               'variables': {
    308                 'version_py_path': '../chrome/tools/build/version.py',
    309                 'template_input_path': 'installer/setup/setup_exe_version.rc.version',
    310               },
    311               'inputs': [
    312                 '<(template_input_path)',
    313                 '<(version_path)',
    314                 '<(lastchange_path)',
    315                 '<(branding_dir)/BRANDING',
    316               ],
    317               'outputs': [
    318                 '<(SHARED_INTERMEDIATE_DIR)/setup/setup_exe_version.rc',
    319               ],
    320               'action': [
    321                 'python', '<(version_py_path)',
    322                 '-f', '<(version_path)',
    323                 '-f', '<(lastchange_path)',
    324                 '-f', '<(branding_dir)/BRANDING',
    325                 '<(template_input_path)',
    326                 '<@(_outputs)',
    327               ],
    328               'process_outputs_as_sources': 1,
    329               'message': 'Generating version information'
    330             },
    331             {
    332               'rule_name': 'server_dlls',
    333               'extension': 'release',
    334               'variables': {
    335                 'scan_server_dlls_py' : 'tools/build/win/scan_server_dlls.py',
    336                 'template_file': 'installer/mini_installer/chrome.release',
    337               },
    338               'inputs': [
    339                 '<(scan_server_dlls_py)',
    340                 '<(template_file)'
    341               ],
    342               'outputs': [
    343                 '<(INTERMEDIATE_DIR)/registered_dlls.h',
    344               ],
    345               'action': [
    346                 'python',
    347                 '<(scan_server_dlls_py)',
    348                 '--output_dir=<(PRODUCT_DIR)',
    349                 '--input_file=<(RULE_INPUT_PATH)',
    350                 '--header_output_dir=<(INTERMEDIATE_DIR)',
    351                 # TODO(sgk):  may just use environment variables
    352                 #'--distribution=$(CHROMIUM_BUILD)',
    353                 '--distribution=_google_chrome',
    354               ],
    355               'msvs_cygwin_shell': 1,
    356             },
    357           ],
    358           'conditions': [
    359             ['component == "shared_library"', {
    360               'variables': {
    361                 'win_use_external_manifest': 1,
    362               },
    363             }],
    364             # TODO(mark):  <(branding_dir) should be defined by the
    365             # global condition block at the bottom of the file, but
    366             # this doesn't work due to the following issue:
    367             #
    368             #   http://code.google.com/p/gyp/issues/detail?id=22
    369             #
    370             # Remove this block once the above issue is fixed.
    371             [ 'branding == "Chrome"', {
    372               'variables': {
    373                  'branding_dir': 'app/theme/google_chrome',
    374                  'branding_dir_100': 'app/theme/default_100_percent/google_chrome',
    375               },
    376             }, { # else branding!="Chrome"
    377               'variables': {
    378                  'branding_dir': 'app/theme/chromium',
    379                  'branding_dir_100': 'app/theme/default_100_percent/chromium',
    380               },
    381             }],
    382           ],
    383         },
    384         {
    385           'target_name': 'setup_unittests',
    386           'type': 'executable',
    387           'dependencies': [
    388             'installer_util',
    389             'installer_util_strings',
    390             'launcher_support',
    391             '../base/base.gyp:base',
    392             '../base/base.gyp:base_i18n',
    393             '../base/base.gyp:test_support_base',
    394             '../testing/gmock.gyp:gmock',
    395             '../testing/gtest.gyp:gtest',
    396           ],
    397           'include_dirs': [
    398             '..',
    399             '<(INTERMEDIATE_DIR)',
    400           ],
    401           # TODO(robertshield): Move the items marked with "Move to lib"
    402           # below into a separate lib and then link both setup.exe and
    403           # setup_unittests.exe against that.
    404           'sources': [
    405             'installer/mini_installer/chrome.release',  # Move to lib
    406             'installer/mini_installer/appid.h',
    407             'installer/mini_installer/chrome_appid.cc',
    408             'installer/mini_installer/configuration.cc',
    409             'installer/mini_installer/configuration.h',
    410             'installer/mini_installer/configuration_test.cc',
    411             'installer/mini_installer/decompress.cc',
    412             'installer/mini_installer/decompress.h',
    413             'installer/mini_installer/decompress_test.cc',
    414             'installer/mini_installer/mini_string.cc',
    415             'installer/mini_installer/mini_string.h',
    416             'installer/mini_installer/mini_string_test.cc',
    417             'installer/setup/archive_patch_helper.cc',  # Move to lib
    418             'installer/setup/archive_patch_helper.h',   # Move to lib
    419             'installer/setup/archive_patch_helper_unittest.cc',
    420             'installer/setup/install.cc',               # Move to lib
    421             'installer/setup/install.h',                # Move to lib
    422             'installer/setup/install_unittest.cc',
    423             'installer/setup/install_worker.cc',        # Move to lib
    424             'installer/setup/install_worker.h',         # Move to lib
    425             'installer/setup/install_worker_unittest.cc',
    426             'installer/setup/run_all_unittests.cc',
    427             'installer/setup/setup_constants.cc',       # Move to lib
    428             'installer/setup/setup_constants.h',        # Move to lib
    429             'installer/setup/setup_unittests.rc',
    430             'installer/setup/setup_unittests_resource.h',
    431             'installer/setup/setup_util.cc',
    432             'installer/setup/setup_util_unittest.cc',
    433             'installer/setup/setup_util_unittest.h',
    434           ],
    435           'rules': [
    436             {
    437               'rule_name': 'server_dlls',               # Move to lib
    438               'extension': 'release',
    439               'variables': {
    440                 'scan_server_dlls_py' : 'tools/build/win/scan_server_dlls.py',
    441                 'template_file': 'installer/mini_installer/chrome.release',
    442               },
    443               'inputs': [
    444                 '<(scan_server_dlls_py)',
    445                 '<(template_file)'
    446               ],
    447               'outputs': [
    448                 '<(INTERMEDIATE_DIR)/registered_dlls.h',
    449               ],
    450               'action': [
    451                 'python',
    452                 '<(scan_server_dlls_py)',
    453                 '--output_dir=<(PRODUCT_DIR)',
    454                 '--input_file=<(RULE_INPUT_PATH)',
    455                 '--header_output_dir=<(INTERMEDIATE_DIR)',
    456                 # TODO(sgk):  may just use environment variables
    457                 #'--distribution=$(CHROMIUM_BUILD)',
    458                 '--distribution=_google_chrome',
    459               ],
    460               'msvs_cygwin_shell': 1,
    461             },
    462           ],
    463           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
    464           'msvs_disabled_warnings': [ 4267, ],
    465         },
    466       ],
    467     }],
    468     ['OS=="win" and target_arch=="ia32"', {
    469       'targets': [
    470         {
    471           'target_name': 'launcher_support64',
    472           'type': 'static_library',
    473           'include_dirs': [
    474             '..',
    475           ],
    476           'direct_dependent_settings': {
    477             'include_dirs': [
    478               '..',
    479             ],
    480           },
    481           'defines': [
    482               '<@(nacl_win64_defines)',
    483           ],
    484               'dependencies': [
    485               '<(DEPTH)/base/base.gyp:base_nacl_win64',
    486           ],
    487           'configurations': {
    488             'Common_Base': {
    489               'msvs_target_platform': 'x64',
    490             },
    491           },
    492           'sources': [
    493             'installer/launcher_support/chrome_launcher_support.cc',
    494             'installer/launcher_support/chrome_launcher_support.h',
    495           ],
    496         },
    497       ],
    498     }],
    499     ['OS=="linux" and branding=="Chrome"', {
    500       'variables': {
    501         # Always google_chrome since this only applies to branding==Chrome.
    502         'branding_dir': 'app/theme/google_chrome',
    503         'branding_dir_100': 'app/theme/default_100_percent/google_chrome',
    504         'version' : '<!(python <(version_py_path) -f ../chrome/VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
    505         'revision' : '<!(python ../build/util/lastchange.py --revision-only)',
    506         'packaging_files_common': [
    507           'installer/linux/common/apt.include',
    508           'installer/linux/common/default-app.template',
    509           'installer/linux/common/default-app-block.template',
    510           'installer/linux/common/desktop.template',
    511           'installer/linux/common/google-chrome/google-chrome.info',
    512           'installer/linux/common/installer.include',
    513           'installer/linux/common/postinst.include',
    514           'installer/linux/common/prerm.include',
    515           'installer/linux/common/repo.cron',
    516           'installer/linux/common/rpm.include',
    517           'installer/linux/common/rpmrepo.cron',
    518           'installer/linux/common/symlinks.include',
    519           'installer/linux/common/variables.include',
    520           'installer/linux/common/wrapper',
    521         ],
    522         'packaging_files_deb': [
    523           'installer/linux/debian/build.sh',
    524           'installer/linux/debian/changelog.template',
    525           'installer/linux/debian/control.template',
    526           'installer/linux/debian/debian.menu',
    527           'installer/linux/debian/expected_deps',
    528           'installer/linux/debian/postinst',
    529           'installer/linux/debian/postrm',
    530           'installer/linux/debian/prerm',
    531         ],
    532         'packaging_files_rpm': [
    533           'installer/linux/rpm/build.sh',
    534           'installer/linux/rpm/chrome.spec.template',
    535           'installer/linux/rpm/expected_deps_i386',
    536           'installer/linux/rpm/expected_deps_x86_64',
    537         ],
    538         'packaging_files_binaries': [
    539           # TODO(mmoss) Any convenient way to get all the relevant build
    540           # files? (e.g. all locales, resources, etc.)
    541           '<(PRODUCT_DIR)/chrome',
    542           '<(PRODUCT_DIR)/chrome_sandbox',
    543           '<(PRODUCT_DIR)/libffmpegsumo.so',
    544           '<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
    545           '<(PRODUCT_DIR)/xdg-mime',
    546           '<(PRODUCT_DIR)/xdg-settings',
    547           '<(PRODUCT_DIR)/locales/en-US.pak',
    548           '<(PRODUCT_DIR)/nacl_helper',
    549           '<(PRODUCT_DIR)/nacl_helper_bootstrap',
    550           '<(PRODUCT_DIR)/PepperFlash/libpepflashplayer.so',
    551           '<(PRODUCT_DIR)/PepperFlash/manifest.json',
    552           '<@(default_apps_list_linux_dest)',
    553         ],
    554         'flock_bash': ['flock', '--', '/tmp/linux_package_lock', 'bash'],
    555         'deb_build': '<(PRODUCT_DIR)/installer/debian/build.sh',
    556         'rpm_build': '<(PRODUCT_DIR)/installer/rpm/build.sh',
    557         'deb_cmd': ['<@(flock_bash)', '<(deb_build)', '-o' '<(PRODUCT_DIR)',
    558                     '-b', '<(PRODUCT_DIR)', '-a', '<(target_arch)'],
    559         'rpm_cmd': ['<@(flock_bash)', '<(rpm_build)', '-o' '<(PRODUCT_DIR)',
    560                     '-b', '<(PRODUCT_DIR)', '-a', '<(target_arch)'],
    561         'conditions': [
    562           ['target_arch=="ia32"', {
    563             'deb_arch': 'i386',
    564             'rpm_arch': 'i386',
    565             'packaging_files_binaries': [
    566               '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
    567               '<(PRODUCT_DIR)/libwidevinecdmadapter.so',
    568               '<(PRODUCT_DIR)/libwidevinecdm.so',
    569             ],
    570           }],
    571           ['target_arch=="x64"', {
    572             'deb_arch': 'amd64',
    573             'rpm_arch': 'x86_64',
    574             'packaging_files_binaries': [
    575               '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
    576               '<(PRODUCT_DIR)/libwidevinecdmadapter.so',
    577               '<(PRODUCT_DIR)/libwidevinecdm.so',
    578             ],
    579           }],
    580           ['target_arch=="arm"', {
    581             'deb_arch': 'arm',
    582             'rpm_arch': 'arm',
    583           }],
    584           ['internal_pdf', {
    585             'packaging_files_binaries': [
    586               '<(PRODUCT_DIR)/libpdf.so',
    587             ],
    588           }],
    589           ['libpeer_target_type!="static_library"', {
    590             'packaging_files_binaries': [
    591               '<(PRODUCT_DIR)/lib/libpeerconnection.so',
    592             ],
    593           }],
    594         ],
    595       },
    596       'targets': [
    597         {
    598           'target_name': 'linux_installer_configs',
    599           'type': 'none',
    600           # Add these files to the build output so the build archives will be
    601           # "hermetic" for packaging. This is only for branding="Chrome" since
    602           # we only create packages for official builds.
    603           'copies': [
    604             {
    605               'destination': '<(PRODUCT_DIR)/installer/debian/',
    606               'files': [
    607                 '<@(packaging_files_deb)',
    608               ]
    609             },
    610             {
    611               'destination': '<(PRODUCT_DIR)/installer/rpm/',
    612               'files': [
    613                 '<@(packaging_files_rpm)',
    614               ]
    615             },
    616             {
    617               'destination': '<(PRODUCT_DIR)/installer/common/',
    618               'files': [
    619                 '<@(packaging_files_common)',
    620               ]
    621             },
    622             # Additional theme resources needed for package building.
    623             {
    624               'destination': '<(PRODUCT_DIR)/installer/theme/',
    625               'files': [
    626                 '<(branding_dir_100)/product_logo_16.png',
    627                 '<(branding_dir)/product_logo_22.png',
    628                 '<(branding_dir)/product_logo_24.png',
    629                 '<(branding_dir_100)/product_logo_32.png',
    630                 '<(branding_dir)/product_logo_48.png',
    631                 '<(branding_dir)/product_logo_64.png',
    632                 '<(branding_dir)/product_logo_128.png',
    633                 '<(branding_dir)/product_logo_256.png',
    634                 '<(branding_dir)/product_logo_32.xpm',
    635                 '<(branding_dir)/BRANDING',
    636               ],
    637             },
    638           ],
    639           'actions': [
    640             {
    641               'action_name': 'save_build_info',
    642               'inputs': [
    643                 '<(branding_dir)/BRANDING',
    644                 '<(version_path)',
    645                 '<(lastchange_path)',
    646               ],
    647               'outputs': [
    648                 '<(PRODUCT_DIR)/installer/version.txt',
    649               ],
    650               # Just output the default version info variables.
    651               'action': [
    652                 'python', '<(version_py_path)',
    653                 '-f', '<(branding_dir)/BRANDING',
    654                 '-f', '<(version_path)',
    655                 '-f', '<(lastchange_path)',
    656                 '-o', '<@(_outputs)'
    657               ],
    658             },
    659           ],
    660         },
    661         {
    662           'target_name': 'linux_packages_all',
    663           'suppress_wildcard': 1,
    664           'type': 'none',
    665           'dependencies': [
    666             'linux_packages_unstable',
    667             'linux_packages_beta',
    668             'linux_packages_stable',
    669           ],
    670         },
    671         {
    672           # 'asan' is a developer, testing-only package, so it shouldn't be
    673           # included in the 'linux_packages_all' collection.
    674           'target_name': 'linux_packages_asan',
    675           'suppress_wildcard': 1,
    676           'type': 'none',
    677           'dependencies': [
    678             'linux_packages_asan_deb',
    679           ],
    680           # ChromeOS doesn't care about RPM packages.
    681           'conditions': [
    682             ['chromeos==0', {
    683               'dependencies': [
    684                 'linux_packages_asan_rpm',
    685               ],
    686             }],
    687           ],
    688         },
    689         {
    690           # 'trunk' is a developer, testing-only package, so it shouldn't be
    691           # included in the 'linux_packages_all' collection.
    692           'target_name': 'linux_packages_trunk',
    693           'suppress_wildcard': 1,
    694           'type': 'none',
    695           'dependencies': [
    696             'linux_packages_trunk_deb',
    697           ],
    698           # ChromeOS doesn't care about RPM packages.
    699           'conditions': [
    700             ['chromeos==0', {
    701               'dependencies': [
    702                 'linux_packages_trunk_rpm',
    703               ],
    704             }],
    705           ],
    706         },
    707         {
    708           'target_name': 'linux_packages_unstable',
    709           'suppress_wildcard': 1,
    710           'type': 'none',
    711           'dependencies': [
    712             'linux_packages_unstable_deb',
    713           ],
    714           # ChromeOS doesn't care about RPM packages.
    715           'conditions': [
    716             ['chromeos==0', {
    717               'dependencies': [
    718                 'linux_packages_unstable_rpm',
    719               ],
    720             }],
    721           ],
    722         },
    723         {
    724           'target_name': 'linux_packages_beta',
    725           'suppress_wildcard': 1,
    726           'type': 'none',
    727           'dependencies': [
    728             'linux_packages_beta_deb',
    729           ],
    730           # ChromeOS doesn't care about RPM packages.
    731           'conditions': [
    732             ['chromeos==0', {
    733               'dependencies': [
    734                 'linux_packages_beta_rpm',
    735               ],
    736             }],
    737           ],
    738         },
    739         {
    740           'target_name': 'linux_packages_stable',
    741           'suppress_wildcard': 1,
    742           'type': 'none',
    743           'dependencies': [
    744             'linux_packages_stable_deb',
    745           ],
    746           # ChromeOS doesn't care about RPM packages.
    747           'conditions': [
    748             ['chromeos==0', {
    749               'dependencies': [
    750                 'linux_packages_stable_rpm',
    751               ],
    752             }],
    753           ],
    754         },
    755         # TODO(mmoss) gyp looping construct would be handy here ...
    756         # These package actions are the same except for the 'channel' variable.
    757         {
    758           'target_name': 'linux_packages_asan_deb',
    759           'suppress_wildcard': 1,
    760           'type': 'none',
    761           'dependencies': [
    762             'chrome',
    763             'linux_installer_configs',
    764           ],
    765           'actions': [
    766             {
    767               'variables': {
    768                 'channel': 'asan',
    769               },
    770               'action_name': 'deb_packages_<(channel)',
    771               'process_outputs_as_sources': 1,
    772               'inputs': [
    773                 '<(deb_build)',
    774                 '<@(packaging_files_binaries)',
    775                 '<@(packaging_files_common)',
    776                 '<@(packaging_files_deb)',
    777               ],
    778               'outputs': [
    779                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
    780               ],
    781               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
    782             },
    783           ],
    784         },
    785         {
    786           'target_name': 'linux_packages_trunk_deb',
    787           'suppress_wildcard': 1,
    788           'type': 'none',
    789           'dependencies': [
    790             'chrome',
    791             'linux_installer_configs',
    792           ],
    793           'actions': [
    794             {
    795               'variables': {
    796                 'channel': 'trunk',
    797               },
    798               'action_name': 'deb_packages_<(channel)',
    799               'process_outputs_as_sources': 1,
    800               'inputs': [
    801                 '<(deb_build)',
    802                 '<@(packaging_files_binaries)',
    803                 '<@(packaging_files_common)',
    804                 '<@(packaging_files_deb)',
    805               ],
    806               'outputs': [
    807                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
    808               ],
    809               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
    810             },
    811           ],
    812         },
    813         {
    814           'target_name': 'linux_packages_unstable_deb',
    815           'suppress_wildcard': 1,
    816           'type': 'none',
    817           'dependencies': [
    818             'chrome',
    819             'linux_installer_configs',
    820           ],
    821           'actions': [
    822             {
    823               'variables': {
    824                 'channel': 'unstable',
    825               },
    826               'action_name': 'deb_packages_<(channel)',
    827               'process_outputs_as_sources': 1,
    828               'inputs': [
    829                 '<(deb_build)',
    830                 '<@(packaging_files_binaries)',
    831                 '<@(packaging_files_common)',
    832                 '<@(packaging_files_deb)',
    833               ],
    834               'outputs': [
    835                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
    836               ],
    837               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
    838             },
    839           ],
    840         },
    841         {
    842           'target_name': 'linux_packages_beta_deb',
    843           'suppress_wildcard': 1,
    844           'type': 'none',
    845           'dependencies': [
    846             'chrome',
    847             'linux_installer_configs',
    848           ],
    849           'actions': [
    850             {
    851               'variables': {
    852                 'channel': 'beta',
    853               },
    854               'action_name': 'deb_packages_<(channel)',
    855               'process_outputs_as_sources': 1,
    856               'inputs': [
    857                 '<(deb_build)',
    858                 '<@(packaging_files_binaries)',
    859                 '<@(packaging_files_common)',
    860                 '<@(packaging_files_deb)',
    861               ],
    862               'outputs': [
    863                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
    864               ],
    865               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
    866             },
    867           ],
    868         },
    869         {
    870           'target_name': 'linux_packages_stable_deb',
    871           'suppress_wildcard': 1,
    872           'type': 'none',
    873           'dependencies': [
    874             'chrome',
    875             'linux_installer_configs',
    876           ],
    877           'actions': [
    878             {
    879               'variables': {
    880                 'channel': 'stable',
    881               },
    882               'action_name': 'deb_packages_<(channel)',
    883               'process_outputs_as_sources': 1,
    884               'inputs': [
    885                 '<(deb_build)',
    886                 '<@(packaging_files_binaries)',
    887                 '<@(packaging_files_common)',
    888                 '<@(packaging_files_deb)',
    889               ],
    890               'outputs': [
    891                 '<(PRODUCT_DIR)/google-chrome-<(channel)_<(version)-1_<(deb_arch).deb',
    892               ],
    893               'action': [ '<@(deb_cmd)', '-c', '<(channel)', ],
    894             },
    895           ],
    896         },
    897         {
    898           'target_name': 'linux_packages_asan_rpm',
    899           'suppress_wildcard': 1,
    900           'type': 'none',
    901           'dependencies': [
    902             'chrome',
    903             'linux_installer_configs',
    904           ],
    905           'actions': [
    906             {
    907               'variables': {
    908                 'channel': 'asan',
    909               },
    910               'action_name': 'rpm_packages_<(channel)',
    911               'process_outputs_as_sources': 1,
    912               'inputs': [
    913                 '<(rpm_build)',
    914                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
    915                 '<@(packaging_files_binaries)',
    916                 '<@(packaging_files_common)',
    917                 '<@(packaging_files_rpm)',
    918               ],
    919               'outputs': [
    920                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
    921               ],
    922               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
    923             },
    924           ],
    925         },
    926         {
    927           'target_name': 'linux_packages_trunk_rpm',
    928           'suppress_wildcard': 1,
    929           'type': 'none',
    930           'dependencies': [
    931             'chrome',
    932             'linux_installer_configs',
    933           ],
    934           'actions': [
    935             {
    936               'variables': {
    937                 'channel': 'trunk',
    938               },
    939               'action_name': 'rpm_packages_<(channel)',
    940               'process_outputs_as_sources': 1,
    941               'inputs': [
    942                 '<(rpm_build)',
    943                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
    944                 '<@(packaging_files_binaries)',
    945                 '<@(packaging_files_common)',
    946                 '<@(packaging_files_rpm)',
    947               ],
    948               'outputs': [
    949                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
    950               ],
    951               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
    952             },
    953           ],
    954         },
    955         {
    956           'target_name': 'linux_packages_unstable_rpm',
    957           'suppress_wildcard': 1,
    958           'type': 'none',
    959           'dependencies': [
    960             'chrome',
    961             'linux_installer_configs',
    962           ],
    963           'actions': [
    964             {
    965               'variables': {
    966                 'channel': 'unstable',
    967               },
    968               'action_name': 'rpm_packages_<(channel)',
    969               'process_outputs_as_sources': 1,
    970               'inputs': [
    971                 '<(rpm_build)',
    972                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
    973                 '<@(packaging_files_binaries)',
    974                 '<@(packaging_files_common)',
    975                 '<@(packaging_files_rpm)',
    976               ],
    977               'outputs': [
    978                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
    979               ],
    980               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
    981             },
    982           ],
    983         },
    984         {
    985           'target_name': 'linux_packages_beta_rpm',
    986           'suppress_wildcard': 1,
    987           'type': 'none',
    988           'dependencies': [
    989             'chrome',
    990             'linux_installer_configs',
    991           ],
    992           'actions': [
    993             {
    994               'variables': {
    995                 'channel': 'beta',
    996               },
    997               'action_name': 'rpm_packages_<(channel)',
    998               'process_outputs_as_sources': 1,
    999               'inputs': [
   1000                 '<(rpm_build)',
   1001                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
   1002                 '<@(packaging_files_binaries)',
   1003                 '<@(packaging_files_common)',
   1004                 '<@(packaging_files_rpm)',
   1005               ],
   1006               'outputs': [
   1007                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
   1008               ],
   1009               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
   1010             },
   1011           ],
   1012         },
   1013         {
   1014           'target_name': 'linux_packages_stable_rpm',
   1015           'suppress_wildcard': 1,
   1016           'type': 'none',
   1017           'dependencies': [
   1018             'chrome',
   1019             'linux_installer_configs',
   1020           ],
   1021           'actions': [
   1022             {
   1023               'variables': {
   1024                 'channel': 'stable',
   1025               },
   1026               'action_name': 'rpm_packages_<(channel)',
   1027               'process_outputs_as_sources': 1,
   1028               'inputs': [
   1029                 '<(rpm_build)',
   1030                 '<(PRODUCT_DIR)/installer/rpm/chrome.spec.template',
   1031                 '<@(packaging_files_binaries)',
   1032                 '<@(packaging_files_common)',
   1033                 '<@(packaging_files_rpm)',
   1034               ],
   1035               'outputs': [
   1036                 '<(PRODUCT_DIR)/google-chrome-<(channel)-<(version)-1.<(rpm_arch).rpm',
   1037               ],
   1038               'action': [ '<@(rpm_cmd)', '-c', '<(channel)', ],
   1039             },
   1040           ],
   1041         },
   1042       ],
   1043     }],
   1044     ['OS=="mac"', {
   1045       'variables': {
   1046         'mac_packaging_dir':
   1047             '<(PRODUCT_DIR)/<(mac_product_name) Packaging',
   1048         # <(PRODUCT_DIR) expands to $(BUILT_PRODUCTS_DIR), which doesn't
   1049         # work properly in a shell script, where ${BUILT_PRODUCTS_DIR} is
   1050         # needed.
   1051         'mac_packaging_sh_dir':
   1052             '${BUILT_PRODUCTS_DIR}/<(mac_product_name) Packaging',
   1053       }, # variables
   1054       'targets': [
   1055         {
   1056           'target_name': 'installer_packaging',
   1057           'type': 'none',
   1058           'dependencies': [
   1059             'installer/mac/third_party/bsdiff/goobsdiff.gyp:*',
   1060             'installer/mac/third_party/xz/xz.gyp:*',
   1061           ],
   1062           'conditions': [
   1063             ['buildtype=="Official"', {
   1064               'actions': [
   1065                 {
   1066                   # Create sign.sh, the script that the packaging system will
   1067                   # use to sign the .app bundle.
   1068                   'action_name': 'Make sign.sh',
   1069                   'variables': {
   1070                     'make_signers_sh_path': 'installer/mac/make_signers.sh',
   1071                   },
   1072                   'inputs': [
   1073                     '<(make_signers_sh_path)',
   1074                     'installer/mac/sign_app.sh.in',
   1075                     'installer/mac/sign_versioned_dir.sh.in',
   1076                     'installer/mac/app_resource_rules.plist.in',
   1077                     '<(version_path)',
   1078                   ],
   1079                   'outputs': [
   1080                     '<(mac_packaging_dir)/sign_app.sh',
   1081                     '<(mac_packaging_dir)/sign_versioned_dir.sh',
   1082                     '<(mac_packaging_dir)/app_resource_rules.plist',
   1083                   ],
   1084                   'action': [
   1085                     '<(make_signers_sh_path)',
   1086                     '<(mac_packaging_sh_dir)',
   1087                     '<(mac_product_name)',
   1088                     '<(version_full)',
   1089                   ],
   1090                 },
   1091               ],  # actions
   1092             }],  # buildtype=="Official"
   1093             ['branding=="Chrome" and buildtype=="Official"', {
   1094               'actions': [
   1095                 {
   1096                   # copy_keychain_reauthorize.sh explains why this isn't in a
   1097                   # 'copies' block, but briefly: this is a prebuilt signed
   1098                   # binary component that relies on a correct signature to
   1099                   # function properly, and a normal 'copies' block sadly makes
   1100                   # a trivial modification to the file such that its signature
   1101                   # is no longer valid.
   1102                   'action_name': 'Copy keychain_reauthorize',
   1103                   'variables': {
   1104                     'keychain_reauthorize_path': 'tools/build/mac/copy_keychain_reauthorize.sh',
   1105                     'keychain_reauthorize_normal_path': 'installer/mac/internal/keychain_reauthorize/com.google.Chrome',
   1106                     'keychain_reauthorize_canary_path': 'installer/mac/internal/keychain_reauthorize/com.google.Chrome.canary',
   1107                     'keychain_reauthorize_output_dir': '<(mac_packaging_dir)/.keychain_reauthorize',
   1108                   },
   1109                   'inputs': [
   1110                     '<(keychain_reauthorize_path)',
   1111                     '<(keychain_reauthorize_normal_path)',
   1112                     '<(keychain_reauthorize_canary_path)',
   1113                   ],
   1114                   'outputs': [
   1115                     '<(keychain_reauthorize_output_dir)/com.google.Chrome',
   1116                     '<(keychain_reauthorize_output_dir)/com.google.Chrome.canary',
   1117                   ],
   1118                   'action': [
   1119                     '<(keychain_reauthorize_path)',
   1120                     '<(keychain_reauthorize_output_dir)',
   1121                     '<(keychain_reauthorize_normal_path)',
   1122                     '<(keychain_reauthorize_canary_path)',
   1123                   ],
   1124                 },
   1125               ],  # actions
   1126             }],  # branding=="Chrome" and buildtype=="Official"
   1127           ],  # conditions
   1128           'copies': [
   1129             {
   1130               # Put the files where the packaging system will find them. The
   1131               # packager will use these when building the "full installer"
   1132               # disk images and delta/differential update disk images.
   1133               'destination': '<(mac_packaging_dir)',
   1134               'files': [
   1135                 '<(PRODUCT_DIR)/goobsdiff',
   1136                 '<(PRODUCT_DIR)/goobspatch',
   1137                 '<(PRODUCT_DIR)/liblzma_decompress.dylib',
   1138                 '<(PRODUCT_DIR)/xz',
   1139                 '<(PRODUCT_DIR)/xzdec',
   1140                 'installer/mac/dirdiffer.sh',
   1141                 'installer/mac/dirpatcher.sh',
   1142                 'installer/mac/dmgdiffer.sh',
   1143                 'installer/mac/pkg-dmg',
   1144               ],
   1145               'conditions': [
   1146                 ['mac_keystone==1', {
   1147                   'files': [
   1148                     'installer/mac/keystone_install.sh',
   1149                   ],
   1150                 }],  # mac_keystone
   1151                 ['branding=="Chrome" and buildtype=="Official"', {
   1152                   'files': [
   1153                     'app/theme/google_chrome/app_canary.icns',
   1154                     'app/theme/google_chrome/document_canary.icns',
   1155                     'installer/mac/internal/chrome_canary_dmg_dsstore',
   1156                     'installer/mac/internal/chrome_canary_dmg_icon.icns',
   1157                     'installer/mac/internal/chrome_dmg_background.png',
   1158                     'installer/mac/internal/chrome_dmg_dsstore',
   1159                     'installer/mac/internal/chrome_dmg_icon.icns',
   1160                     'installer/mac/internal/generate_dmgs',
   1161                   ],
   1162                 }],  # branding=="Chrome" and buildtype=="Official"
   1163               ],  # conditions
   1164             },
   1165           ],  # copies
   1166         },  # target: installer_packaging
   1167         {
   1168           'target_name': 'gcapi_lib',
   1169           'type': 'static_library',
   1170           'include_dirs': [
   1171             '..',
   1172           ],
   1173           'sources': [
   1174             'installer/gcapi_mac/gcapi.h',
   1175             'installer/gcapi_mac/gcapi.mm',
   1176           ],
   1177           'link_settings': {
   1178             'libraries': [
   1179               '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
   1180             ],
   1181           },
   1182           'xcode_settings': {
   1183             'ARCHS': [ 'i386', 'x86_64' ],
   1184             'MACOSX_DEPLOYMENT_TARGET': '10.4',
   1185             'GCC_ENABLE_OBJC_GC': 'supported',
   1186           },
   1187         },
   1188         {
   1189           'target_name': 'gcapi_example',
   1190           'type': 'executable',
   1191           'dependencies': [
   1192             'gcapi_lib',
   1193           ],
   1194           'include_dirs': [
   1195             '..',
   1196           ],
   1197           'sources': [
   1198             'installer/gcapi_mac/gcapi_example_client.mm',
   1199           ],
   1200         },
   1201       ],  # targets
   1202     }],  # OS=="mac"
   1203     [ 'branding == "Chrome"', {
   1204       'variables': {
   1205          'branding_dir': 'app/theme/google_chrome',
   1206          'branding_dir_100': 'app/theme/default_100_percent/google_chrome',
   1207       },
   1208     }, { # else branding!="Chrome"
   1209       'variables': {
   1210          'branding_dir': 'app/theme/chromium',
   1211          'branding_dir_100': 'app/theme/default_100_percent/chromium',
   1212       },
   1213     }],
   1214   ],
   1215 }
   1216