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