bromite-buildtools/prepare-build.sh

98 lines
3.1 KiB
Bash
Raw Normal View History

2021-05-26 21:03:00 +05:30
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color
2021-05-26 21:13:37 +05:30
#sudo apt-get install python
#sudo apt-get install wiggle
2021-05-29 14:00:26 +05:30
sudo apt-get install lftp
2021-05-26 21:03:00 +05:30
echo -e ${RED} -------- download bromite repo ${NC}
git clone https://github.com/bromite/bromite
cd bromite
git fetch
git pull
VERSION=$( cat ./build/RELEASE )
2021-05-29 14:40:33 +05:30
echo -e ${RED} -------- chromium version is: $VERSION ${NC}
2021-05-26 21:03:00 +05:30
2021-05-27 20:50:30 +05:30
echo -e ${RED} -------- cloning depot_tools ${NC}
2021-05-26 21:03:00 +05:30
cd ..
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
2021-05-27 20:23:00 +05:30
2021-05-27 20:50:30 +05:30
echo -e ${RED} -------- apply depot_tools patch ${NC}
2021-05-27 20:23:00 +05:30
cd depot_tools/
git apply ../bromite-buildtools/depot_tools.diff
cd ..
2021-05-27 20:50:30 +05:30
echo -e ${RED} -------- set envs ${NC}
2021-05-26 21:13:37 +05:30
PATH=$PWD/chromium/src/third_party/llvm-build/Release+Asserts/bin:$PWD/depot_tools/:/usr/local/go/bin:$PATH
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
echo -e ${RED} -------- cheking chromium pre-prepared ${NC}
2021-05-29 14:40:33 +05:30
rm chromium.$VERSION.tar.gz
lftp $FTP_HOST -u $FTP_USER,$FTP_PWD -e "set ftp:ssl-force true; set ssl:verify-certificate false; cd /bromite; get chromium.$VERSION.tar.gz; quit" && OK=1 || OK=0
2021-05-29 14:00:26 +05:30
if [[ OK -eq 0 ]]; then
echo -e ${RED} -------- not found ${NC}
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
echo -e ${RED} -------- download chromium repo ${NC}
mkdir ./chromium
cd ./chromium
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
gclient root
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
mkdir ./src
cd ./src
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
git init
git remote add origin https://chromium.googlesource.com/chromium/src.git
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
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 )
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
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 " },"
echo >>../.gclient " \"custom_vars\": {},"
echo >>../.gclient " },"
echo >>../.gclient "]"
echo >>../.gclient "target_os=['android']"
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
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
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
echo -e ${RED} -------- sync third_party repos ${NC}
gclient sync -D --no-history --nohooks
2021-05-26 21:03:00 +05:30
2021-05-29 14:00:26 +05:30
git config user.email "you@example.com"
git config user.name "Your Name"
2021-05-27 20:50:30 +05:30
2021-05-29 14:00:26 +05:30
# remove origin for chromium
# git remote remove origin
2021-05-29 12:38:07 +05:30
2021-05-29 14:00:26 +05:30
echo -e ${RED} -------- running install-build-deps-android ${NC}
sudo build/install-build-deps-android.sh
2021-05-29 12:38:07 +05:30
2021-05-29 14:00:26 +05:30
echo -e ${RED} -------- running hooks ${NC}
gclient runhooks
echo -e ${RED} -------- packing chromium dir ${NC}
cd ../..
2021-05-29 14:40:33 +05:30
tar -czf chromium.$VERSION.tar.gz ./chromium
2021-05-29 12:38:07 +05:30
2021-05-29 14:00:26 +05:30
echo -e ${RED} -------- uploading to storage ${NC}
2021-05-29 14:40:33 +05:30
lftp $FTP_HOST -u $FTP_USER,$FTP_PWD -e "set ftp:ssl-force true; set ssl:verify-certificate false; cd /bromite; put chromium.$VERSION.tar.gz; quit"
2021-05-29 14:00:26 +05:30
else
echo -e ${RED} -------- unpacking ${NC}
2021-05-29 14:40:33 +05:30
tar xf chromium.$VERSION.tar.gz
2021-05-29 14:00:26 +05:30
fi
2021-05-29 14:40:33 +05:30
rm chromium.$VERSION.tar.gz