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