Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex313031 authored Apr 18, 2022
1 parent 5d67683 commit 90018c6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,22 @@

# Building <img src="https://github.com/Alex313031/Thorium/blob/main/logos/NEW/build_24.png">
_**The scripts assume the Chromium source is at $HOME/chromiums/src/. You may have to 'sudo chmod +x' the scripts to make them executable.**_
- For AVX2 follow the instructions at https://github.com/Alex313031/Thorium-AVX2/ as well as these instructions.
- For Windows AVX2 follow the instructions at https://github.com/Alex313031/Thorium-AVX2/ as well as these instructions.
- In general follow build instructions at https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/linux/build_instructions.md and API Keys (if desired) at https://www.chromium.org/developers/how-tos/api-keys \
&nbsp;&nbsp;&ndash; For Windows builds, follow https://chromium.googlesource.com/chromium/src.git/+/HEAD/docs/win_cross.md This is for cross-compiling for Windows on Linux (what I do). For building natively on Windows, you will have to manually do the commands in `trunk.sh` and manually copy the files outlined in `setup.sh`, as well as using the windows_args.gn for your args.gn file (for both native and cross compiling), generally following instructions at https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md
- After initial download of Chromium source code, run (from where you cloned this repo) `./trunk.sh`. This will update and sync the sources and at the end it will download the PGO profile for chromium. The file will be downloaded to *//chromium/src/chrome/build/pgo_profiles/&#42;.profdata* with the actual file name looking something like 'chrome-linux-main-1632505958-ddbb37bcdfa7dbd7b10cf3a9b6a5bc45e7a958a6.profdata', which should be added to the end of args.gn as per below.
- Then, (from where you cloned this repo) run `./setup.sh`. This will copy all the files and patches to the needed locations and drop you to *//chromium/src*.
- Run `export EDITOR=nano` & `export VISUAL=nano` *# You can substitute a cmdline editor like vim here, but many GUI editors cause it to try and parse the args.gn file before it is even saved.*
- Run `gn args out/thorium` and the contents of 'args.gn' in this repo should be copy/pasted into the editor. *--Include your api keys here at the top or leave blank, and edit the last line to point to the actual path and file name of '&#42;.profdata'*
- 'args.list' contains an alphabetical list with descriptions of all possible build arguments; gn_args.list gives a similar list but with the flags in args.gn added.
- To build, run `autoninja -j8 -C out/thorium chrome chrome_sandbox content_shell -d stats` *The -j# can be changed to limit or increase the number of jobs (generally should be the number of CPU cores on your machine), and the -d stats at the end just shows better verbose stats during compiling. You could also append chromedriver (the releases have chromedriver) after content_shell to build chromedriver, the selenium compatible browser fuzzing library.*
- Run `gn args out/thorium` and the contents of 'args.gn' in the 'misc' dir of this repo should be copy/pasted into the editor. Note that for Windows, Mac, ChromiumOS, or Android there are seperate &#42;_args.gn files for those platforms. *--Include your api keys here at the top or leave blank, and edit the last line to point to the actual path and file name of '&#42;.profdata'*
- 'misc/args.list' contains an alphabetical list with descriptions of all possible build arguments; gn_args.list gives a similar list but with the flags in args.gn added.
- To build, run `autoninja -C out/thorium chrome chromedriver chrome_sandbox content_shell -j8` For Windows, use `autoninja -C out/thorium chrome chromedriver content_shell setup mini_installer -j8` *The -j# can be changed to limit or increase the number of jobs (generally should be the number of CPU cores on your machine)*
- To install, copy/paste the contents of your *out/thorium* dir to a good location, i.e. *$HOME/bin/thorium*. **RECOMMENDED - Copy and run clean.sh within this dir to clean up build artifacts**. Then you can just run the browser with `~/bin/thorium/chrome`, the content_shell with `~/bin/thorium/content_shell`, or chromedriver with `~/bin/thorium/chromedriver`.
- **Proper Install:** To install with a .deb, dont copy the contents of *out/thorium*; instead run <br/> `autoninja -C out/thorium/ "chrome/installer/linux:unstable_deb"` A nice .deb file will now be in *out/thorium* and you can install it with `sudo dpkg -i *.deb` It will be called 'thorium-browser-unstable_$VERSIONNUMBER_amd64.deb', and will be installed to */opt/chromium.org/thorium-unstable/*. \
- **Proper Install:** To install with a .deb, dont copy the contents of *out/thorium*; instead run <br/> `autoninja -C out/thorium/ "chrome/installer/linux:unstable_deb"` A nice .deb file will now be in *out/thorium* and you can install it with `sudo dpkg -i *.deb` It will be called 'thorium-browser-unstable_$VERSIONNUMBER_amd64.deb', and will be installed to */opt/chromium.org/thorium-unstable/*. For Windows, just run the mini_installer.exe. \
&nbsp;&nbsp; NOTE: To get back to "Trunk", i.e. to revert all changes in order to build vanilla chromium, just run `./trunk.sh` again. \
&nbsp;&nbsp; NOTE: To compile without AVX, simply go to *//chromium/src/build/config/compiler/BUILD.gn*, search for *mavx* (there's only two <br/> &nbsp;&nbsp; lines), and replace *mavx* with *msse3*, then remove the lines right under both of those that contain *"-ffp-contract=fast",*
&nbsp;&nbsp; NOTE: To compile without AVX, simply go to *//chromium/src/build/config/compiler/BUILD.gn*, search for *mavx*, and replace *mavx* with *msse3*.

https://www.reddit.com/r/ChromiumBrowser/ is a subreddit I made for Thorium and general Chromium discussion and https://alex313031.blogspot.com/ is a blog I made relating to Chromium/ChromiumOS. I also build ChromiumOS with codecs, linux-firmware/modules, and added packages at > https://github.com/Alex313031/ChromiumOS/
https://www.reddit.com/r/ChromiumBrowser/ is a subreddit I made for Thorium and general Chromium discussion and https://alex313031.blogspot.com/ is a blog I made relating to Chromium/ChromiumOS. \
I also build ChromiumOS with codecs, linux-firmware/modules, and added packages at > https://github.com/Alex313031/ChromiumOS/

&minus; Thanks to https://github.com/robrich999/ for some info and fixes that went into this project.\
&minus; Thanks to https://github.com/midzer/ for support and helping with builds. \
Expand Down

0 comments on commit 90018c6

Please sign in to comment.