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

89 lines
2.6 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/
2022-10-13 18:09:54 +05:30
git apply ../depot_tools.diff
2022-01-11 21:35:18 +05:30
git apply ../remove_ninja_uploader.diff
2021-06-19 15:16:24 +05:30
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
export DEPOT_TOOLS_UPDATE=0
2021-06-19 15:16:24 +05:30
gclient root
mkdir ./src
cd ./src
2022-08-01 16:40:25 +05:30
#CHR_SOURCE=https://chromium.googlesource.com/chromium/src.git
CHR_SOURCE=https://github.com/chromium/chromium.git
2022-08-01 11:58:45 +05:30
2021-06-19 15:16:24 +05:30
git init
2022-08-01 11:58:45 +05:30
git remote add origin $CHR_SOURCE
2021-06-19 15:16:24 +05:30
2022-08-01 11:58:45 +05:30
git fetch --depth 2 $CHR_SOURCE +refs/tags/$VERSION:chromium_$VERSION
2021-06-19 15:16:24 +05:30
git checkout $VERSION
VERSION_SHA=$( git show-ref -s $VERSION | head -n1 )
echo >../.gclient "solutions = ["
echo >>../.gclient " { \"name\" : 'src',"
2022-08-01 11:58:45 +05:30
echo >>../.gclient " \"url\" : '$CHR_SOURCE@$VERSION_SHA',"
2021-06-19 15:16:24 +05:30
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
2022-10-13 18:58:59 +05:30
echo -e ${RED} -------- build rc ${NC}
cd build/toolchain/win/rc
git clone -q https://github.com/nico/hack
cd hack/res
../../../../../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ \
-std=c++14 rc.cc -Wall \
-Wno-c++11-narrowing -O2 -fno-rtti -fno-exceptions -DNDEBUG \
-o rc-linux64 -fuse-ld=lld -target x86_64-unknown-linux-gnu
cd ../../../../../../
cp build/toolchain/win/rc/hack/res/rc-linux64 build/toolchain/win/rc/linux64/rc