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