Skip to content

Instantly share code, notes, and snippets.

@kennwhite
Last active September 20, 2021 12:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennwhite/b05fcdd2161688c1e859f962ec90c4f4 to your computer and use it in GitHub Desktop.
Save kennwhite/b05fcdd2161688c1e859f962ec90c4f4 to your computer and use it in GitHub Desktop.
Building Chrome from source in Ubuntu 18 & 20
# Based on:
# https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md#System-requirements
# Easiest path is to use Ubuntu 18.04 *Desktop*
# It will bring along a lot of the critical system GUI & font dependencies
# Only needed for 18 minimal, not 18 full or 20:
# echo "shmfs /dev/shm tmpfs defaults,size=58G 0 0" | sudo tee -a /etc/fstab
# Assumes we're running in a container/VM, otherwise don't run as root
# Is 2.7 required?
# Can I use repo pip?
sudo apt-get install -y git python2.7-minimal python curl
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
# export CR_BUILD=/dev/shm/chromium
export CR_BUILD=/root/chromium
sudo rm -rf $CR_BUILD
sudo mkdir -p $CR_BUILD
cd $CR_BUILD
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH:$CR_BUILD/depot_tools"
echo $PATH
fetch --nohooks --no-history chromium
cd $CR_BUILD/src
./build/install-build-deps.sh
gclient runhooks
echo "Use:
symbol_level=0
is_debug=false
enable_nacl=false
is_component_build=true
blink_symbol_level=0
"
# See: https://gn.googlesource.com/gn/+/HEAD/docs/reference.md#cmd_args
gn args $CR_BUILD/src/out/Default
# date && autoninja -C $CR_BUILD/src/out/Default chrome && date
time autoninja -C $CR_BUILD/src/out/Default chrome
ls
$CR_BUILD/src/out/Default/chrome &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment