Skip to content

defcon201/braver-browser

 
 

Repository files navigation

Braver Browser

Braver Browser

A non-profit community-maintained Brave browser without any adware or crypto tokens.

Braver is still in progress. Braver is looking for contributors!

Join Braver on Discord

Overview

This repository holds the build tools needed to build the Braver desktop browser for macOS, Windows, and Linux. In particular, it fetches and syncs code from the projects we define in package.json and src/brave/DEPS:

Contributing

Please see the contributing guidelines

Follow @braver on Twitter for important news and announcements.

Install prerequisites

Follow the instructions for your platform:

Clone and initialize the repo

Once you have the prerequisites installed, you can get the code and initialize the build environment.

git clone [email protected]:braver-browser/braver-browser.git
cd braver-browser
npm install

# this takes 30-45 minutes to run
# the Chromium source is downloaded which has a large history
npm run init

# if you'd like to run it faster without downloading Chromium's source history
npm run init --no-history

brave-core based android builds should use npm run init -- --target_os=android --target_arch=arm (or whatever cpu type you want to build for)

You can also set the target_os and target_arch for init and build using

npm config set target_os android
npm config set target_arch arm

Build Braver

The default build type is component.

# start the component build compile
npm run build

To do a release build:

# start the release compile
npm run build Release

brave-core based android builds should use npm run build -- --target_os=android --target_arch=arm or set the npm config variables as specified above for init

Build Configurations

Running a release build with npm run build Release can be very slow and use a lot of RAM especially on Linux with the Gold LLVM plugin.

To run a statically linked build (takes longer to build, but starts faster)

npm run build -- Static

To run a debug build (Component build with is_debug=true)

npm run build -- Debug

You may also want to try [[using sccache|sccache-for-faster-builds]].

Run Braver

To start the build:

npm start [Release|Component|Static|Debug]

Update Braver

npm run sync -- [--force] [--init] [--create] [brave_core_ref]

This will attempt to stash your local changes in brave-core, but it's safer to commit local changes before running this

npm run sync will (depending on the below flags):

  1. 📥 Update sub-projects (chromium, brave-core) to latest commit of a git ref (e.g. tag or branch)
  2. 🤕 Apply patches
  3. 🔄 Update gclient DEPS dependencies
  4. ⏩ Run hooks (e.g. to perform npm install on child projects)
flag Description
[no flags] updates chromium if needed and re-applies patches. If the chromium version did not change it will only re-apply patches that have changed. Will update child dependencies only if any project needed updating during this script run
**Use this if you want the script to manage keeping you up to date instead of pulling or switching branch manually. **
--create when used with brave_core_ref it will create a branch if one does not already exist
--force updates both Chromium and brave-core to the latest remote commit for the current brave-core branch and the Chromium ref specified in brave-browser/package.json (e.g. master or 74.0.0.103). Will re-apply all patches. Will force update all child dependencies
**Use this if you're having trouble and want to force the branches back to a known state. **
--init force update both Chromium and brave-core to the versions specified in brave-browser/package.json and force updates all dependent repos - same as npm run init

Run npm run sync brave_core_ref to checkout the specified brave-core ref and update all dependent repos including chromium if needed

Scenarios

Create a new branch

brave-core> git checkout -b branch_name

or

braver-browser> npn run sync -- --create branch_name

Checkout an existing branch or tag

braver-core> git fetch origin
braver-core> git checkout [-b] branch_name
braver-core> npm run sync
...Updating 2 patches...
...Updating child dependencies...
...Running hooks...

or

braver-browser> npn run sync --create branch_name
...Updating 2 patches...
...Updating child dependencies...
...Running hooks...

Update the current branch to latest remote

braver-core> git pull
braver-core> npm run sync
...Updating 2 patches...
...Updating child dependencies...
...Running hooks...

Reset to latest braver-browser master, braver-core master and chromium

braver-browser> git checkout master
braver-browser> git pull
braver-browser> npm run sync -- --init

When you know that DEPS didn't change, but .patch files did (quickest)

braver-core> git checkout featureB
braver-core> git pull
braver-browser> npm run apply_patches
...Applying 2 patches...

Troubleshooting

See Troubleshooting for solutions to common problems.

About

Next generation Brave browser for macOS, Windows, Linux, Android.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.9%
  • Python 2.1%