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