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.
5 import("//build/config/chrome_build.gni")
6 import("//build/util/version.gni")
7 import("//chrome/version.gni")
9 assert(is_linux && is_chrome_branded)
11 # This target builds all "normal" Linux installers.
12 # GYP version: chrome/chrome_installer.gypi:linux_packages_all
14 # The bot setup is to build stable, unstable, and beta packages for the current
15 # build. Then a later step picks up the package corresponding to what the
16 # current build is supposed to be. This is wasteful since one build will only
17 # be one of these. This build file also has targets for trunk and possibly asan
20 # TODO it would be much nicer to have a build variable so the bot can tell us
21 # what the current build should be, so we only have to make one .deb/.rpm pair.
24 # TO BUILD LINUX INSTALLER PACKAGES
26 # The packages list the exact versions of each library used. The versions used
27 # on the bots are likely different than those on your workstation, so you'll
28 # get a stream of errors like:
29 # < libasound2 (>= 1.0.23)
31 # > libasound2 (>= 1.0.16)
33 # To avoid these warnings for testing purposes, do:
35 # export IGNORE_DEPS_CHANGES=1
46 branding_dir = "//chrome/app/theme/$branding_path_component"
48 "//chrome/app/theme/default_100_percent/$branding_path_component"
50 copy("common_packaging_files") {
54 "common/default-app-block.template",
55 "common/default-app.template",
56 "common/desktop.template",
57 "common/google-chrome/google-chrome.info",
58 "common/installer.include",
59 "common/postinst.include",
60 "common/prerm.include",
63 "common/rpmrepo.cron",
64 "common/symlinks.include",
65 "common/variables.include",
69 if (current_cpu == "x86") {
70 sources += [ "//build/linux/bin/eu-strip" ]
71 } else if (current_cpu == "x64") {
72 sources += [ "/usr/bin/eu-strip" ]
76 "$root_out_dir/installer/common/{{source_file_part}}",
80 copy("deb_packaging_files") {
84 "debian/changelog.template",
85 "debian/control.template",
87 "debian/expected_deps_ia32",
88 "debian/expected_deps_x64",
94 "$root_out_dir/installer/debian/{{source_file_part}}",
101 "$branding_dir/BRANDING",
102 "$branding_dir/linux/product_logo_32.xpm",
103 "$branding_dir/product_logo_128.png",
104 "$branding_dir/product_logo_22.png",
105 "$branding_dir/product_logo_24.png",
106 "$branding_dir/product_logo_256.png",
107 "$branding_dir/product_logo_48.png",
108 "$branding_dir/product_logo_64.png",
109 "$branding_dir_100/product_logo_16.png",
110 "$branding_dir_100/product_logo_32.png",
113 "$root_out_dir/installer/theme/{{source_file_part}}",
118 copy("rpm_packaging_files") {
119 visibility = [ ":*" ]
122 "rpm/chrome.spec.template",
123 "rpm/expected_deps_i386",
124 "rpm/expected_deps_x86_64",
127 "$root_out_dir/installer/rpm/{{source_file_part}}",
132 process_version("save_build_info") {
133 # Just output the default version info variables (no template).
135 output = "$root_out_dir/installer/version.txt"
138 # Dependencies for all Linux installer targets.
139 group("installer_deps") {
141 ":common_packaging_files",
142 ":deb_packaging_files",
146 "//chrome:packed_resources",
147 "//components/nacl:nacl_helper",
148 "//sandbox/linux:chrome_sandbox",
149 "//third_party/adobe/flash:flapper_binaries",
151 if (current_cpu == "x86" || current_cpu == "x64") {
153 "//third_party/widevine/cdm:widevinecdm",
154 "//third_party/widevine/cdm:widevinecdmadapter",
158 public_deps += [ ":rpm_packaging_files" ]
162 # Creates .deb and .rpm (RPM for non-ChromeOS only) installer packages.
165 # Name of the channel.
166 template("linux_package") {
167 assert(defined(invoker.channel))
168 channel = invoker.channel
170 if (current_cpu == "x86") {
171 # The shell scruipts use "ia32" instead of "x86".
172 build_script_arch = "ia32"
174 build_script_arch = current_cpu
177 packaging_files_binaries = [
178 # TODO(mmoss) Any convenient way to get all the relevant build
179 # files? (e.g. all locales, resources, etc.)
180 "$root_out_dir/chrome",
181 "$root_out_dir/chrome_sandbox",
182 "$root_out_dir/xdg-mime",
183 "$root_out_dir/xdg-settings",
184 "$root_out_dir/locales/en-US.pak",
186 #"$root_out_dir/nacl_helper", TODO(GYP) NaCl support.
187 #"$root_out_dir/nacl_helper_bootstrap", TODO(GYP) NaCl support.
188 "$root_out_dir/PepperFlash/libpepflashplayer.so",
189 "$root_out_dir/PepperFlash/manifest.json",
192 if (current_cpu == "x86") {
193 packaging_files_binaries += [
194 #"$root_out_dir/nacl_irt_x86_32.nexe", TODO(GYP) NaCl support.
195 "$root_out_dir/libwidevinecdmadapter.so",
196 "$root_out_dir/libwidevinecdm.so",
198 } else if (current_cpu == "x64") {
199 packaging_files_binaries += [
200 #"$root_out_dir/nacl_irt_x86_64.nexe", TODO(GYP) NaCl support.
201 "$root_out_dir/libwidevinecdmadapter.so",
202 "$root_out_dir/libwidevinecdm.so",
206 packaging_files_binaries += [ "$root_out_dir/lib/libc++.so" ]
209 deb_target_name = "${target_name}_deb"
210 action(deb_target_name) {
211 visibility = [ ":*" ]
212 script = "flock_make_package.py"
214 if (current_cpu == "x86") {
216 } else if (current_cpu == "x64") {
218 } else if (current_cpu == "arm") {
221 assert(false, "Linux installer not configured for this architecture.")
224 inputs = packaging_files_binaries
226 "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1_${deb_arch}.deb",
230 rebase_path("$root_out_dir/linux_package.lock", root_build_dir),
231 rebase_path("$root_out_dir/installer/debian/build.sh", root_build_dir),
233 rebase_path(root_out_dir, root_build_dir),
235 rebase_path(root_out_dir, root_build_dir),
241 branding_path_component,
249 rpm_target_name = "${target_name}_rpm"
250 action(rpm_target_name) {
251 visibility = [ ":*" ]
252 script = "flock_make_package.py"
254 if (current_cpu == "x86") {
256 } else if (current_cpu == "x64") {
258 } else if (current_cpu == "arm") {
261 assert(false, "Linux installer not configured for this architecture.")
264 inputs = packaging_files_binaries
266 "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1.${rpm_arch}.rpm",
270 rebase_path("$root_out_dir/linux_package.lock", root_build_dir),
271 rebase_path("$root_out_dir/installer/rpm/build.sh", root_build_dir),
273 rebase_path(root_out_dir, root_build_dir),
275 rebase_path(root_out_dir, root_build_dir),
281 branding_path_component,
294 deps += [ ":$rpm_target_name" ]
300 linux_package("stable") {
303 linux_package("beta") {
306 linux_package("unstable") {
310 # Other packages that we support that aren't included in the default "linux"
312 linux_package("trunk") {
316 linux_package("asan") {