Commit 8ca5b930 authored by Michael Giuffrida's avatar Michael Giuffrida Committed by Commit Bot

Remove app_shell installer

This installer and app_shell itself are unused.

Bug: 987150
Change-Id: I299a53b2d4090e35c81ff32aeffe717303921c6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716604
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Auto-Submit: Michael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685203}
parent 49bc0d85
......@@ -516,10 +516,7 @@ group("gn_all") {
}
if (enable_extensions) {
deps += [
"//extensions/shell:app_shell",
"//extensions/shell/installer:app_shell_installer",
]
deps += [ "//extensions/shell:app_shell" ]
if (is_desktop_linux && is_official_build) {
deps += [ "//extensions/shell:app_shell_linux_symbols" ]
}
......
# 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.
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/sysroot.gni")
import("//build/config/ui.gni")
import("//build/util/process_version.gni")
import("//extensions/buildflags/buildflags.gni")
assert(enable_extensions)
declare_args() {
enable_app_shell_installer =
is_desktop_linux && current_cpu == "x64" && !is_component_build &&
use_sysroot && !using_sanitizer
}
# Meta-target that forwards to the installer of the correct type (if any).
# Named "app_shell_installer" to not conflict with Chrome's "installer" target.
group("app_shell_installer") {
# See the "app_shell_lib" definition for why testonly is needed.
testonly = true
if (enable_app_shell_installer) {
deps = [
"//extensions/shell/installer/linux",
]
}
}
# 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/lastchange.gni")
import("//build/util/version.gni")
import("//chrome/process_version_rc_template.gni") # For branding_file_path.
import("//components/nacl/features.gni")
import("//extensions/buildflags/buildflags.gni")
assert(is_desktop_linux)
assert(current_cpu == "x64")
assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")
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.
":app_shell_unstable",
]
}
branding_dir = "//chrome/app/theme/$branding_path_component"
action("strip_app_shell_binary") {
testonly = true
prog_name = "$root_out_dir/app_shell"
debug_file = prog_name + ".debug"
stripped_file = prog_name + ".stripped"
deps = [
"//extensions/shell:app_shell",
]
script = "//build/gn_run_binary.py"
sources = [
prog_name,
]
outputs = [
debug_file,
stripped_file,
]
args = [
rebase_path("//buildtools/third_party/eu-strip/bin/eu-strip",
root_build_dir),
"-o",
rebase_path(stripped_file, root_build_dir),
"-f",
rebase_path(debug_file, root_build_dir),
rebase_path(prog_name, root_build_dir),
]
}
copy("common_packaging_files") {
visibility = [ ":*" ]
sources = [
"//buildtools/third_party/eu-strip/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",
]
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 = [
"//chrome/VERSION",
branding_file_path,
lastchange_file,
]
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",
]
}
}
# 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",
]
}
deb_target_name = "${target_name}_deb"
action(deb_target_name) {
visibility = [ ":*" ]
script = "//build/gn_run_binary.py"
assert(current_cpu == "x64", "app_shell installer only supported for amd64")
deb_arch = "amd64"
if (is_chrome_branded) {
package = "google-app-shell"
} else {
package = "chromium-app-shell"
}
inputs = packaging_files_binaries
outputs = [
"$root_out_dir/${package}-${channel}_${chrome_version_full}-1_${deb_arch}.deb",
]
args = [
rebase_path("$root_out_dir/app_shell_installer/debian/build.sh",
root_build_dir),
"-a",
current_cpu,
"-b",
rebase_path(root_out_dir, root_build_dir),
"-c",
invoker.channel,
"-d",
branding_path_component,
"-o",
rebase_path(root_out_dir, root_build_dir),
"-s",
rebase_path(sysroot, root_build_dir),
]
if (is_official_build) {
args += [ "-f" ]
}
deps = [
":installer_deps",
":strip_app_shell_binary",
]
}
group(target_name) {
deps = [
":$deb_target_name",
]
}
}
# Standard packages.
# Prefixed with "app_shell_" to not conflict with Chrome's installer targets.
linux_package("app_shell_unstable") {
channel = "unstable"
}
# 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.
#
# This file provides common configuration information for building
# chromium-app-shell for various platforms.
# Base name of the package.
PACKAGE="chromium-app-shell"
# Filename of the main executable (for generating launcher scripts, etc.)
PROGNAME=app_shell
# Base directory for package installation.
INSTALLDIR=/opt/chromium.org/app-shell
# Display string for desktop menu/icon.
MENUNAME="Chromium App Shell"
# Brief package description.
SHORTDESC="The app shell from Chromium.org"
# Detailed package description.
FULLDESC="The app shell from Chromium.org"
# Package maintainer information.
# TODO(mmoss) Setup a mailbox for this address
MAINTNAME="Chromium Linux Team"
MAINTMAIL="chromium-linux-packager@chromium.org"
PRODUCTURL="http://www.chromium.org/"
# 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.
#
# This file provides common configuration information for building
# app-shell packages for various platforms.
# Base name of the package.
PACKAGE="google-app-shell"
# Filename of the main executable (for generating launcher scripts, etc.)
PROGNAME=app_shell
# Base directory for package installation.
INSTALLDIR=/opt/google/app-shell
# Display string for desktop menu/icon.
MENUNAME="App Shell"
# Brief package description.
SHORTDESC="The app shell from Google"
# Detailed package description.
FULLDESC="The app shell from Google"
# Package maintainer information.
# TODO(mmoss) Setup a mailbox for this address
MAINTNAME="Chrome Linux Team"
MAINTMAIL="chromium-dev@chromium.org"
PRODUCTURL="https://chrome.google.com/"
# TODO(michaelpg): Dedupe common functionality with the Chrome installer. See
# https://crbug.com/820270.
# Shows the output of a given command only on failure, or when VERBOSE is set.
log_cmd() {
if [ "${VERBOSE:-}" ]; then
"$@"
else
# Record $- into a separate variable because it gets reset in the subshell.
FORWARD_SHELL_OPTS=$-
ERREXIT=$(echo ${FORWARD_SHELL_OPTS} | grep -o e || true)
set +${ERREXIT}
CMD_OUTPUT=$("$@" 2>&1)
ERRCODE=$?
set -${ERREXIT}
if [ ${ERRCODE} -ne 0 ]; then
echo "$@"
echo "${CMD_OUTPUT}"
if [ ${ERREXIT} ]; then
exit ${ERRCODE}
fi
fi
fi
}
# Recursively replace @@include@@ template variables with the referenced file,
# and write the resulting text to stdout.
process_template_includes() {
INCSTACK+="$1->"
# Includes are relative to the file that does the include.
INCDIR=$(dirname $1)
# Clear IFS so 'read' doesn't trim whitespace
local OLDIFS="$IFS"
IFS=''
while read -r LINE
do
INCLINE=$(sed -e '/^[[:space:]]*@@include@@/!d' <<<$LINE)
if [ -n "$INCLINE" ]; then
INCFILE=$(echo $INCLINE | sed -e "s#@@include@@\(.*\)#\1#")
# Simple filename match to detect cyclic includes.
CYCLE=$(sed -e "\#$INCFILE#"'!d' <<<$INCSTACK)
if [ "$CYCLE" ]; then
echo "ERROR: Possible cyclic include detected." 1>&2
echo "$INCSTACK$INCFILE" 1>&2
exit 1
fi
if [ ! -r "$INCDIR/$INCFILE" ]; then
echo "ERROR: Couldn't read include file: $INCDIR/$INCFILE" 1>&2
exit 1
fi
process_template_includes "$INCDIR/$INCFILE"
else
echo "$LINE"
fi
done < "$1"
IFS="$OLDIFS"
INCSTACK=${INCSTACK%"$1->"}
}
# Replace template variables (@@VARNAME@@) in the given template file. If a
# second argument is given, save the processed text to that filename, otherwise
# modify the template file in place.
process_template() (
# Don't worry if some of these substitution variables aren't set.
# Note that this function is run in a sub-shell so we don't leak this
# setting, since we still want unbound variables to be an error elsewhere.
set +u
local TMPLIN="$1"
if [ -z "$2" ]; then
local TMPLOUT="$TMPLIN"
else
local TMPLOUT="$2"
fi
# Process includes first so included text also gets substitutions.
TMPLINCL="$(process_template_includes "$TMPLIN")"
sed \
-e "s#@@PACKAGE@@#${PACKAGE}#g" \
-e "s#@@PACKAGE_ORIG@@#${PACKAGE_ORIG}#g" \
-e "s#@@PACKAGE_FILENAME@@#${PACKAGE_FILENAME}#g" \
-e "s#@@PROGNAME@@#${PROGNAME}#g" \
-e "s#@@CHANNEL@@#${CHANNEL}#g" \
-e "s#@@COMPANY_FULLNAME@@#${COMPANY_FULLNAME}#g" \
-e "s#@@VERSION@@#${VERSION}#g" \
-e "s#@@PACKAGE_RELEASE@@#${PACKAGE_RELEASE}#g" \
-e "s#@@VERSIONFULL@@#${VERSIONFULL}#g" \
-e "s#@@INSTALLDIR@@#${INSTALLDIR}#g" \
-e "s#@@BUILDDIR@@#${BUILDDIR}#g" \
-e "s#@@STAGEDIR@@#${STAGEDIR}#g" \
-e "s#@@SCRIPTDIR@@#${SCRIPTDIR}#g" \
-e "s#@@MENUNAME@@#${MENUNAME}#g" \
-e "s#@@PRODUCTURL@@#${PRODUCTURL}#g" \
-e "s#@@PREDEPENDS@@#${PREDEPENDS}#g" \
-e "s#@@DEPENDS@@#${DEPENDS}#g" \
-e "s#@@RECOMMENDS@@#${RECOMMENDS}#g" \
-e "s#@@PROVIDES@@#${PROVIDES}#g" \
-e "s#@@ARCHITECTURE@@#${ARCHITECTURE}#g" \
-e "s#@@MAINTNAME@@#${MAINTNAME}#g" \
-e "s#@@MAINTMAIL@@#${MAINTMAIL}#g" \
-e "s#@@REPOCONFIG@@#${REPOCONFIG}#g" \
-e "s#@@REPOCONFIGREGEX@@#${REPOCONFIGREGEX}#g" \
-e "s#@@SHORTDESC@@#${SHORTDESC}#g" \
-e "s#@@FULLDESC@@#${FULLDESC}#g" \
-e "s#@@USR_BIN_SYMLINK_NAME@@#${USR_BIN_SYMLINK_NAME:-}#g" \
-e "s#@@LOGO_RESOURCES_PNG@@#${LOGO_RESOURCES_PNG}#g" \
-e "s#@@LOGO_RESOURCE_XPM@@#${LOGO_RESOURCE_XPM}#g" \
> "$TMPLOUT" <<< "$TMPLINCL"
)
# Setup the installation directory hierachy in the package staging area.
prep_staging_common() {
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}" \
"${STAGEDIR}/usr/bin"
}
get_version_info() {
source "${BUILDDIR}/app_shell_installer/version.txt"
VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}"
# TODO(phajdan.jr): Provide a mechanism to pass a different package
# release number if needed. The meaning of it is to bump it for
# packaging-only changes while the underlying software has the same version.
# This corresponds to the Release field in RPM spec files and debian_revision
# component of the Version field for DEB control file.
# Generally with Chrome's fast release cycle it'd be more hassle to try
# to bump this number between releases.
PACKAGE_RELEASE="1"
}
stage_install_common() {
log_cmd echo "Staging common install files in '${STAGEDIR}'..."
# Note: Changes here may also need to be applied to ChromeOS's
# chromite/lib/chrome_util.py.
# Note: This only supports static binaries and does not work when the GN
# is_component_build flag is true.
# app
STRIPPEDFILE="${BUILDDIR}/${PROGNAME}.stripped"
install -m 755 "${STRIPPEDFILE}" "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}"
# resources
install -m 644 \
"${BUILDDIR}/extensions_shell_and_test.pak" \
"${STAGEDIR}/${INSTALLDIR}/"
# ICU data file; Necessary when the GN icu_use_data_file flag is true.
install -m 644 "${BUILDDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/"
# V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag
# is true.
if [ -f "${BUILDDIR}/natives_blob.bin" ]; then
install -m 644 "${BUILDDIR}/natives_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
# Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available.
# TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch
if [ -f "${BUILDDIR}/v8_context_snapshot.bin" ]; then
install -m 644 "${BUILDDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/"
else
install -m 644 "${BUILDDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
fi
fi
# ANGLE
if [ "${CHANNEL}" != "stable" ]; then
install -m 644 "${BUILDDIR}/libGLESv2.so" "${STAGEDIR}/${INSTALLDIR}/"
install -m 644 "${BUILDDIR}/libEGL.so" "${STAGEDIR}/${INSTALLDIR}/"
fi
# SwiftShader
if [ -f "${BUILDDIR}/swiftshader/libEGL.so" ]; then
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/"
install -m 644 "${BUILDDIR}/swiftshader/libEGL.so" "${STAGEDIR}/${INSTALLDIR}/swiftshader/"
install -m 644 "${BUILDDIR}/swiftshader/libGLESv2.so" "${STAGEDIR}/${INSTALLDIR}/swiftshader/"
fi
# libc++
if [ -f "${BUILDDIR}/lib/libc++.so" ]; then
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/lib/"
install -m 644 -s "${BUILDDIR}/lib/libc++.so" "${STAGEDIR}/${INSTALLDIR}/lib/"
fi
# nacl_helper and nacl_helper_bootstrap
# Don't use "-s" (strip) because this runs binutils "strip", which
# mangles the special ELF program headers of nacl_helper_bootstrap.
# Explicitly use eu-strip instead, because it doesn't have that problem.
for file in nacl_helper nacl_helper_bootstrap; do
buildfile="${BUILDDIR}/${file}"
if [ -f "${buildfile}" ]; then
strippedfile="${buildfile}.stripped"
debugfile="${buildfile}.debug"
"${BUILDDIR}/app_shell_installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}"
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
fi
done
# Don't use "-s" (strip) because this would use the Linux toolchain to
# strip the NaCl binary, which has the potential to break it. It
# certainly resets the OSABI and ABIVERSION fields to non-NaCl values,
# although the NaCl IRT loader doesn't care about these fields. In any
# case, the IRT binaries are already stripped by NaCl's build process.
for filename in ${BUILDDIR}/nacl_irt_*.nexe; do
# Re-check the filename in case globbing matched nothing.
if [ -f "$filename" ]; then
install -m 644 "$filename" "${STAGEDIR}/${INSTALLDIR}/`basename "$filename"`"
fi
done
# launcher script and symlink
process_template "${BUILDDIR}/app_shell_installer/common/wrapper" \
"${STAGEDIR}/${INSTALLDIR}/${PACKAGE}"
chmod 755 "${STAGEDIR}/${INSTALLDIR}/${PACKAGE}"
if [ ! -f "${STAGEDIR}/${INSTALLDIR}/app-shell" ]; then
ln -sn "${INSTALLDIR}/${PACKAGE}" \
"${STAGEDIR}/${INSTALLDIR}/app-shell"
fi
ln -snf "${INSTALLDIR}/${PACKAGE}" \
"${STAGEDIR}/usr/bin/${USR_BIN_SYMLINK_NAME}"
}
#!/bin/bash
#
# 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.
# Let the wrapped binary know that it has been run through the wrapper.
export APP_SHELL_WRAPPER="`readlink -f "$0"`"
HERE="`dirname "$APP_SHELL_WRAPPER"`"
# Always use our versions of ffmpeg libs.
if [[ -n "$LD_LIBRARY_PATH" ]]; then
LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
else
LD_LIBRARY_PATH="$HERE:$HERE/lib"
fi
export LD_LIBRARY_PATH
export CHROME_VERSION_EXTRA="@@CHANNEL@@"
# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
# Sanitize std{in,out,err} because they'll be shared with untrusted child
# processes (http://crbug.com/376567).
exec < /dev/null
exec > >(exec cat)
exec 2> >(exec cat >&2)
# Note: exec -a below is a bashism.
exec -a "$0" "$HERE/@@PROGNAME@@" "$@"
#!/bin/bash
#
# 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 common functionality with the Chrome installer.
set -e
set -o pipefail
if [ "$VERBOSE" ]; then
set -x
fi
set -u
# Create the Debian changelog file needed by dpkg-gencontrol. This just adds a
# placeholder change, indicating it is the result of an automatic build.
# TODO(mmoss) Release packages should create something meaningful for a
# changelog, but simply grabbing the actual 'svn log' is way too verbose. Do we
# have any type of "significant/visible changes" log that we could use for this?
gen_changelog() {
rm -f "${DEB_CHANGELOG}"
process_template "${SCRIPTDIR}/changelog.template" "${DEB_CHANGELOG}"
debchange -a --nomultimaint -m --changelog "${DEB_CHANGELOG}" \
"Release Notes: ${RELEASENOTES}"
GZLOG="${STAGEDIR}/usr/share/doc/${PACKAGE}-${CHANNEL}/changelog.gz"
mkdir -p "$(dirname "${GZLOG}")"
gzip -9 -c "${DEB_CHANGELOG}" > "${GZLOG}"
chmod 644 "${GZLOG}"
}
# Create the Debian control file needed by dpkg-deb.
gen_control() {
dpkg-gencontrol -v"${VERSIONFULL}" -c"${DEB_CONTROL}" -l"${DEB_CHANGELOG}" \
-f"${DEB_FILES}" -p"${PACKAGE}-${CHANNEL}" -P"${STAGEDIR}" \
-O > "${STAGEDIR}/DEBIAN/control"
rm -f "${DEB_CONTROL}"
}
# Setup the installation directory hierachy in the package staging area.
prep_staging_debian() {
prep_staging_common
install -m 755 -d "${STAGEDIR}/DEBIAN" \
"${STAGEDIR}/usr/share/doc/${USR_BIN_SYMLINK_NAME}"
}
# Put the package contents in the staging area.
stage_install_debian() {
# Always use a different name for /usr/bin symlink depending on channel to
# avoid file collisions.
local USR_BIN_SYMLINK_NAME="${PACKAGE}-${CHANNEL}"
if [ "$CHANNEL" != "stable" ]; then
# Avoid file collisions between channels.
local INSTALLDIR="${INSTALLDIR}-${CHANNEL}"
local PACKAGE="${PACKAGE}-${CHANNEL}"
fi
prep_staging_debian
stage_install_common
}
# Actually generate the package file.
do_package() {
log_cmd echo "Packaging ${ARCHITECTURE}..."
PREDEPENDS="$COMMON_PREDEPS"
DEPENDS="${COMMON_DEPS}"
RECOMMENDS="${COMMON_RECOMMENDS}"
PROVIDES=""
gen_changelog
process_template "${SCRIPTDIR}/control.template" "${DEB_CONTROL}"
export DEB_HOST_ARCH="${ARCHITECTURE}"
if [ -f "${DEB_CONTROL}" ]; then
gen_control
fi
if [ ${IS_OFFICIAL_BUILD} -ne 0 ]; then
local COMPRESSION_OPTS="-Zxz -z9"
else
local COMPRESSION_OPTS="-Znone"
fi
log_cmd fakeroot dpkg-deb ${COMPRESSION_OPTS} -b "${STAGEDIR}" .
}
verify_package() {
DEPENDS="${COMMON_DEPS}" # This needs to match do_package() above.
echo ${DEPENDS} | sed 's/, /\n/g' | LANG=C sort > expected_deb_depends
dpkg -I "${PACKAGE}-${CHANNEL}_${VERSIONFULL}_${ARCHITECTURE}.deb" | \
grep '^ Depends: ' | sed 's/^ Depends: //' | sed 's/, /\n/g' | \
LANG=C sort > actual_deb_depends
BAD_DIFF=0
diff -u expected_deb_depends actual_deb_depends || BAD_DIFF=1
if [ $BAD_DIFF -ne 0 ]; then
echo
echo "ERROR: bad dpkg dependencies!"
echo
exit $BAD_DIFF
fi
}
# Remove temporary files and unwanted packaging output.
cleanup() {
log_cmd echo "Cleaning..."
rm -rf "${STAGEDIR}"
rm -rf "${TMPFILEDIR}"
}
usage() {
echo "usage: $(basename $0) [-a target_arch] [-b 'dir'] -c channel"
echo " -d branding [-f] [-o 'dir'] -s 'dir'"
echo "-a arch package architecture (ia32 or x64)"
echo "-b dir build input directory [${BUILDDIR}]"
echo "-c channel the package channel (unstable, beta, stable)"
echo "-d brand either chromium or google_chrome"
echo "-f indicates that this is an official build"
echo "-h this help message"
echo "-o dir package output directory [${OUTPUTDIR}]"
echo "-s dir /path/to/sysroot"
}
# Check that the channel name is one of the allowable ones.
verify_channel() {
case $CHANNEL in
stable )
CHANNEL=stable
RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Stable%20updates"
;;
unstable|dev|alpha )
CHANNEL=unstable
RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Dev%20updates"
;;
testing|beta )
CHANNEL=beta
RELEASENOTES="http://googlechromereleases.blogspot.com/search/label/Beta%20updates"
;;
* )
echo
echo "ERROR: '$CHANNEL' is not a valid channel type."
echo
exit 1
;;
esac
}
process_opts() {
while getopts ":a:b:c:d:fho:s:" OPTNAME
do
case $OPTNAME in
a )
TARGETARCH="$OPTARG"
;;
b )
BUILDDIR=$(readlink -f "${OPTARG}")
;;
c )
CHANNEL="$OPTARG"
;;
d )
BRANDING="$OPTARG"
;;
f )
IS_OFFICIAL_BUILD=1
;;
h )
usage
exit 0
;;
o )
OUTPUTDIR=$(readlink -f "${OPTARG}")
mkdir -p "${OUTPUTDIR}"
;;
s )
SYSROOT="$OPTARG"
;;
\: )
echo "'-$OPTARG' needs an argument."
usage
exit 1
;;
* )
echo "invalid command-line option: $OPTARG"
usage
exit 1
;;
esac
done
}
#=========
# MAIN
#=========
SCRIPTDIR=$(readlink -f "$(dirname "$0")")
OUTPUTDIR="${PWD}"
# Default target architecture to same as build host.
if [ "$(uname -m)" = "x86_64" ]; then
TARGETARCH="x64"
else
TARGETARCH="ia32"
fi
# call cleanup() on exit
trap cleanup 0
process_opts "$@"
BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")}
IS_OFFICIAL_BUILD=${IS_OFFICIAL_BUILD:=0}
STAGEDIR="${BUILDDIR}/app-shell-deb-staging-${CHANNEL}"
mkdir -p "${STAGEDIR}"
TMPFILEDIR="${BUILDDIR}/app-shell-deb-tmp-${CHANNEL}"
mkdir -p "${TMPFILEDIR}"
DEB_CHANGELOG="${TMPFILEDIR}/changelog"
DEB_FILES="${TMPFILEDIR}/files"
DEB_CONTROL="${TMPFILEDIR}/control"
source ${BUILDDIR}/app_shell_installer/common/installer.include
get_version_info
VERSIONFULL="${VERSION}-${PACKAGE_RELEASE}"
if [ "$BRANDING" = "google_chrome" ]; then
source "${BUILDDIR}/app_shell_installer/common/google-app-shell.info"
else
source "${BUILDDIR}/app_shell_installer/common/chromium-app-shell.info"
fi
eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \
"${BUILDDIR}/app_shell_installer/theme/BRANDING")
verify_channel
# Some Debian packaging tools want these set.
export DEBFULLNAME="${MAINTNAME}"
export DEBEMAIL="${MAINTMAIL}"
# We'd like to eliminate more of these deps by relying on the 'lsb' package, but
# that brings in tons of unnecessary stuff, like an mta and rpm. Until that full
# 'lsb' package is installed by default on DEB distros, we'll have to stick with
# the LSB sub-packages, to avoid pulling in all that stuff that's not installed
# by default.
# Generate the dependencies,
# TODO(mmoss): This is a workaround for a problem where dpkg-shlibdeps was
# resolving deps using some of our build output shlibs (i.e.
# out/Release/lib.target/libfreetype.so.6), and was then failing with:
# dpkg-shlibdeps: error: no dependency information found for ...
# It's not clear if we ever want to look in LD_LIBRARY_PATH to resolve deps,
# but it seems that we don't currently, so this is the most expediant fix.
SAVE_LDLP=${LD_LIBRARY_PATH:-}
unset LD_LIBRARY_PATH
if [ ${TARGETARCH} = "x64" ]; then
SHLIB_ARGS="-l${SYSROOT}/usr/lib/x86_64-linux-gnu"
SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/x86_64-linux-gnu"
else
SHLIB_ARGS="-l${SYSROOT}/usr/lib/i386-linux-gnu"
SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/lib/i386-linux-gnu"
fi
SHLIB_ARGS="${SHLIB_ARGS} -l${SYSROOT}/usr/lib"
DPKG_SHLIB_DEPS=$(cd ${SYSROOT} && dpkg-shlibdeps ${SHLIB_ARGS:-} -O \
-e"$BUILDDIR/app_shell" 2>/dev/null | sed 's/^shlibs:Depends=//')
if [ -n "$SAVE_LDLP" ]; then
LD_LIBRARY_PATH=$SAVE_LDLP
fi
# Format it nicely and save it for comparison.
echo "$DPKG_SHLIB_DEPS" | sed 's/, /\n/g' | LANG=C sort > actual
# Additional dependencies not in the dpkg-shlibdeps output.
# ca-certificates: Make sure users have SSL certificates.
# libnss3: Pull a more recent version of NSS than required by runtime linking,
# for security and stability updates in NSS.
# lsb-release: For lsb-release.
# wget: For uploading crash reports with Breakpad.
ADDITIONAL_DEPS="ca-certificates, libnss3 (>= 3.26), lsb-release, wget"
# Fix-up libnspr dependency due to renaming in Ubuntu (the old package still
# exists, but it was moved to "universe" repository, which isn't installed by
# default).
DPKG_SHLIB_DEPS=$(sed \
's/\(libnspr4-0d ([^)]*)\), /\1 | libnspr4 (>= 4.9.5-0ubuntu0), /g' \
<<< $DPKG_SHLIB_DEPS)
# Remove libnss dependency so the one in $ADDITIONAL_DEPS can supercede it.
DPKG_SHLIB_DEPS=$(sed 's/\(libnss3 ([^)]*)\), //g' <<< $DPKG_SHLIB_DEPS)
COMMON_DEPS="${DPKG_SHLIB_DEPS}, ${ADDITIONAL_DEPS}"
COMMON_PREDEPS="dpkg (>= 1.14.0)"
COMMON_RECOMMENDS="libu2f-udev"
# Make everything happen in the OUTPUTDIR.
cd "${OUTPUTDIR}"
case "$TARGETARCH" in
ia32 )
export ARCHITECTURE="i386"
;;
x64 )
export ARCHITECTURE="amd64"
;;
* )
echo
echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'."
echo
exit 1
;;
esac
stage_install_debian
do_package
verify_package
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment