Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bromite Builder

Utility script for building [Bromite]( https://github.com/bromite/bromite) releases
Utility script for building [Bromite](https://github.com/bromite/bromite) releases

- [Requirements](#requirements)
- [Setup](#setup)
Expand All @@ -13,7 +13,8 @@ Utility script for building [Bromite]( https://github.com/bromite/bromite) relea
- A 64-bit Intel machine running Linux with at least 8GB of RAM.
More than 16GB is highly recommended.
- At least 100GB of free disk space.
- You must have Git and Python 2 installed already.
- Git and Python 2 for checking out and building Chromium
- Python 3 for [Ungoogled Chromium's](https://github.com/Eloston/ungoogled-chromium) domain substitution utility

## <a name="setup"></a>Setup

Expand Down
44 changes: 42 additions & 2 deletions bromite-builder
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ fetch-sync () {
prepare () {
local bromite_dir
local bromite_src

local patchlist_path
local patchlist
local patch_status

local ungoogled_dir
local ungoogled_domains_fallback=

[[ ! -d $BUILD_DIR/chromium/src ]] \
&& fetch-sync
Expand Down Expand Up @@ -211,14 +216,34 @@ prepare () {

# Apply Patches
for patchfile in "${patchlist[@]}"; do
[[ "$(git apply --whitespace=nowarn --check "$patchfile" &>/dev/null; \
echo $?)" -gt 0 ]] \
patch_status=$(git apply --whitespace=nowarn --check "$patchfile" \
&>/dev/null; \
echo $?)

[[ $patch_status -gt 0 ]] \
&& [[ "$patchfile" =~ domain-substitution.patch ]] \
&& ungoogled_domains_fallback=$patch_status \
&& continue

[[ $patch_status -gt 0 ]] \
&& [[ ! $NO_SKIP_PATCHES ]] \
&& echo "Skipping, doesn't apply: $(basename "$patchfile")" \
&& continue

echo "Applying patch: $(basename "$patchfile")"
git apply --whitespace=nowarn "$patchfile"
done

# Domain Substitution Fallback via Ungoogled
[[ $ungoogled_domains_fallback ]] \
&& echo "Applying Ungoogled Chromium's domain substitutions" \
&& ungoogled_dir="$CWD/.bin/ungoogled-chromium" \
&& rm -f "$ungoogled_dir/build/domainsubcache.tar.gz" \
&& domain_substitution --quiet apply \
-r "$ungoogled_dir/domain_regex.list" \
-f "$ungoogled_dir/domain_substitution.list" \
-c "$ungoogled_dir/build/domainsubcache.tar.gz" \
./
}

build () {
Expand Down Expand Up @@ -458,6 +483,21 @@ _localbin () {
&& curl -s "$protobuf_repo/protoc-gen-javalite/3.0.0/$protoc_javalite_bin" \
-o "$CWD/.bin/protoc-gen-javalite" \
&& chmod 755 "$CWD/.bin/protoc-gen-javalite"

# Ungoogled Chromium
[[ ! -d $CWD/.bin/ungoogled-chromium ]] \
&& cd "$CWD/.bin" \
&& echo "Fetching Ungoogled Chromium" \
&& git clone -q https://github.com/Eloston/ungoogled-chromium.git

cd "$CWD/.bin/ungoogled-chromium"
git checkout master -q
git pull -q

mkdir -p "$CWD/.bin/ungoogled-chromium/build"

ln -sf "$CWD/.bin/ungoogled-chromium/utils/domain_substitution.py" \
"$CWD/.bin/domain_substitution"
}

_getcmds () {
Expand Down