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