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