brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 1 | # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
thomasanderson | 018ffc7f | 2017-06-22 01:25:33 | [diff] [blame] | 5 | import("//build/config/c++/c++.gni") |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 6 | import("//build/config/chrome_build.gni") |
dpranke | 3b87061 | 2015-09-10 23:42:04 | [diff] [blame] | 7 | import("//build/config/features.gni") |
brettw | 4cab0f1 | 2015-09-14 21:40:01 | [diff] [blame] | 8 | import("//build/config/sanitizers/sanitizers.gni") |
thomasanderson | 7a01af4 | 2016-10-18 21:22:42 | [diff] [blame] | 9 | import("//build/config/sysroot.gni") |
raphael.kubo.da.costa | dc683d2 | 2016-09-17 19:41:13 | [diff] [blame] | 10 | import("//build/util/process_version.gni") |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 11 | import("//build/util/version.gni") |
raphael.kubo.da.costa | dc683d2 | 2016-09-17 19:41:13 | [diff] [blame] | 12 | import("//chrome/process_version_rc_template.gni") # For branding_file_path. |
Dirk Pranke | ccc0c36 | 2017-09-28 22:15:11 | [diff] [blame] | 13 | import("//components/nacl/features.gni") |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 14 | |
xhwang | c3a252b | 2016-05-23 02:35:48 | [diff] [blame] | 15 | if (current_cpu == "x86" || current_cpu == "x64") { |
| 16 | import("//media/cdm/ppapi/cdm_paths.gni") |
| 17 | } |
| 18 | |
sbc | fa8f43b | 2016-10-05 17:11:35 | [diff] [blame] | 19 | assert(is_linux) |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 20 | |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 21 | packaging_files_executables = [ |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 22 | "$root_out_dir/chrome", |
| 23 | "$root_out_dir/chrome_sandbox", |
| 24 | ] |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 25 | packaging_files_shlibs = [] |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 26 | |
| 27 | if (enable_nacl) { |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 28 | packaging_files_executables += [ |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 29 | "$root_out_dir/nacl_helper", |
| 30 | "$root_out_dir/nacl_helper_bootstrap", |
| 31 | ] |
| 32 | |
| 33 | if (current_cpu == "x86") { |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 34 | packaging_files_executables += [ "$root_out_dir/nacl_irt_x86_32.nexe" ] |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 35 | } else if (current_cpu == "x64") { |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 36 | packaging_files_executables += [ "$root_out_dir/nacl_irt_x86_64.nexe" ] |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 37 | } else if (current_cpu == "arm") { |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 38 | packaging_files_executables += [ "$root_out_dir/nacl_irt_arm.nexe" ] |
Milko Leporis | 0f74ee8 | 2017-10-02 22:37:07 | [diff] [blame] | 39 | } else if (current_cpu == "mipsel") { |
| 40 | packaging_files_executables += [ "$root_out_dir/nacl_irt_mips32.nexe" ] |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
| 44 | # The widevine BUILD.gn only produces shared libraries for x86 and x64 |
| 45 | if (is_chrome_branded && (current_cpu == "x86" || current_cpu == "x64")) { |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 46 | packaging_files_shlibs += [ |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 47 | "$root_out_dir/$widevine_cdm_path/libwidevinecdmadapter.so", |
| 48 | "$root_out_dir/$widevine_cdm_path/libwidevinecdm.so", |
| 49 | ] |
| 50 | } |
| 51 | |
| 52 | if (!libcpp_is_static && use_custom_libcxx) { |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 53 | packaging_files_shlibs += [ "$root_out_dir/libc++.so" ] |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 54 | } |
| 55 | |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 56 | packaging_files_binaries = packaging_files_executables + packaging_files_shlibs |
| 57 | |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 58 | # TODO(mmoss) Any convenient way to get all the relevant build files? |
| 59 | # (e.g. all locales, resources, etc.) |
| 60 | packaging_files = packaging_files_binaries + [ |
| 61 | "$root_out_dir/xdg-mime", |
| 62 | "$root_out_dir/xdg-settings", |
| 63 | "$root_out_dir/locales/en-US.pak", |
| 64 | ] |
| 65 | |
Tom Anderson | a80a9b4 | 2017-09-07 02:35:33 | [diff] [blame] | 66 | action_foreach("calculate_deb_dependencies") { |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 67 | deps = [ |
| 68 | ":installer_deps", |
| 69 | ] |
Tom Anderson | a80a9b4 | 2017-09-07 02:35:33 | [diff] [blame] | 70 | script = "debian/calculate_package_deps.py" |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 71 | sources = packaging_files_binaries |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 72 | inputs = [ |
| 73 | "debian/deb_version.py", |
Lei Zhang | e680353b | 2017-09-25 23:03:50 | [diff] [blame] | 74 | "debian/dist_package_versions.json", |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 75 | "debian/package_version_interval.py", |
| 76 | ] |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 77 | outputs = [ |
Tom Anderson | a80a9b4 | 2017-09-07 02:35:33 | [diff] [blame] | 78 | "$root_out_dir/deb_{{source_name_part}}.deps", |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 79 | ] |
| 80 | args = [ |
| 81 | "{{source}}", |
| 82 | rebase_path(sysroot, root_build_dir), |
| 83 | target_cpu, |
Tom Anderson | a80a9b4 | 2017-09-07 02:35:33 | [diff] [blame] | 84 | "deb_{{source_name_part}}.deps", |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 85 | ] |
Tom Anderson | cedcf796 | 2017-10-04 00:29:55 | [diff] [blame] | 86 | if (is_desktop_linux && target_cpu == "x64") { |
Tom Anderson | c92bc27 | 2017-09-15 23:12:57 | [diff] [blame] | 87 | args += [ "--distro-check" ] |
| 88 | } |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 89 | } |
| 90 | |
Tom Anderson | a80a9b4 | 2017-09-07 02:35:33 | [diff] [blame] | 91 | action("merge_deb_dependencies") { |
| 92 | deps = [ |
| 93 | ":calculate_deb_dependencies", |
| 94 | ] |
| 95 | script = "debian/merge_package_versions.py" |
Tom Anderson | 21254bb | 2017-09-07 04:07:18 | [diff] [blame] | 96 | additional_deps = "debian/additional_deps" |
| 97 | inputs = [ |
| 98 | additional_deps, |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 99 | "debian/deb_version.py", |
| 100 | "debian/package_version_interval.py", |
Tom Anderson | a80a9b4 | 2017-09-07 02:35:33 | [diff] [blame] | 101 | ] |
Tom Anderson | 21254bb | 2017-09-07 04:07:18 | [diff] [blame] | 102 | outputs = [ |
| 103 | "$root_out_dir/deb_common.deps", |
| 104 | ] |
| 105 | args = [ |
| 106 | "deb_common.deps", |
| 107 | rebase_path(additional_deps, root_build_dir), |
| 108 | ] |
Tom Anderson | a80a9b4 | 2017-09-07 02:35:33 | [diff] [blame] | 109 | args += rebase_path(get_target_outputs(":calculate_deb_dependencies"), |
| 110 | root_build_dir) |
| 111 | } |
| 112 | |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 113 | action_foreach("calculate_rpm_dependencies") { |
| 114 | deps = [ |
| 115 | ":installer_deps", |
| 116 | ] |
| 117 | script = "rpm/calculate_package_deps.py" |
| 118 | sources = packaging_files_binaries |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 119 | inputs = [ |
Lei Zhang | e680353b | 2017-09-25 23:03:50 | [diff] [blame] | 120 | "rpm/dist_package_provides.json", |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 121 | ] |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 122 | outputs = [ |
| 123 | "$root_out_dir/rpm_{{source_name_part}}.deps", |
| 124 | ] |
| 125 | args = [ |
| 126 | "{{source}}", |
| 127 | "rpm_{{source_name_part}}.deps", |
| 128 | ] |
| 129 | args += rebase_path(packaging_files_shlibs, root_build_dir) |
Tom Anderson | cedcf796 | 2017-10-04 00:29:55 | [diff] [blame] | 130 | if (is_desktop_linux && target_cpu == "x64") { |
Tom Anderson | c92bc27 | 2017-09-15 23:12:57 | [diff] [blame] | 131 | args += [ "--distro-check" ] |
| 132 | } |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | action("merge_rpm_dependencies") { |
| 136 | deps = [ |
| 137 | ":calculate_rpm_dependencies", |
| 138 | ] |
| 139 | script = "rpm/merge_package_deps.py" |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 140 | additional_deps = "rpm/additional_deps" |
| 141 | inputs = [ |
| 142 | additional_deps, |
| 143 | ] |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 144 | outputs = [ |
| 145 | "$root_out_dir/rpm_common.deps", |
| 146 | ] |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 147 | args = [ |
| 148 | "rpm_common.deps", |
| 149 | rebase_path(additional_deps, root_build_dir), |
| 150 | ] |
Tom Anderson | 7f6acf6 | 2017-09-08 03:13:09 | [diff] [blame] | 151 | args += rebase_path(get_target_outputs(":calculate_rpm_dependencies"), |
| 152 | root_build_dir) |
| 153 | } |
| 154 | |
Tom Anderson | ce16a0c | 2017-09-02 00:27:51 | [diff] [blame] | 155 | action("strip_chrome_binary") { |
| 156 | prog_name = "$root_out_dir/chrome" |
| 157 | debug_file = prog_name + ".debug" |
| 158 | stripped_file = prog_name + ".stripped" |
| 159 | deps = [ |
| 160 | "//chrome", |
| 161 | ] |
Tom Anderson | 2bb2b38 | 2017-09-26 20:21:53 | [diff] [blame] | 162 | script = "//build/gn_run_binary.py" |
Tom Anderson | ce16a0c | 2017-09-02 00:27:51 | [diff] [blame] | 163 | sources = [ |
| 164 | prog_name, |
| 165 | ] |
| 166 | outputs = [ |
| 167 | debug_file, |
| 168 | stripped_file, |
| 169 | ] |
| 170 | args = [ |
| 171 | rebase_path("//third_party/eu-strip/bin/eu-strip", root_build_dir), |
Tom Anderson | 2bb2b38 | 2017-09-26 20:21:53 | [diff] [blame] | 172 | "-o", |
Tom Anderson | ce16a0c | 2017-09-02 00:27:51 | [diff] [blame] | 173 | rebase_path(stripped_file, root_build_dir), |
Tom Anderson | 2bb2b38 | 2017-09-26 20:21:53 | [diff] [blame] | 174 | "-f", |
| 175 | rebase_path(debug_file, root_build_dir), |
| 176 | rebase_path(prog_name, root_build_dir), |
Tom Anderson | ce16a0c | 2017-09-02 00:27:51 | [diff] [blame] | 177 | ] |
| 178 | } |
| 179 | |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 180 | # This target builds all "normal" Linux installers. |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 181 | # |
| 182 | # The bot setup is to build stable, unstable, and beta packages for the current |
| 183 | # build. Then a later step picks up the package corresponding to what the |
| 184 | # current build is supposed to be. This is wasteful since one build will only |
Tom Anderson | 1d58248 | 2017-09-05 20:41:28 | [diff] [blame] | 185 | # be one of these. |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 186 | # |
| 187 | # TODO it would be much nicer to have a build variable so the bot can tell us |
| 188 | # what the current build should be, so we only have to make one .deb/.rpm pair. |
| 189 | # |
| 190 | # |
| 191 | # TO BUILD LINUX INSTALLER PACKAGES |
| 192 | # |
| 193 | # The packages list the exact versions of each library used. The versions used |
| 194 | # on the bots are likely different than those on your workstation, so you'll |
| 195 | # get a stream of errors like: |
| 196 | # < libasound2 (>= 1.0.23) |
| 197 | # --- |
| 198 | # > libasound2 (>= 1.0.16) |
| 199 | # |
| 200 | # To avoid these warnings for testing purposes, do: |
| 201 | # |
| 202 | # export IGNORE_DEPS_CHANGES=1 |
| 203 | # |
| 204 | # before you build. |
| 205 | group("linux") { |
| 206 | deps = [ |
| 207 | ":beta", |
| 208 | ":stable", |
| 209 | ":unstable", |
| 210 | ] |
| 211 | } |
| 212 | |
| 213 | branding_dir = "//chrome/app/theme/$branding_path_component" |
| 214 | branding_dir_100 = |
| 215 | "//chrome/app/theme/default_100_percent/$branding_path_component" |
| 216 | |
| 217 | copy("common_packaging_files") { |
| 218 | visibility = [ ":*" ] |
| 219 | sources = [ |
Tom Anderson | 64b9614 | 2017-09-26 21:00:54 | [diff] [blame] | 220 | "//chrome/app/resources/manpage.1.in", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 221 | "common/apt.include", |
| 222 | "common/default-app-block.template", |
| 223 | "common/default-app.template", |
| 224 | "common/desktop.template", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 225 | "common/installer.include", |
| 226 | "common/postinst.include", |
| 227 | "common/prerm.include", |
| 228 | "common/repo.cron", |
| 229 | "common/rpm.include", |
| 230 | "common/rpmrepo.cron", |
| 231 | "common/symlinks.include", |
| 232 | "common/variables.include", |
| 233 | "common/wrapper", |
| 234 | ] |
| 235 | |
sbc | fa8f43b | 2016-10-05 17:11:35 | [diff] [blame] | 236 | if (is_chrome_branded) { |
tomas.popela | dd765c0 | 2017-03-21 14:44:16 | [diff] [blame] | 237 | sources += [ |
| 238 | "common/google-chrome/google-chrome.appdata.xml.template", |
| 239 | "common/google-chrome/google-chrome.info", |
| 240 | ] |
sbc | fa8f43b | 2016-10-05 17:11:35 | [diff] [blame] | 241 | } else { |
tomas.popela | dd765c0 | 2017-03-21 14:44:16 | [diff] [blame] | 242 | sources += [ |
| 243 | "common/chromium-browser/chromium-browser.appdata.xml", |
| 244 | "common/chromium-browser/chromium-browser.info", |
| 245 | ] |
sbc | fa8f43b | 2016-10-05 17:11:35 | [diff] [blame] | 246 | } |
| 247 | |
Tom Anderson | 4312d5e | 2017-06-22 21:07:43 | [diff] [blame] | 248 | sources += [ "//third_party/eu-strip/bin/eu-strip" ] |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 249 | |
| 250 | outputs = [ |
| 251 | "$root_out_dir/installer/common/{{source_file_part}}", |
| 252 | ] |
| 253 | } |
| 254 | |
| 255 | copy("deb_packaging_files") { |
| 256 | visibility = [ ":*" ] |
| 257 | sources = [ |
| 258 | "debian/build.sh", |
| 259 | "debian/changelog.template", |
| 260 | "debian/control.template", |
| 261 | "debian/debian.menu", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 262 | "debian/postinst", |
| 263 | "debian/postrm", |
| 264 | "debian/prerm", |
| 265 | ] |
| 266 | outputs = [ |
| 267 | "$root_out_dir/installer/debian/{{source_file_part}}", |
| 268 | ] |
| 269 | } |
| 270 | |
| 271 | copy("theme_files") { |
| 272 | visibility = [ ":*" ] |
| 273 | sources = [ |
| 274 | "$branding_dir/BRANDING", |
| 275 | "$branding_dir/linux/product_logo_32.xpm", |
| 276 | "$branding_dir/product_logo_128.png", |
| 277 | "$branding_dir/product_logo_22.png", |
| 278 | "$branding_dir/product_logo_24.png", |
| 279 | "$branding_dir/product_logo_256.png", |
| 280 | "$branding_dir/product_logo_48.png", |
| 281 | "$branding_dir/product_logo_64.png", |
| 282 | "$branding_dir_100/product_logo_16.png", |
| 283 | "$branding_dir_100/product_logo_32.png", |
| 284 | ] |
Tom Anderson | c8ebf27 | 2017-11-17 23:41:33 | [diff] [blame^] | 285 | if (is_chrome_branded) { |
| 286 | sources += [ |
| 287 | "$branding_dir/linux/product_logo_32_beta.xpm", |
| 288 | "$branding_dir/linux/product_logo_32_dev.xpm", |
| 289 | "$branding_dir/product_logo_128_beta.png", |
| 290 | "$branding_dir/product_logo_128_dev.png", |
| 291 | "$branding_dir/product_logo_22_beta.png", |
| 292 | "$branding_dir/product_logo_22_dev.png", |
| 293 | "$branding_dir/product_logo_24_beta.png", |
| 294 | "$branding_dir/product_logo_24_dev.png", |
| 295 | "$branding_dir/product_logo_256_beta.png", |
| 296 | "$branding_dir/product_logo_256_dev.png", |
| 297 | "$branding_dir/product_logo_48_beta.png", |
| 298 | "$branding_dir/product_logo_48_dev.png", |
| 299 | "$branding_dir/product_logo_64_beta.png", |
| 300 | "$branding_dir/product_logo_64_dev.png", |
| 301 | "$branding_dir_100/product_logo_16_beta.png", |
| 302 | "$branding_dir_100/product_logo_16_dev.png", |
| 303 | "$branding_dir_100/product_logo_32_beta.png", |
| 304 | "$branding_dir_100/product_logo_32_dev.png", |
| 305 | ] |
| 306 | } |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 307 | outputs = [ |
| 308 | "$root_out_dir/installer/theme/{{source_file_part}}", |
| 309 | ] |
| 310 | } |
| 311 | |
| 312 | if (!is_chromeos) { |
| 313 | copy("rpm_packaging_files") { |
| 314 | visibility = [ ":*" ] |
| 315 | sources = [ |
| 316 | "rpm/build.sh", |
| 317 | "rpm/chrome.spec.template", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 318 | ] |
| 319 | outputs = [ |
| 320 | "$root_out_dir/installer/rpm/{{source_file_part}}", |
| 321 | ] |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | process_version("save_build_info") { |
| 326 | # Just output the default version info variables (no template). |
| 327 | process_only = true |
raphael.kubo.da.costa | dc683d2 | 2016-09-17 19:41:13 | [diff] [blame] | 328 | sources = [ |
| 329 | "//build/util/LASTCHANGE", |
| 330 | "//chrome/VERSION", |
| 331 | branding_file_path, |
| 332 | ] |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 333 | output = "$root_out_dir/installer/version.txt" |
| 334 | } |
| 335 | |
| 336 | # Dependencies for all Linux installer targets. |
| 337 | group("installer_deps") { |
mcgrathr | 6edf192f | 2015-10-19 19:39:11 | [diff] [blame] | 338 | # Though many of these things appear in data_deps further down the |
| 339 | # dependency chain, they must appear here as public_deps so that they can |
| 340 | # be listed as inputs to the actions that depend on ":installer_deps" |
| 341 | # and are guaranteed to have been built before those actions run. |
| 342 | |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 343 | public_deps = [ |
| 344 | ":common_packaging_files", |
| 345 | ":deb_packaging_files", |
| 346 | ":save_build_info", |
Tom Anderson | ce16a0c | 2017-09-02 00:27:51 | [diff] [blame] | 347 | ":strip_chrome_binary", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 348 | ":theme_files", |
| 349 | "//chrome", |
| 350 | "//chrome:packed_resources", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 351 | "//sandbox/linux:chrome_sandbox", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 352 | ] |
dpranke | 3b87061 | 2015-09-10 23:42:04 | [diff] [blame] | 353 | if (enable_nacl) { |
mcgrathr | 6edf192f | 2015-10-19 19:39:11 | [diff] [blame] | 354 | public_deps += [ |
brettw | f4b4a428 | 2015-12-16 00:41:13 | [diff] [blame] | 355 | "//components/nacl/loader:nacl_helper", |
mcgrathr | 6edf192f | 2015-10-19 19:39:11 | [diff] [blame] | 356 | |
| 357 | # These are data_deps of nacl_helper, but that is not enough, |
| 358 | # as explained above. |
| 359 | "//native_client/src/trusted/service_runtime/linux:bootstrap", |
| 360 | "//ppapi/native_client:irt", |
| 361 | ] |
dpranke | 3b87061 | 2015-09-10 23:42:04 | [diff] [blame] | 362 | } |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 363 | if (current_cpu == "x86" || current_cpu == "x64") { |
| 364 | public_deps += [ |
| 365 | "//third_party/widevine/cdm:widevinecdm", |
| 366 | "//third_party/widevine/cdm:widevinecdmadapter", |
| 367 | ] |
| 368 | } |
| 369 | if (!is_chromeos) { |
| 370 | public_deps += [ ":rpm_packaging_files" ] |
| 371 | } |
Tom Anderson | 45583c7 | 2017-07-08 02:53:34 | [diff] [blame] | 372 | |
Tom Anderson | 45583c7 | 2017-07-08 02:53:34 | [diff] [blame] | 373 | if (!libcpp_is_static && use_custom_libcxx) { |
| 374 | public_deps += [ "//buildtools/third_party/libc++:libc++" ] |
| 375 | } |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | # Creates .deb and .rpm (RPM for non-ChromeOS only) installer packages. |
| 379 | # |
| 380 | # channel: |
| 381 | # Name of the channel. |
| 382 | template("linux_package") { |
| 383 | assert(defined(invoker.channel)) |
| 384 | channel = invoker.channel |
| 385 | |
| 386 | if (current_cpu == "x86") { |
mcgrathr | 6edf192f | 2015-10-19 19:39:11 | [diff] [blame] | 387 | # The shell scripts use "ia32" instead of "x86". |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 388 | build_script_arch = "ia32" |
| 389 | } else { |
| 390 | build_script_arch = current_cpu |
| 391 | } |
| 392 | |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 393 | deb_target_name = "${target_name}_deb" |
| 394 | action(deb_target_name) { |
| 395 | visibility = [ ":*" ] |
Tom Anderson | 2bb2b38 | 2017-09-26 20:21:53 | [diff] [blame] | 396 | script = "//build/gn_run_binary.py" |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 397 | |
| 398 | if (current_cpu == "x86") { |
| 399 | deb_arch = "i386" |
| 400 | } else if (current_cpu == "x64") { |
| 401 | deb_arch = "amd64" |
| 402 | } else if (current_cpu == "arm") { |
| 403 | deb_arch = "arm" |
Milko Leporis | 0f74ee8 | 2017-10-02 22:37:07 | [diff] [blame] | 404 | } else if (current_cpu == "mipsel") { |
| 405 | deb_arch = "mipsel" |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 406 | } else { |
| 407 | assert(false, "Linux installer not configured for this architecture.") |
| 408 | } |
| 409 | |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 410 | inputs = packaging_files |
Tom Anderson | fa4860c | 2017-09-15 23:23:40 | [diff] [blame] | 411 | if (is_chrome_branded) { |
| 412 | package = "google-chrome" |
| 413 | } else { |
| 414 | package = "chromium-browser" |
| 415 | } |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 416 | outputs = [ |
Tom Anderson | fa4860c | 2017-09-15 23:23:40 | [diff] [blame] | 417 | "$root_out_dir/${package}-${channel}_${chrome_version_full}-1_${deb_arch}.deb", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 418 | ] |
| 419 | |
| 420 | args = [ |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 421 | rebase_path("$root_out_dir/installer/debian/build.sh", root_build_dir), |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 422 | "-a", |
| 423 | build_script_arch, |
Tom Anderson | cae008e | 2017-09-01 01:47:35 | [diff] [blame] | 424 | "-b", |
| 425 | rebase_path(root_out_dir, root_build_dir), |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 426 | "-c", |
| 427 | invoker.channel, |
| 428 | "-d", |
| 429 | branding_path_component, |
Tom Anderson | cae008e | 2017-09-01 01:47:35 | [diff] [blame] | 430 | "-o", |
| 431 | rebase_path(root_out_dir, root_build_dir), |
thomasanderson | 7a01af4 | 2016-10-18 21:22:42 | [diff] [blame] | 432 | "-s", |
| 433 | rebase_path(sysroot), |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 434 | ] |
Tom Anderson | cae008e | 2017-09-01 01:47:35 | [diff] [blame] | 435 | if (is_official_build) { |
| 436 | args += [ "-f" ] |
| 437 | } |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 438 | deps = [ |
| 439 | ":installer_deps", |
Tom Anderson | 21254bb | 2017-09-07 04:07:18 | [diff] [blame] | 440 | ":merge_deb_dependencies", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 441 | ] |
| 442 | } |
| 443 | |
| 444 | if (!is_chromeos) { |
| 445 | rpm_target_name = "${target_name}_rpm" |
| 446 | action(rpm_target_name) { |
| 447 | visibility = [ ":*" ] |
Tom Anderson | 2bb2b38 | 2017-09-26 20:21:53 | [diff] [blame] | 448 | script = "//build/gn_run_binary.py" |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 449 | |
| 450 | if (current_cpu == "x86") { |
| 451 | rpm_arch = "i386" |
| 452 | } else if (current_cpu == "x64") { |
| 453 | rpm_arch = "x86_64" |
| 454 | } else if (current_cpu == "arm") { |
| 455 | rpm_arch = "arm" |
Milko Leporis | 0f74ee8 | 2017-10-02 22:37:07 | [diff] [blame] | 456 | } else if (current_cpu == "mipsel") { |
| 457 | rpm_arch = "mipsel" |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 458 | } else { |
| 459 | assert(false, "Linux installer not configured for this architecture.") |
| 460 | } |
| 461 | |
Tom Anderson | e068dcb | 2017-09-01 18:31:21 | [diff] [blame] | 462 | inputs = packaging_files |
Tom Anderson | fa4860c | 2017-09-15 23:23:40 | [diff] [blame] | 463 | if (is_chrome_branded) { |
| 464 | package = "google-chrome" |
| 465 | } else { |
| 466 | package = "chromium-browser" |
| 467 | } |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 468 | outputs = [ |
Tom Anderson | fa4860c | 2017-09-15 23:23:40 | [diff] [blame] | 469 | "$root_out_dir/${package}-${channel}-${chrome_version_full}-1.${rpm_arch}.rpm", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 470 | ] |
| 471 | |
| 472 | args = [ |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 473 | rebase_path("$root_out_dir/installer/rpm/build.sh", root_build_dir), |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 474 | "-a", |
| 475 | build_script_arch, |
Tom Anderson | cae008e | 2017-09-01 01:47:35 | [diff] [blame] | 476 | "-b", |
| 477 | rebase_path(root_out_dir, root_build_dir), |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 478 | "-c", |
| 479 | invoker.channel, |
| 480 | "-d", |
| 481 | branding_path_component, |
Tom Anderson | cae008e | 2017-09-01 01:47:35 | [diff] [blame] | 482 | "-o", |
| 483 | rebase_path(root_out_dir, root_build_dir), |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 484 | ] |
Tom Anderson | cae008e | 2017-09-01 01:47:35 | [diff] [blame] | 485 | if (is_official_build) { |
| 486 | args += [ "-f" ] |
| 487 | } |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 488 | deps = [ |
| 489 | ":installer_deps", |
Tom Anderson | 3a3c588 | 2017-09-12 21:16:24 | [diff] [blame] | 490 | ":merge_rpm_dependencies", |
brettw | a874dcc | 2015-08-28 23:59:18 | [diff] [blame] | 491 | ] |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | group(target_name) { |
| 496 | deps = [ |
| 497 | ":$deb_target_name", |
| 498 | ] |
| 499 | if (!is_chromeos) { |
| 500 | deps += [ ":$rpm_target_name" ] |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | # Standard packages. |
| 506 | linux_package("stable") { |
| 507 | channel = "stable" |
| 508 | } |
| 509 | linux_package("beta") { |
| 510 | channel = "beta" |
| 511 | } |
| 512 | linux_package("unstable") { |
| 513 | channel = "unstable" |
| 514 | } |