bromite-buildtools/images/chr-source/prepare-build.sh

70 lines
2.1 KiB
Bash
Raw Normal View History

2021-06-19 15:16:24 +05:30
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e ${RED} -------- chromium version is: $VERSION ${NC}
echo -e ${RED} -------- cloning depot_tools ${NC}
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo -e ${RED} -------- apply depot_tools patch ${NC}
cd depot_tools/
git apply ../depot_tools.diff
cd ..
echo -e ${RED} -------- set envs ${NC}
PATH=/home/lg/working_dir/depot_tools:$PATH
echo $PATH
echo -e ${RED} -------- download chromium repo ${NC}
mkdir ./chromium
cd ./chromium
gclient root
mkdir ./src
cd ./src
git init
git remote add origin https://chromium.googlesource.com/chromium/src.git
git fetch --depth 2 https://chromium.googlesource.com/chromium/src.git +refs/tags/$VERSION:chromium_$VERSION
git checkout $VERSION
VERSION_SHA=$( git show-ref -s $VERSION | head -n1 )
echo >../.gclient "solutions = ["
echo >>../.gclient " { \"name\" : 'src',"
echo >>../.gclient " \"url\" : 'https://chromium.googlesource.com/chromium/src.git@$VERSION_SHA',"
echo >>../.gclient " \"deps_file\" : 'DEPS',"
echo >>../.gclient " \"managed\" : True,"
echo >>../.gclient " \"custom_deps\" : {"
echo >>../.gclient " },"
2021-11-30 19:49:22 +05:30
echo >>../.gclient " \"custom_vars\": {"
echo >>../.gclient " \"checkout_android_prebuilts_build_tools\": True,"
echo >>../.gclient " \"checkout_telemetry_dependencies\": False,"
echo >>../.gclient " \"codesearch\": 'Debug',"
echo >>../.gclient " },"
2021-06-19 15:16:24 +05:30
echo >>../.gclient " },"
echo >>../.gclient "]"
echo >>../.gclient "target_os=['android']"
git submodule foreach git config -f ./.git/config submodule.$name.ignore all
git config --add remote.origin.fetch '+refs/tags/*:refs/tags/*'
#git config diff.ignoreSubmodules all
echo -e ${RED} -------- sync third_party repos ${NC}
gclient sync -D --no-history --nohooks
git config user.email "you@example.com"
git config user.name "Your Name"
# remove origin for chromium
# git remote remove origin
echo -e ${RED} -------- running hooks ${NC}
gclient runhooks
2021-10-10 18:56:03 +05:30
echo -e ${RED} -------- download objdump ${NC}
tools/clang/scripts/update.py --package=objdump