| # Copyright 2017 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. |
| |
| # TODO(michaelpg): Dedupe with Chrome installer. |
| |
| import("//build/config/c++/c++.gni") |
| import("//build/config/chrome_build.gni") |
| import("//build/config/features.gni") |
| import("//build/config/sanitizers/sanitizers.gni") |
| import("//build/config/sysroot.gni") |
| import("//build/util/version.gni") |
| import("//chrome/process_version_rc_template.gni") # For branding_file_path. |
| import("//extensions/features/features.gni") |
| |
| assert(is_desktop_linux) |
| assert(current_cpu == "x64") |
| assert(enable_extensions, |
| "Cannot depend on extensions because enable_extensions=false.") |
| |
| # The packages list the exact versions of each library used. The versions used |
| # on the bots are likely different than those on your workstation, so you'll |
| # get a stream of errors like: |
| # < libasound2 (>= 1.0.23) |
| # --- |
| # > libasound2 (>= 1.0.16) |
| # |
| # To avoid these warnings for testing purposes, do: |
| # |
| # export IGNORE_DEPS_CHANGES=1 |
| # |
| # before you build. |
| group("linux") { |
| # See the "app_shell_lib" definition for why testonly is needed. |
| testonly = true |
| deps = [ |
| # TODO(michaelpg): Add beta/stable once we verify the unstable installer is |
| # building and installing properly. |
| ":unstable", |
| ] |
| } |
| |
| branding_dir = "//chrome/app/theme/$branding_path_component" |
| |
| copy("common_packaging_files") { |
| visibility = [ ":*" ] |
| sources = [ |
| "//chrome/installer/linux/common/apt.include", |
| "//chrome/installer/linux/common/repo.cron", |
| "//chrome/installer/linux/common/symlinks.include", |
| "//chrome/installer/linux/common/variables.include", |
| "/usr/bin/eu-strip", |
| "common/installer.include", |
| "common/wrapper", |
| ] |
| |
| if (is_chrome_branded) { |
| sources += [ "common/google-app-shell/google-app-shell.info" ] |
| } else { |
| sources += [ "common/chromium-app-shell/chromium-app-shell.info" ] |
| } |
| |
| outputs = [ |
| "$root_out_dir/app_shell_installer/common/{{source_file_part}}", |
| ] |
| } |
| |
| copy("deb_packaging_files") { |
| visibility = [ ":*" ] |
| sources = [ |
| "//chrome/installer/linux/debian/changelog.template", |
| "//chrome/installer/linux/debian/control.template", |
| "debian/build.sh", |
| "debian/expected_deps_x64", |
| "debian/postinst", |
| "debian/postrm", |
| ] |
| outputs = [ |
| "$root_out_dir/app_shell_installer/debian/{{source_file_part}}", |
| ] |
| } |
| |
| copy("theme_files") { |
| visibility = [ ":*" ] |
| sources = [ |
| "$branding_dir/BRANDING", |
| ] |
| outputs = [ |
| "$root_out_dir/app_shell_installer/theme/{{source_file_part}}", |
| ] |
| } |
| |
| process_version("save_build_info") { |
| # Just output the default version info variables (no template). |
| process_only = true |
| sources = [ |
| "//build/util/LASTCHANGE", |
| "//chrome/VERSION", |
| branding_file_path, |
| ] |
| output = "$root_out_dir/app_shell_installer/version.txt" |
| } |
| |
| # Dependencies for all Linux installer targets. |
| group("installer_deps") { |
| testonly = true |
| |
| # Though many of these things appear in data_deps further down the |
| # dependency chain, they must appear here as public_deps so that they can |
| # be listed as inputs to the actions that depend on ":installer_deps" |
| # and are guaranteed to have been built before those actions run. |
| |
| public_deps = [ |
| ":common_packaging_files", |
| ":deb_packaging_files", |
| ":save_build_info", |
| ":theme_files", |
| "//extensions:shell_and_test_pak", |
| "//extensions/shell:app_shell", |
| ] |
| if (enable_nacl) { |
| public_deps += [ |
| "//components/nacl/loader:nacl_helper", |
| |
| # These are data_deps of nacl_helper, but that is not enough, |
| # as explained above. |
| "//native_client/src/trusted/service_runtime/linux:bootstrap", |
| "//ppapi/native_client:irt", |
| ] |
| } |
| |
| if (!libcpp_is_static && use_custom_libcxx) { |
| public_deps += [ "//buildtools/third_party/libc++:libc++" ] |
| } |
| } |
| |
| # Creates .deb installer package. |
| # |
| # channel: |
| # Name of the channel. |
| template("linux_package") { |
| testonly = true |
| assert(defined(invoker.channel)) |
| channel = invoker.channel |
| |
| packaging_files_binaries = [ |
| # TODO(mmoss) Any convenient way to get all the relevant build |
| # files? (e.g. all locales, resources, etc.) |
| "$root_out_dir/app_shell", |
| "$root_out_dir/extensions_shell_and_test.pak", |
| ] |
| |
| if (enable_nacl) { |
| packaging_files_binaries += [ |
| "$root_out_dir/nacl_helper", |
| "$root_out_dir/nacl_helper_bootstrap", |
| "$root_out_dir/nacl_irt_x86_64.nexe", |
| ] |
| } |
| |
| if (!libcpp_is_static && use_custom_libcxx) { |
| packaging_files_binaries += [ "$root_out_dir/libc++.so" ] |
| } |
| |
| deb_target_name = "${target_name}_deb" |
| action(deb_target_name) { |
| visibility = [ ":*" ] |
| script = "//chrome/installer/linux/flock_make_package.py" |
| deb_arch = "amd64" |
| |
| inputs = packaging_files_binaries |
| outputs = [ |
| "$root_out_dir/google-app-shell-${channel}_${chrome_version_full}-1_${deb_arch}.deb", |
| ] |
| |
| args = [ |
| rebase_path("$root_out_dir/linux_package.lock", root_build_dir), |
| rebase_path("$root_out_dir/app_shell_installer/debian/build.sh", |
| root_build_dir), |
| "-o", |
| rebase_path(root_out_dir, root_build_dir), |
| "-b", |
| rebase_path(root_out_dir, root_build_dir), |
| "-a", |
| current_cpu, |
| "-c", |
| invoker.channel, |
| "-d", |
| branding_path_component, |
| "-s", |
| rebase_path(sysroot), |
| ] |
| deps = [ |
| ":installer_deps", |
| ] |
| } |
| |
| group(target_name) { |
| deps = [ |
| ":$deb_target_name", |
| ] |
| } |
| } |
| |
| # Standard packages. |
| linux_package("unstable") { |
| channel = "unstable" |
| } |
| linux_package("stable") { |
| channel = "stable" |
| } |
| linux_package("beta") { |
| channel = "beta" |
| } |
| |
| # Other packages that we support that aren't included in the default "linux" |
| # target. |
| linux_package("trunk") { |
| channel = "trunk" |
| } |
| if (is_asan) { |
| linux_package("asan") { |
| channel = "asan" |
| } |
| } |