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