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