0

Enhanced build experience for Android

1. Enable the install-build-deps script
to support the installation of Android dependencies
2. Modify some related files
(including Markdown and Dockerfile)

Change-Id: Id6b5c74067ed0c5f3c94d87ac3e307d9807364cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4133941
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Ho Cheung <uioptt24@gmail.com>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1090000}
This commit is contained in:
Ho Cheung
2023-01-07 02:40:24 +00:00
committed by Chromium LUCI CQ
parent dc41e2c5fb
commit fd3ed27576
5 changed files with 29 additions and 40 deletions

@ -1,37 +0,0 @@
#!/bin/bash
# Copyright 2012 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to install everything needed to build chromium on android, including
# items requiring sudo privileges.
# See https://www.chromium.org/developers/how-tos/android-build-instructions
args="$@"
if ! uname -m | egrep -q "i686|x86_64"; then
echo "Only x86 architectures are currently supported" >&2
exit
fi
# Exit if any commands fail.
set -e
lsb_release=$(lsb_release --codename --short)
# Install first the default Linux build deps.
"$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \
--no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}"
# Fix deps
sudo apt-get -f install
# common
sudo apt-get -y install lib32z1 lighttpd xvfb x11-utils
# Some binaries in the Android SDK require 32-bit libraries on the host.
# See https://developer.android.com/sdk/installing/index.html?pkg=tools
sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386
echo "install-build-deps-android.sh complete."

@ -5,13 +5,16 @@
# found in the LICENSE file.
# Script to install everything needed to build chromium (well, ideally, anyway)
# including items requiring sudo privileges.
# See https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md
# and https://chromium.googlesource.com/chromium/src/+/HEAD/docs/android_build_instructions.md
usage() {
echo "Usage: $0 [--options]"
echo "Options:"
echo "--[no-]syms: enable or disable installation of debugging symbols"
echo "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot"
echo "--[no-]android: enable or disable installation of android dependencies"
echo "--[no-]arm: enable or disable installation of arm cross toolchain"
echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\
"fonts"
@ -58,6 +61,7 @@ package_exists() {
do_inst_arm=0
do_inst_nacl=0
do_inst_android=0
while [ "$1" != "" ]
do
@ -65,6 +69,8 @@ do
--syms) do_inst_syms=1;;
--no-syms) do_inst_syms=0;;
--lib32) do_inst_lib32=1;;
--android) do_inst_android=1;;
--no-android) do_inst_android=0;;
--arm) do_inst_arm=1;;
--no-arm) do_inst_arm=0;;
--chromeos-fonts) do_inst_chromeos_fonts=1;;
@ -88,6 +94,10 @@ if [ "$do_inst_arm" = "1" ]; then
do_inst_lib32=1
fi
if [ "$do_inst_android" = "1" ]; then
do_inst_lib32=1
fi
# Check for lsb_release command in $PATH
if ! which lsb_release > /dev/null; then
echo "ERROR: lsb_release not found in \$PATH" >&2
@ -110,6 +120,7 @@ if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
exit 1
fi
# Check system architecture
if ! uname -m | egrep -q "i686|x86_64"; then
echo "Only x86 architectures are currently supported" >&2
exit
@ -189,6 +200,7 @@ dev_list="\
libxss-dev
libxt-dev
libxtst-dev
lighttpd
locales
openbox
p7zip
@ -225,6 +237,7 @@ chromeos_lib_list="libpulse0 libbz2-1.0"
# List of required run-time libraries
common_lib_list="\
lib32z1
libasound2
libatk1.0-0
libatspi2.0-0
@ -273,6 +286,8 @@ common_lib_list="\
libxrandr2
libxrender1
libxtst6
x11-utils
xvfb
zlib1g
"
@ -294,6 +309,8 @@ lib_list="\
lib32_list="linux-libc-dev:i386 libpci3:i386"
# 32-bit libraries needed for a 32-bit build
# includes some 32-bit libraries required by the Android SDK
# See https://developer.android.com/sdk/installing/index.html?pkg=tools
lib32_list="$lib32_list
libasound2:i386
libatk-bridge2.0-0:i386
@ -301,14 +318,17 @@ lib32_list="$lib32_list
libatspi2.0-0:i386
libdbus-1-3:i386
libglib2.0-0:i386
libncurses5:i386
libnss3:i386
libpango-1.0-0:i386
libstdc++6:i386
libx11-xcb1:i386
libxcomposite1:i386
libxdamage1:i386
libxkbcommon0:i386
libxrandr2:i386
libxtst6:i386
zlib1g:i386
"
# Packages that have been removed from this script. Regardless of configuration
@ -643,6 +663,12 @@ else
lib32_list=
fi
if [ "$do_inst_android" = "1" ]; then
echo "Including Android dependencies."
else
echo "Skipping Android dependencies."
fi
if [ "$do_inst_arm" = "1" ]; then
echo "Including ARM cross toolchain."
else

@ -91,7 +91,7 @@ gclient sync
Once you have checked out the code, run
```shell
build/install-build-deps-android.sh
build/install-build-deps.sh --android
```
to get all of the dependencies you need to build on Linux, *plus* all of the

@ -91,7 +91,7 @@ $ gclient sync
Once you have checked out the code, run
```shell
$ build/install-build-deps-android.sh
$ build/install-build-deps.sh --android
```
to get all of the dependencies you need to build on Linux, *plus* all of the

@ -47,7 +47,7 @@ In this case you will have to recompile these binaries in your laptop:
```shell
# May need to install dependencies on your laptop.
laptop$ sudo ./build/install-build-deps-android.sh
laptop$ sudo ./build/install-build-deps.sh --android
# Rebuild the needed binaries on your laptop.