summaryrefslogtreecommitdiffstats
path: root/chromium/build/README
blob: 2343d721f874434d7fb6a414041da9b797421765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# Checking out the sources of an official chromium release:
#
# See also https://github.com/zcbenz/chromium-source-tarball where this is
# fully automated, but the resulting tarballs are much bigger because they
# contain sources specific to windows and mac too.
#
# In a working directory (~/chromium_src by default), three directories will
# be created:
# - depot_tools: this contains all the tools needed for creating the tarball
# - checkout: here over 16 GB of chromium source code will be checked out.
# - output: here the chromium-${RELEASE}.tar.xz source tarball will be created.

# Note: if you want to find out the recommended version for the native_client
# toolchains, search for the line:
#   'src/native_client':
# in
#   http://src.chromium.org/viewvc/chrome/releases/$VERSION}/DEPS
# and take the value which is after the '@'on the next line, e.g.:
#   '/trunk/src/native_client@12558',

# Some variables:

RELEASE=${RELEASE:-"43.0.2357.124"}
WORKING_DIR=${WORKING_DIR:-"${HOME}/chromium_src"}

DEPOT_TOOLS_REPO="https://chromium.googlesource.com/chromium/tools/depot_tools.git"

# The actual work (takes a while to checkout 1 GB of source and pack it up:

mkdir -p ${WORKING_DIR}
cd ${WORKING_DIR}

# Clone the tools:
git clone ${DEPOT_TOOLS_REPO}

# Check out the sources:
mkdir -p checkout
cd checkout
PATH="../depot_tools/:$PATH" fetch --nohooks chromium --target_os=linux
PATH="../depot_tools/:$PATH" gclient sync --force --nohooks --with_branch_heads

# Expose the source for the release tag we want:
cd src
  git fetch origin --tags
  git reset --hard ${RELEASE}
  PATH="../../depot_tools/:$PATH" gclient sync --force --nohooks --with_branch_heads
cd -

# Pack up the source tarball:
mkdir ../output
python src/tools/export_tarball/export_tarball.py --remove-nonessential-files ../output/chromium-${RELEASE}

echo ""
echo "Resulting source tarball is: ${WORKING_DIR}/output/chromium-${RELEASE}.tar.xz"
echo ""