Skip to content

Commit

Permalink
Add Linux build packaging targets to GN
Browse files Browse the repository at this point in the history
Changes the version processing templates to not implicitly include the chrome version .rc file. This was something I've been meaning to do for a while which was forced by this patch, because it wants to call version.py with no sources or template file. I also had to remove some checks that either a template file or sources were defined (I wasn't aware this was valid to do when I wrote these checks).

The above-mentioned change necessitated referencing the version template file from a number of existing calls.

The version script now explicitly sets the output file with -o. Previously this was the implicit second argument, but this didn't work if there was no template file. -o is the same and it's better to be more explicit anyway.

Added copy rules for xdg-mime related scripts which are required by the installer.

Added a meta "installer" target which links to the Linux installers. This will also be a good place to hook up the Windows installer when we write it.

BUG=525839
TBR=thestig@chromium.org (linux installer), ddorwin@chromium.org (widevine)

Review URL: https://codereview.chromium.org/1311543003

Cr-Commit-Position: refs/heads/master@{#346279}
  • Loading branch information
brettw authored and Commit bot committed Aug 28, 2015
1 parent b145264 commit a874dcc
Show file tree
Hide file tree
Showing 13 changed files with 432 additions and 24 deletions.
3 changes: 2 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ group("both_gn_and_gyp") {
testonly = true
deps = [
"//base:base_unittests",
"//sql:sql_unittests",
"//chrome/installer",
"//net:net_unittests",
"//skia:skia_unittests",
"//sql:sql_unittests",
"//ui/base:ui_base_unittests",
"//url:url_unittests",
]
Expand Down
8 changes: 8 additions & 0 deletions build/config/chrome_build.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ declare_args() {
# on Windows.
is_multi_dll_chrome = is_win && !is_component_build
}

# Refers to the subdirectory for branding in various places including
# chrome/app/theme.
if (is_chrome_branded) {
branding_path_component = "google_chrome"
} else {
branding_path_component = "chromium"
}
36 changes: 30 additions & 6 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if (!is_android) {
"app/chrome_exe_resource.h",
]
defines = []
public_deps = []
deps = []

data = [
Expand Down Expand Up @@ -143,6 +144,9 @@ if (!is_android) {
"//chrome/installer/util",
"//content/public/app:both",
]
public_deps = [
":xdg_mime", # Needs to be public for installer to consume files.
]

# Needed for chrome_main.cc initialization of libraries.
configs += [ "//build/config/linux:pangocairo" ]
Expand All @@ -164,7 +168,7 @@ if (!is_android) {
# TODO(GYP) lots more stuff in the is_mac block.
} else { # Non-Mac.
# These files are used by the installer so we need a public dep.
public_deps = [
public_deps += [
":packed_extra_resources",
":packed_resources",
]
Expand Down Expand Up @@ -388,13 +392,15 @@ if (is_win) {
}

process_version("chrome_exe_version") {
template_file = chrome_version_rc_template
sources = [
"app/chrome_exe.ver",
]
output = "$target_gen_dir/chrome_exe_version.rc"
}

process_version("chrome_dll_version") {
template_file = chrome_version_rc_template
sources = [
"app/chrome_dll.ver",
]
Expand All @@ -411,13 +417,15 @@ if (is_win) {
}

process_version("nacl64_exe_version") {
template_file = chrome_version_rc_template
sources = [
"app/nacl64_exe.ver",
]
output = "$target_gen_dir/nacl64_exe_version.rc"
}

process_version("other_version") {
template_file = chrome_version_rc_template
sources = [
"app/other.ver",
]
Expand Down Expand Up @@ -496,29 +504,32 @@ if (is_chrome_branded) {
outputs = [
"$root_out_dir/default_apps/{{source_file_part}}",
]

# Force anybody that depends on this to get the default apps as data files.
data = process_file_template(sources, outputs)
}
}

group("packed_resources") {
deps = [
public_deps = [
":repack_locales_pack",
":repack_pseudo_locales_pack",
":repack_chrome_100_percent",
]

if (is_chrome_branded) {
deps += [ ":default_apps" ]
public_deps += [ ":default_apps" ]
}

if (enable_hidpi) {
deps += [ ":repack_chrome_200_percent" ]
public_deps += [ ":repack_chrome_200_percent" ]
}

if (enable_topchrome_md) {
deps += [ ":repack_chrome_material_100_percent" ]
public_deps += [ ":repack_chrome_material_100_percent" ]

if (enable_hidpi) {
deps += [ ":repack_chrome_material_200_percent" ]
public_deps += [ ":repack_chrome_material_200_percent" ]
}
}
}
Expand Down Expand Up @@ -949,4 +960,17 @@ if (is_linux) {
dump_syms_label,
]
}

# Copies some scripts and resources that are used for desktop integration.
copy("xdg_mime") {
sources = [
"//chrome/app/theme/$branding_path_component/product_logo_48.png",
"//chrome/tools/build/linux/chrome-wrapper",
"//third_party/xdg-utils/scripts/xdg-mime",
"//third_party/xdg-utils/scripts/xdg-settings",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}
19 changes: 19 additions & 0 deletions chrome/chrome_installer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -512,25 +512,29 @@
# we only create packages for official builds.
'copies': [
{
# GN version: //chrome/installer/linux:deb_packaging_files
'destination': '<(PRODUCT_DIR)/installer/debian/',
'files': [
'<@(packaging_files_deb)',
]
},
{
# GN version: //chrome/installer/linux:rpm_packaging_files
'destination': '<(PRODUCT_DIR)/installer/rpm/',
'files': [
'<@(packaging_files_rpm)',
]
},
{
# GN version: //chrome/installer/linux:common_packaging_files
'destination': '<(PRODUCT_DIR)/installer/common/',
'files': [
'<@(packaging_files_common)',
]
},
# Additional theme resources needed for package building.
{
# GN version: //chrome/installer/linux:theme_files
'destination': '<(PRODUCT_DIR)/installer/theme/',
'files': [
'<(branding_dir)/linux/product_logo_32.xpm',
Expand All @@ -548,6 +552,7 @@
],
'actions': [
{
# GN version: //chrome/installer/linux:save_build_info
'action_name': 'save_build_info',
'inputs': [
'<(branding_dir)/BRANDING',
Expand All @@ -569,6 +574,7 @@
],
},
{
# GN version: //chrome/installer/linux
'target_name': 'linux_packages_all',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -615,6 +621,7 @@
],
},
{
# GN version: //chrome/installer/linux:unstable
'target_name': 'linux_packages_unstable',
'suppress_wildcard': 1,
'type': 'none',
Expand All @@ -631,6 +638,7 @@
],
},
{
# GN version: //chrome/installer/linux:beta
'target_name': 'linux_packages_beta',
'suppress_wildcard': 1,
'type': 'none',
Expand All @@ -647,6 +655,7 @@
],
},
{
# GN version: //chrome/installer/linux:stable
'target_name': 'linux_packages_stable',
'suppress_wildcard': 1,
'type': 'none',
Expand All @@ -665,6 +674,7 @@
# TODO(mmoss) gyp looping construct would be handy here ...
# These package actions are the same except for the 'channel' variable.
{
# GN version: //chrome/installer/linux:asan
'target_name': 'linux_packages_asan_deb',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -693,6 +703,7 @@
],
},
{
# GN version: //chrome/installer/linux:trunk
'target_name': 'linux_packages_trunk_deb',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -721,6 +732,7 @@
],
},
{
# GN version: //chrome/installer/linux:unstable
'target_name': 'linux_packages_unstable_deb',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -749,6 +761,7 @@
],
},
{
# GN version: //chrome/installer/linux:beta
'target_name': 'linux_packages_beta_deb',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -777,6 +790,7 @@
],
},
{
# GN version: //chrome/installer/linux:stable
'target_name': 'linux_packages_stable_deb',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -805,6 +819,7 @@
],
},
{
# GN version: //chrome/installer/linux:asan
'target_name': 'linux_packages_asan_rpm',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -834,6 +849,7 @@
],
},
{
# GN version: //chrome/installer/linux:trunk
'target_name': 'linux_packages_trunk_rpm',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -863,6 +879,7 @@
],
},
{
# GN version: //chrome/installer/linux:unstable
'target_name': 'linux_packages_unstable_rpm',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -892,6 +909,7 @@
],
},
{
# GN version: //chrome/installer/linux:beta
'target_name': 'linux_packages_beta_rpm',
'suppress_wildcard': 1,
'type': 'none',
Expand Down Expand Up @@ -921,6 +939,7 @@
],
},
{
# GN version: //chrome/installer/linux:stable
'target_name': 'linux_packages_stable_rpm',
'suppress_wildcard': 1,
'type': 'none',
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_watcher/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ source_set("client") {
}

process_version("chrome_watcher_resources") {
template_file = chrome_version_rc_template
sources = [
"chrome_watcher.ver",
]
Expand Down
14 changes: 14 additions & 0 deletions chrome/installer/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chrome_build.gni")

# Meta-target that forwards to the installer of the correct type (if any).
group("installer") {
if (is_linux && is_chrome_branded) {
deps = [
"//chrome/installer/linux",
]
}
}
Loading

0 comments on commit a874dcc

Please sign in to comment.