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