Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: chrome/installer/linux/BUILD.gn

Issue 1311543003: Add Linux build packaging targets to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
5 import("//build/config/chrome_build.gni")
6 import("//build/util/version.gni")
7 import("//chrome/version.gni")
8
9 assert(is_linux && is_chrome_branded)
10
11 # This target builds all "normal" Linux installers.
12 # GYP version: chrome/chrome_installer.gypi:linux_packages_all
13 #
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
18 # installers.
19 #
20 # TODO it would be much nicer to have a build variable so the bot can tell us
Lei Zhang 2015/08/28 23:17:02 With gyp, there's separate targets for the combina
brettw 2015/08/28 23:31:41 Yes, in GN you can reference whatever ones you act
21 # what the current build should be, so we only have to make one .deb/.rpm pair.
22 #
23 #
24 # TO BUILD LINUX INSTALLER PACKAGES
25 #
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)
30 # ---
31 # > libasound2 (>= 1.0.16)
32 #
33 # To avoid these warnings for testing purposes, do:
34 #
35 # export IGNORE_DEPS_CHANGES=1
36 #
37 # before you build.
38 group("linux") {
39 deps = [
40 ":beta",
41 ":stable",
42 ":unstable",
43 ]
44 }
45
46 branding_dir = "//chrome/app/theme/$branding_path_component"
47 branding_dir_100 =
48 "//chrome/app/theme/default_100_percent/$branding_path_component"
49
50 copy("common_packaging_files") {
51 visibility = [ ":*" ]
52 sources = [
53 "common/apt.include",
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",
61 "common/repo.cron",
62 "common/rpm.include",
63 "common/rpmrepo.cron",
64 "common/symlinks.include",
65 "common/variables.include",
66 "common/wrapper",
67 ]
68
69 if (current_cpu == "x86") {
70 sources += [ "//build/linux/bin/eu-strip" ]
71 } else if (current_cpu == "x64") {
72 sources += [ "/usr/bin/eu-strip" ]
73 }
74
75 outputs = [
76 "$root_out_dir/installer/common/{{source_file_part}}",
77 ]
78 }
79
80 copy("deb_packaging_files") {
81 visibility = [ ":*" ]
82 sources = [
83 "debian/build.sh",
84 "debian/changelog.template",
85 "debian/control.template",
86 "debian/debian.menu",
87 "debian/expected_deps_ia32",
88 "debian/expected_deps_x64",
89 "debian/postinst",
90 "debian/postrm",
91 "debian/prerm",
92 ]
93 outputs = [
94 "$root_out_dir/installer/debian/{{source_file_part}}",
95 ]
96 }
97
98 copy("theme_files") {
99 visibility = [ ":*" ]
100 sources = [
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",
111 ]
112 outputs = [
113 "$root_out_dir/installer/theme/{{source_file_part}}",
114 ]
115 }
116
117 if (!is_chromeos) {
118 copy("rpm_packaging_files") {
119 visibility = [ ":*" ]
120 sources = [
121 "rpm/build.sh",
122 "rpm/chrome.spec.template",
123 "rpm/expected_deps_i386",
124 "rpm/expected_deps_x86_64",
125 ]
126 outputs = [
127 "$root_out_dir/installer/rpm/{{source_file_part}}",
128 ]
129 }
130 }
131
132 process_version("save_build_info") {
133 # Just output the default version info variables (no template).
134 process_only = true
135 output = "$root_out_dir/installer/version.txt"
136 }
137
138 # Dependencies for all Linux installer targets.
139 group("installer_deps") {
140 public_deps = [
141 ":common_packaging_files",
142 ":deb_packaging_files",
143 ":save_build_info",
144 ":theme_files",
145 "//chrome",
146 "//chrome:packed_resources",
147 "//components/nacl:nacl_helper",
148 "//sandbox/linux:chrome_sandbox",
149 "//third_party/adobe/flash:flapper_binaries",
150 ]
151 if (current_cpu == "x86" || current_cpu == "x64") {
152 public_deps += [
153 "//third_party/widevine/cdm:widevinecdm",
154 "//third_party/widevine/cdm:widevinecdmadapter",
155 ]
156 }
157 if (!is_chromeos) {
158 public_deps += [ ":rpm_packaging_files" ]
159 }
160 }
161
162 # Creates .deb and .rpm (RPM for non-ChromeOS only) installer packages.
163 #
164 # channel:
165 # Name of the channel.
166 template("linux_package") {
167 assert(defined(invoker.channel))
168 channel = invoker.channel
169
170 if (current_cpu == "x86") {
171 # The shell scruipts use "ia32" instead of "x86".
172 build_script_arch = "ia32"
173 } else {
174 build_script_arch = current_cpu
175 }
176
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",
185
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",
190 ]
191
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",
197 ]
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",
203 ]
204 }
205 if (is_asan) {
206 packaging_files_binaries += [ "$root_out_dir/lib/libc++.so" ]
207 }
208
209 deb_target_name = "${target_name}_deb"
210 action(deb_target_name) {
211 visibility = [ ":*" ]
212 script = "flock_make_package.py"
213
214 if (current_cpu == "x86") {
215 deb_arch = "i386"
216 } else if (current_cpu == "x64") {
217 deb_arch = "amd64"
218 } else if (current_cpu == "arm") {
219 deb_arch = "arm"
220 } else {
221 assert(false, "Linux installer not configured for this architecture.")
222 }
223
224 inputs = packaging_files_binaries
225 outputs = [
226 "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1_${deb_arc h}.deb",
227 ]
228
229 args = [
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),
232 "-o",
233 rebase_path(root_out_dir, root_build_dir),
234 "-b",
235 rebase_path(root_out_dir, root_build_dir),
236 "-a",
237 build_script_arch,
238 "-c",
239 invoker.channel,
240 "-d",
241 branding_path_component,
242 ]
243 deps = [
244 ":installer_deps",
245 ]
246 }
247
248 if (!is_chromeos) {
249 rpm_target_name = "${target_name}_rpm"
250 action(rpm_target_name) {
251 visibility = [ ":*" ]
252 script = "flock_make_package.py"
253
254 if (current_cpu == "x86") {
255 rpm_arch = "i386"
256 } else if (current_cpu == "x64") {
257 rpm_arch = "x86_64"
258 } else if (current_cpu == "arm") {
259 rpm_arch = "arm"
260 } else {
261 assert(false, "Linux installer not configured for this architecture.")
262 }
263
264 inputs = packaging_files_binaries
265 outputs = [
266 "$root_out_dir/google-chrome-${channel}_${chrome_version_full}-1.${rpm_a rch}.rpm",
267 ]
268
269 args = [
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),
272 "-o",
273 rebase_path(root_out_dir, root_build_dir),
274 "-b",
275 rebase_path(root_out_dir, root_build_dir),
276 "-a",
277 build_script_arch,
278 "-c",
279 invoker.channel,
280 "-d",
281 branding_path_component,
282 ]
283 deps = [
284 ":installer_deps",
285 ]
286 }
287 }
288
289 group(target_name) {
290 deps = [
291 ":$deb_target_name",
292 ]
293 if (!is_chromeos) {
294 deps += [ ":$rpm_target_name" ]
295 }
296 }
297 }
298
299 # Standard packages.
300 linux_package("stable") {
301 channel = "stable"
302 }
303 linux_package("beta") {
304 channel = "beta"
305 }
306 linux_package("unstable") {
307 channel = "unstable"
308 }
309
310 # Other packages that we support that aren't included in the default "linux"
311 # target.
312 linux_package("trunk") {
313 channel = "trunk"
314 }
315 if (is_asan) {
316 linux_package("asan") {
317 channel = "asan"
318 }
319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698