Unix Tutorial Projects: Compiling Brave browser on Linux Mint
Some of you may have noticed: I added the link to Brave browser to the sidebar here on Unix Tutorial. That’s because I’m giving this new browser a try and support its vision to reward content producers via Brave’s Basic Attention Token cryptocurrency. If you aren’t using Brave browser already, download and try Brave browser using my link.
In this Unix Tutorial Project, just because it seems fun and educational enough, I’ll attempt compiling Brave browser on my Dell XPS 13 laptop running Linux Mint 19. There’s a much easier way to install Brave browser from official repositories: official instructions here.
Make sure you have enough disk space
This project suprised me a bit. I had 20GB of space and thought it would be enough! Then I saw the git download alone would be almost 15GB, but hoped I had enough.
I was wrong! Ended up resizing Windows 10 partition on my laptop to free up space for another 100GB Linux filesystem.
The final space consumption is 67GB, that’s a lot of source code with an impressive amount (32 thousand of them!) object files (intermidiary binary files you need when compiling large project. they’re used to make up the final binary:
Prepare Linux Mint 19 for Compiling Brave Browser
Following instructions from https://github.com/brave/brave-browser/wiki/Linux-Development-Environment, I first installed the packages:
You should end up with a whole bunch of npm (node-*) packages installed.
You need to install gperf package as well – npm run build (last step below) failed for me because gperf wasn’t found.
Clone Brave Browser git Repo
We’re now ready to clone the repo:
and then do npm install. This is how it should look:
git cloning Brave browser
Download Chromium source code using npm
npm run init command will download the source code of Chromium browser (open source original Chrome is being built on), Brave browser is based on it. This should take a while – on my 100Mbit connection it took 25min to download 13.5GB (that’s comporessed, mind you!) of Chromium’s source code and then another 25min to download the rest of dependencies:
Build Brave Browser from Source Code
Here we go! Let’s build this thing. Should take an hour or two on a fast PC:
This is a release build, meaning this is a fully performance and release-grade build of the source code. If you’re going to contribute to Brave browser open source project, you should know that npm run build (without Release parameter) will provide a debug build.
This is how the end process looks (took a few hours to compile on the 8-core CPU of my XPS laptop):
Brave browser fully compiled
Start the Newly built Brave Browser
This is it! Let’s try starting the browser, this should complete our Unix Tutorial project today: