Install Chromium from source on Mac OS X

What is Chromium?
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

What is needed?
A apple developers account
a up to date version of xcode

The installation of chromium from source on Mac OS X Lion is pretty easy and most of what I will write below you can also find on the Chromium website, I just wrote everything in one easy to read guide the website of Chromium is: https://www.chromium.org/.

This guide assumes you have a working version of xcode running you are able to find on the Chromium website alternative ways to install from the source on os x.

Step 1: Create the directory to download the source to
$ mkdir Program/Chromium/

I created this directory in my home directory.

Step 2: Download the depot_tools (into the Chromium directory you created in Step 1)
$ svn co https://src.chromium.org/svn/trunk/tools/depot_tools

Step 3: Add the depot_tools directory to your path
$ export PATH="$PATH":`pwd`/depot_tools

Step 4: Create the working directory (this only works if you did Step 3)
$ gclient config https://src.chromium.org/svn/trunk/src https://chromium-status.appspot.com/lkgr

Step 5: Open the .gclient file

$ vi .glient

Step 6: make the file look like this
solutions = [
{ "name" : "src",
"url" : "https://src.chromium.org/svn/trunk/src",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
"src/third_party/WebKit/LayoutTests": None,
"src/chrome/tools/test/reference_build/chrome": None,
"src/chrome_frame/tools/test/reference_build/chrome": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/third_party/hunspell_dictionaries": None,
"safesync_url": "https://chromium-status.appspot.com/lkgr",

What we did here is basically remove all the things we do not need to download to compile Chromium successfully.

Now we are ready to download the source code however we first need to make sure that Chromium is in a state that it can be successfully compiled for this you will need to go to the following website:

OPEN – The tree is in a good state and you should be able to compile the code. Go to the next step.

CLOSED – There might be compile or test failures. You can download the code, but you’ll get those same failures when you try to compile or run tests. Best to check back later.

Step 7: Download the Chromium source code (accept the SSL certificate permanently)
$ gclient sync

If you already have the Chromium source code and you want to update to the newest revision you can simply run:
$ client sync --revision src@#####

Make sure you change the ##### to the latest green revision number

I will use “ninja” in the guide to compile Chromium but the Chromium website also has alternative methods such as the use of Xcode.

Step 6: Regenerate the build files to match your OSX Lion
Go to into the “src” directory and run the following command (based on Xcode 4.3.2)
$ GYP_GENERATORS=ninja GYP_DEFINES=mac_sdk=10.6 ./build/gyp_chromium

Step 7: Build Chromium (change the # to the number it shows in Step 7)
$ ninja -C out/Debug chrome

The compile time for me on a MacBook Air (i7 4GB) was around 45 minutes to a hour.

Step 8: Copy the newly build Chromium into your Applications folder
$ cp [PATH TO YOUR CHROMIUM DIRECTORY]/Chromium/src/out/Debug/Chromium.app /Applications

For me this is:

Step 9: Start Chromium
Go to your Applications folder and double click on the Chromium Application.

When I first tried compiling Chromium I received the following error:
../../third_party/webrtc/system_wrappers/source/cpu_info.cc:16:10: fatal error: 'sys/types.h' file not found

This error is caused by Xcode not providing a path directory automatically, I could resolve the issue by running the following command:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer


Related posts

How to install MongoDB 3.4 in replication on Windows Server 2016

Sjir Bagmeijer

How to set up suEXEC in Apache

Sjir Bagmeijer

How to install MongoDB 3.0 in replication on Windows Server 2012 R2

Sjir Bagmeijer