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/config/features.gni")
7 import("//build/config/sanitizers/sanitizers.gni")
8 import("//build/util/version.gni")
9 import("//chrome/version.gni")
11 assert(is_linux && is_chrome_branded)
13 # This target builds all "normal" Linux installers.
14 # GYP version: chrome/chrome_installer.gypi:linux_packages_all
16 # The bot setup is to build stable, unstable, and beta packages for the current
17 # build. Then a later step picks up the package corresponding to what the
18 # current build is supposed to be. This is wasteful since one build will only
19 # be one of these. This build file also has targets for trunk and possibly asan
22 # TODO it would be much nicer to have a build variable so the bot can tell us
23 # what the current build should be, so we only have to make one .deb/.rpm pair.
26 # TO BUILD LINUX INSTALLER PACKAGES
28 # The packages list the exact versions of each library used. The versions used
29 # on the bots are likely different than those on your workstation, so you'll
30 # get a stream of errors like:
31 # < libasound2 (>= 1.0.23)
33 # > libasound2 (>= 1.0.16)
35 # To avoid these warnings for testing purposes, do:
37 # export IGNORE_DEPS_CHANGES=1
48 branding_dir = "//chrome/app/theme/$branding_path_component"
50 "//chrome/app/theme/default_100_percent/$branding_path_component"
52 copy("common_packaging_files") {
56 "common/default-app-block.template",
57 "common/default-app.template",
58 "common/desktop.template",
59 "common/google-chrome/google-chrome.info",
60 "common/installer.include",
61 "common/postinst.include",
62 "common/prerm.include",
65 "common/rpmrepo.cron",
66 "common/symlinks.include",
67 "common/variables.include",
71 if (current_cpu == "x86") {
72 sources += [ "//build/linux/bin/eu-strip" ]
73 } else if (current_cpu == "x64") {
74 sources += [ "/usr/bin/eu-strip" ]
78 "$root_out_dir/installer/common/{{source_file_part}}",
82 copy("deb_packaging_files") {
86 "debian/changelog.template",
87 "debian/control.template",
89 "debian/expected_deps_ia32",
90 "debian/expected_deps_x64",
96 "$root_out_dir/installer/debian/{{source_file_part}}",
100 copy("theme_files") {
101 visibility = [ ":*" ]
103 "$branding_dir/BRANDING",
104 "$branding_dir/linux/product_logo_32.xpm",
105 "$branding_dir/product_logo_128.png",
106 "$branding_dir/product_logo_22.png",
107 "$branding_dir/product_logo_24.png",
108 "$branding_dir/product_logo_256.png",
109 "$branding_dir/product_logo_48.png",
110 "$branding_dir/product_logo_64.png",
111 "$branding_dir_100/product_logo_16.png",
112 "$branding_dir_100/product_logo_32.png",
115 "$root_out_dir/installer/theme/{{source_file_part}}",
120 copy("rpm_packaging_files") {
121 visibility = [ ":*" ]
124 "rpm/chrome.spec.template",
125 "rpm/expected_deps_i386",
126 "rpm/expected_deps_x86_64",
129 "$root_out_dir/installer/rpm/{{source_file_part}}",
134 process_version("save_build_info") {
135 # Just output the default version info variables (no template).
137 output = "$root_out_dir/installer/version.txt"
140 # Dependencies for all Linux installer targets.
141 group("installer_deps") {
143 ":common_packaging_files",
144 ":deb_packaging_files",
148 "//chrome:packed_resources",
149 "//sandbox/linux:chrome_sandbox",
150 "//third_party/adobe/flash:flapper_binaries",
153 public_deps += [ "//components/nacl:nacl_helper" ]
155 if (current_cpu == "x86" || current_cpu == "x64") {
157 "//third_party/widevine/cdm:widevinecdm",
158 "//third_party/widevine/cdm:widevinecdmadapter",
162 public_deps += [ ":rpm_packaging_files" ]
166 # Creates .deb and .rpm (RPM for non-ChromeOS only) installer packages.
169 # Name of the channel.
170 template("linux_package") {
171 assert(defined(invoker.channel))
172 channel = invoker.channel
174 if (current_cpu == "x86") {
175 # The shell scruipts use "ia32" instead of "x86".
176 build_script_arch = "ia32"
178 build_script_arch = current_cpu
181 packaging_files_binaries = [
182 # TODO(mmoss) Any convenient way to get all the relevant build
183 # files? (e.g. all locales, resources, etc.)
184 "$root_out_dir/chrome",
185 "$root_out_dir/chrome_sandbox",
186 "$root_out_dir/xdg-mime",
187 "$root_out_dir/xdg-settings",
188 "$root_out_dir/locales/en-US.pak",
190 #"$root_out_dir/nacl_helper", TODO(GYP) NaCl support.
191 #"$root_out_dir/nacl_helper_bootstrap", TODO(GYP) NaCl support.
192 "$root_out_dir/PepperFlash/libpepflashplayer.so",
193 "$root_out_dir/PepperFlash/manifest.json",
196 if (current_cpu == "x86") {
197 packaging_files_binaries += [
198 #"$root_out_dir/nacl_irt_x86_32.nexe", TODO(GYP) NaCl support.
199 "$root_out_dir/libwidevinecdmadapter.so",
200 "$root_out_dir/libwidevinecdm.so",
202 } else if (current_cpu == "x64") {
203 packaging_files_binaries += [
204 #"$root_out_dir/nacl_irt_x86_64.nexe", TODO(GYP) NaCl support.
205 "$root_out_dir/libwidevinecdmadapter.so",
206 "$root_out_dir/libwidevinecdm.so",
210 packaging_files_binaries += [ "$root_out_dir/lib/libc++.so" ]
213 deb_target_name = "${target_name}_deb"
214 action(deb_target_name) {
215 visibility = [ ":*" ]
216 script = "flock_make_package.py"
218 if (current_cpu == "x86") {
220 } else if (current_cpu == "x64") {
222 } else if (current_cpu == "arm") {
225 assert(false, "Linux installer not configured for this architecture.")
228 inputs = packaging_files_binaries
230 "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1_${deb_arch}.deb",
234 rebase_path("$root_out_dir/linux_package.lock", root_build_dir),
235 rebase_path("$root_out_dir/installer/debian/build.sh", root_build_dir),
237 rebase_path(root_out_dir, root_build_dir),
239 rebase_path(root_out_dir, root_build_dir),
245 branding_path_component,
253 rpm_target_name = "${target_name}_rpm"
254 action(rpm_target_name) {
255 visibility = [ ":*" ]
256 script = "flock_make_package.py"
258 if (current_cpu == "x86") {
260 } else if (current_cpu == "x64") {
262 } else if (current_cpu == "arm") {
265 assert(false, "Linux installer not configured for this architecture.")
268 inputs = packaging_files_binaries
270 "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1.${rpm_arch}.rpm",
274 rebase_path("$root_out_dir/linux_package.lock", root_build_dir),
275 rebase_path("$root_out_dir/installer/rpm/build.sh", root_build_dir),
277 rebase_path(root_out_dir, root_build_dir),
279 rebase_path(root_out_dir, root_build_dir),
285 branding_path_component,
298 deps += [ ":$rpm_target_name" ]
304 linux_package("stable") {
307 linux_package("beta") {
310 linux_package("unstable") {
314 # Other packages that we support that aren't included in the default "linux"
316 linux_package("trunk") {
320 linux_package("asan") {