Re: Brave browser
Posted: Tue Apr 16, 2019 7:32 am
Building from source
You need to install yarn and nodejs
You can get higher level instructions from this link:
I ran the prerequisite install commands from the page.
The last package npm doesn't install the npm command surprisingly
Following links from the page above, I executed below commands to install Yarn:
Installing nodejs by following this link did not work: https://github.com/nodesource/distribut ... /README.md
The installer reported that the version of debian was not supported.
Luckily there is a package in the MX test repo: nodejs
The package provides the npm command required for building.
Download the source code from the git repo
The following commands are from this manual: https://github.com/brave/brave-browser/wiki
The next command took a few hours:
I had to use --unsupported switch to install dependencies:
The dependencies installed fine despite being unsupported.
Building from source
As I understand this build is not for mere mortals. You need special hardware with huge amount of RAM. At least my laptop bought two years ago with 12 GB of memory couldn't handle it. I started the build and waited for 4-5 days before giving up. I noticed CPU consumption didn't go up a lot. The problem was the disk and memory. Here is how I solved it. I used my desktop which is very old but it has an SSD hard drive. See the specs below:
I installed MX live on a memory stick, used frugal static and I made 24 GB swap file on the ssd drive:
So in a way I extended my physical memory to the SSD drive. This strategy proved to be successful. Three days later the build finished and I got a brand new brave browser.
Solving the "no usable sandbox" problem
I had to install the chromium package "apt install chromium" , which provides chrome-sandbox. Then I made a link to the directory where brave executable is:
Now my brave works fine including the tor tabs.
Installation
I stripped the resulting binary file because it was 6.4 GB. Here is the command:
I copied run-time files to /opt/brave
Here is a list:
The size went down to 263 MB
I found icons here: http://www.iconarchive.com/show/papirus ... -icon.html
I made brave.desktop and it went to /usr/share/applications
Icons went to /usr/share/icons/hicolor/...
Conclusion
This experience confirmed that a browser is OS pretending to be a browser
You need to install yarn and nodejs
You can get higher level instructions from this link:
Code: Select all
https://github.com/brave/brave-browser/wiki/Linux-Development-Environment
Code: Select all
apt-get install build-essential libgnome-keyring-dev python-setuptools npm
Following links from the page above, I executed below commands to install Yarn:
Code: Select all
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
yarn import
The installer reported that the version of debian was not supported.
Luckily there is a package in the MX test repo: nodejs
Code: Select all
Package: nodejs
Version: 8.9.4-1~mx17+
Download the source code from the git repo
The following commands are from this manual: https://github.com/brave/brave-browser/wiki
Code: Select all
git clone git@github.com:brave/brave-browser.git
cd brave-browser
npm install
Code: Select all
npm run init
Code: Select all
./src/build/install-build-deps.sh --unsupported
Building from source
As I understand this build is not for mere mortals. You need special hardware with huge amount of RAM. At least my laptop bought two years ago with 12 GB of memory couldn't handle it. I started the build and waited for 4-5 days before giving up. I noticed CPU consumption didn't go up a lot. The problem was the disk and memory. Here is how I solved it. I used my desktop which is very old but it has an SSD hard drive. See the specs below:
Code: Select all
CPU: Topology: Quad Core model: Intel Core2 Quad Q6600 bits: 64 type: MCP
Memory: 3.85 GiB
Code: Select all
$ swapon
NAME TYPE SIZE USED PRIO
/live/boot-dev/home/mx-user/mx-swap file 23G 378.8M -2
/dev/sdc5 partition 4G 0B -3
Solving the "no usable sandbox" problem
I had to install the chromium package "apt install chromium" , which provides chrome-sandbox. Then I made a link to the directory where brave executable is:
Code: Select all
ln -s /usr/lib/chromium/chrome-sandbox ./
Installation
I stripped the resulting binary file because it was 6.4 GB. Here is the command:
Code: Select all
strip -o brave-strip brave
#test it and move
mv brave-strip brave
Here is a list:
Code: Select all
brave
brave_100_percent.pak
brave_200_percent.pak
brave.desktop
brave_resources.pak
chrome_100_percent.pak
chrome_200_percent.pak
chrome-sandbox
extensions
headless_lib.pak
icon_before.bak
icudtl.dat
libEGL.so
libGLESv2.so
libVkICD_mock_icd.so
libVkLayer_core_validation.so
libVkLayer_object_lifetimes.so
libVkLayer_stateless_validation.so
libVkLayer_thread_safety.so
libVkLayer_unique_objects.so
libwidevinecdm.so
locales
natives_blob.bin
product_logo_48.png
resources
resources.pak
snapshot_blob.bin
v8_context_snapshot.bin
views_mus_resources.pak
I found icons here: http://www.iconarchive.com/show/papirus ... -icon.html
I made brave.desktop and it went to /usr/share/applications
Icons went to /usr/share/icons/hicolor/...
Conclusion
This experience confirmed that a browser is OS pretending to be a browser