├── Chromium Screenshot.jpg ├── Old ├── crmscrnshtOLD.jpg ├── configSample.txt ├── test.sh ├── easychromium OLD.sh └── updater OLD.sh ├── thanks.md ├── .gitignore ├── LICENSE ├── README.md ├── xcodehelp.txt ├── easychromium.sh └── easychromium2.sh /Chromium Screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-bobo/easychromium/HEAD/Chromium Screenshot.jpg -------------------------------------------------------------------------------- /Old/crmscrnshtOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-bobo/easychromium/HEAD/Old/crmscrnshtOLD.jpg -------------------------------------------------------------------------------- /thanks.md: -------------------------------------------------------------------------------- 1 | Thanks: Christian Biesinger, Torne (Richard Coles), Sylvain Defresne, Thiago Farina, Marshall Greenblatt, Stuart Morgan, Primiano Tucci, Nico Weber. 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore config file with secrets 2 | config.txt 3 | 4 | # ignore others 5 | .DS_Store 6 | logeasychromium.log 7 | 8 | # google depot_tools folder 9 | depot_tools -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Bobo 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # easychromium 2 | Bash script to build and install latest stable Chromium from source on OS X 3 | 4 | Run with: 5 | 6 | bash easychromium.sh 7 | 8 | Can be run as a cron job for automatic updates. 9 | 10 | ![chromium screenshot](https://raw.githubusercontent.com/the-bobo/easychromium/master/Chromium%20Screenshot.jpg) 11 | 12 | Copy the [your folder]/src/out/Release/Chromium.app file into /Applications/ when it finishes. 13 | 14 | You need: git 1.9+, XCode 5+, OS X 10.9+, ~15-20GB of space, ~3-5 hours on 16GB RAM, more otherwise. 15 | 16 | Tested on: 17 | * OS X El Capitan 10.11.2 18 | * XCode 7.2 19 | * git version 2.6.4 (git-scm, not apple git) 20 | * Python 2.7.10 21 | * gclient.py 0.7 (from depot_tools) 22 | 23 | Successfully built Chromium Version 48.0.2564.116 (64-bit), the latest stable release for OSX. -------------------------------------------------------------------------------- /xcodehelp.txt: -------------------------------------------------------------------------------- 1 | You are here either because you don't have Xcode 5+ installed, don't have xcode-cli installed, or both. 2 | 3 | If you already have Xcode 5+ installed but not xcode-cli, try: 4 | xcode-select --install 5 | 6 | If you need to update Xcode, please update it. 7 | 8 | If you need to install Xcode, please read below: 9 | 10 | Be aware, this download takes forever (>= 5 hours). You will need an Apple Developer account (free) to sign in. 11 | 12 | You should use curl from the command line to download XCode since it permits resuming from partial downloads, 13 | and is faster. 14 | 15 | Make sure you set System Preferences -> Energy Saver to PREVENT computer from sleeping when display turns off. 16 | 17 | After installing Xcode run the following to agree to the Xcode licenses: 18 | sudo xcodebuild 19 | 20 | You will need a cookie exporter: 21 | Firefox - https://addons.mozilla.org/en-US/firefox/addon/cookie-exporter/ 22 | 23 | Chrome - https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg?hl=en 24 | 25 | After signing in to the Apple developer site, export your cookies to the folder you want to download 26 | XCode into and name them "cookies.txt" Then, use the following command: 27 | 28 | curl --cookie cookies.txt -O -C - http://adcdownload.apple.com/Developer_Tools/Xcode_7.2/Xcode_7.2.dmg 29 | 30 | --cookie cookies.txt: tells curl to look in cookies.txt for cookies 31 | -O: tells curl to name the output file identically to its name on the remote host (so we'll save this file as Xcode_7.2.dmg) 32 | -C : (note the space after the C) tells curl to resume automatically from the last point in the file, the space indicates 33 | we want curl to figure out the byte offset instead of specifying one ourselves 34 | - url: (note the space after the -) tells curl where to fetch the file from 35 | -------------------------------------------------------------------------------- /Old/configSample.txt: -------------------------------------------------------------------------------- 1 | # This is a sample. Rename to "config.txt" and place in same folder as easychromium.sh 2 | 3 | # API keys for building Chromium 4 | # keep your keys private, **DO NOT** commit these to github 5 | # replace NULL with the appropriate key 6 | # see https://sites.google.com/a/chromium.org/dev/developers/how-tos/api-keys for details 7 | 8 | # actually i think this needs to be replaced -- seems like you just need these three keys? 9 | #'google_api_key': 'your_api_key', 10 | #'google_default_client_id': 'your_client_id', 11 | #'google_default_client_secret': 'your_client_secret', 12 | # see http://dev.chromium.org/developers/how-tos/api-keys 13 | 14 | 15 | # Chrome Remote Desktop API 16 | RemoteDesktop=NULL 17 | 18 | # Chrome Spelling API 19 | Spelling=NULL 20 | 21 | # Chrome Suggest API 22 | Suggest=NULL 23 | 24 | # Chrome Sync API 25 | Sync=NULL 26 | 27 | # Chrome Translate Element 28 | Translate=NULL 29 | 30 | # Chrome Web Store API 31 | WebStore=NULL 32 | 33 | # Google Maps Geolocation API 34 | # (requires enabling billing but is free to use; you can skip this one, in which case geolocation features of Chrome will not 35 | # work) 36 | MapsLocation=NULL 37 | 38 | # Safe Browsing API 39 | # while enhancing security against malware and phishing, this feature spies on you: 40 | # see "Cookies from Nowhere" - http://ashkansoltani.org/2012/02/25/cookies-from-nowhere/ 41 | # and "NSA uses Google cookies to pinpoint targets for hacking" - https://www.washingtonpost.com/news/the-switch/wp/2013/12/10/nsa-uses-google-cookies-to-pinpoint-targets-for-hacking/ 42 | 43 | MotherShouldITrustTheGovernment=NULL 44 | 45 | # Speech API 46 | Speech=NULL 47 | 48 | # Google Maps Time Zone API 49 | MapsTimeZone=NULL 50 | 51 | # Google Cloud Messaging for Chrome 52 | CloudMessaging=NULL 53 | 54 | # Drive API (Optional, enable this for Files.app on Chrome OS and SyncFileSystem API) 55 | DriveAPI=NULL 56 | 57 | # Google Now For Chrome API (Optional, enabled to show Google Now cards) 58 | Now=NULL 59 | 60 | # Google+ API 61 | Plus=NULL 62 | 63 | #Chrome OS Hardware ID API (Optional, Chrome OS) 64 | HardwareID=NULL 65 | 66 | # Device Registration API (Optional, Chrome OS) 67 | DeviceRegistration=NULL -------------------------------------------------------------------------------- /easychromium.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # run by typing: bash easychromium.sh 4 | 5 | # you need: XCode 5+, OSX 10.9+, ~10-20GB of space, ~3-5 hours (on 16GB RAM, more if less RAM) 6 | 7 | # This script builds the latest version of the open source Chromium browser for OS X from source 8 | # Copy the [your folder]/src/out/Release/Chromium.app file into /Applications/ when it finishes 9 | 10 | # DOES check to see if you already have the source code downloaded 11 | # DOES check to see if the latest version is ahead of locally installed version 12 | 13 | 14 | #################### 15 | #################### 16 | # PRE-BUILD BEGIN 17 | #################### 18 | #################### 19 | 20 | # initialize logfile, appends by default and creates if not found 21 | 22 | LOGFILE="./logeasychromium.log" 23 | 24 | echo "=========New Build Attempt=========" | tee -a $LOGFILE 25 | echo $(date) | tee -a $LOGFILE 26 | echo "=========New Build Attempt=========" | tee -a $LOGFILE 27 | 28 | # check OS X version, can be used in future for choosing different code flows on basis of OS version 29 | 30 | OS_VERSION=$(sw_vers -productVersion) 31 | echo "OS X Version "$OS_VERSION" detected" | tee -a $LOGFILE 32 | 33 | 34 | 35 | ######################### 36 | # SOFTWARE VERSION CHECKS 37 | ######################### 38 | 39 | echo "Beginning software version checks" | tee -a $LOGFILE 40 | 41 | ### 42 | # Based in part on version checker code cc by-sa 3.0 43 | # Courtesy http://stackoverflow.com/users/1032785/jordanm at http://stackoverflow.com/a/11602790 44 | ### 45 | 46 | 47 | ######################### 48 | # git check 49 | ######################### 50 | 51 | 52 | if command -V git >/dev/null 2>&1; then 53 | 54 | for cmd in git; do 55 | [[ $("$cmd" --version) =~ ([0-9][.][0-9.]*) ]] && version="${BASH_REMATCH[1]}" 56 | var1=$(echo "$version" | cut -d. -f1) 57 | var2=$(echo "$version" | cut -d. -f2) 58 | var3=$(echo "$version" | cut -d. -f3) 59 | 60 | if [[ $var1 -lt 2 ]]; then 61 | echo 'ERROR: '$cmd' version 2.2.1 or higher required' | tee -a $LOGFILE 62 | exit 1; 63 | fi 64 | if [[ $var1 -gt 2 && $var2 -lt 2 ]]; then 65 | echo 'ERROR: '$cmd' version 2.2.1 or higher required' | tee -a $LOGFILE 66 | exit 1; 67 | fi 68 | if [[ $var1 -gt 2 && $var2 -gt 2 && $var3 -lt 1 ]]; then 69 | echo 'ERROR: '$cmd' version 2.2.1 or higher required' | tee -a $LOGFILE 70 | exit 1; 71 | fi 72 | done 73 | else 74 | echo "ERROR: git is not installed, please install Xcode and xcode-cli to get git, or brew install git" | tee -a $LOGFILE 75 | exit 1; 76 | fi 77 | 78 | 79 | ######################### 80 | # xcode check 81 | ######################### 82 | 83 | 84 | XCODE_CHECK="$(command xcodebuild -version 2>&1)" 85 | if [[ "$XCODE_CHECK" =~ "requires" ]]; then 86 | echo "Xcode not found, please see xcodehelp.txt in this repository and install Xcode." | tee -a $LOGFILE 87 | exit 1; 88 | 89 | elif [[ "$XCODE_CHECK" =~ "note" ]]; then 90 | echo "Xcode and xcode-cli not found, please see xcodehelp.txt in this repository and install Xcode." | tee -a $LOGFILE 91 | exit 1; 92 | 93 | else 94 | echo "Xcode detected, testing version" | tee -a $LOGFILE 95 | for cmd in xcodebuild; do 96 | [[ $("$cmd" -version) =~ ([0-9][.][0-9.]*) ]] && version="${BASH_REMATCH[1]}" 97 | if ! awk -v ver="$version" 'BEGIN { if (ver < 5.0) exit 1; }'; then 98 | echo 'ERROR: '$cmd' version 5.0 or higher required' | tee -a $LOGFILE 99 | echo 'XCode version detected was: '$version | tee -a $LOGFILE 100 | exit 1; 101 | fi 102 | echo 'XCode version detected was: '$version | tee -a $LOGFILE 103 | done 104 | fi 105 | 106 | 107 | ######################### 108 | # depot_tools check 109 | ######################### 110 | 111 | 112 | if [ -d ./depot_tools/ ] 113 | then 114 | echo "./depot_tools/ found, updating PATH" | tee -a $LOGFILE 115 | else 116 | echo "./depot_tools/ not found, git cloning to get it" | tee -a $LOGFILE 117 | git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git 118 | if [[ $? -eq 0 ]]; then 119 | echo "git clone of depot_tools successful" | tee -a $LOGFILE 120 | else 121 | echo "git clone of depot_tools failed, exiting" | tee -a $LOGFILE 122 | exit 1; 123 | fi 124 | fi 125 | 126 | export PATH=`pwd`/depot_tools:"$PATH" 127 | if [[ $? -eq 0 ]]; then 128 | echo "PATH successfully updated to $PATH" | tee -a $LOGFILE 129 | echo "this PATH update is non-permanent, only for this shell session" | tee -a $LOGFILE 130 | else 131 | echo "Error updating PATH with depot_tools, exiting" | tee -a $LOGFILE 132 | exit 1; 133 | fi 134 | 135 | #################### 136 | #################### 137 | # PRE-BUILD END 138 | #################### 139 | #################### 140 | 141 | echo "#### PRE-BUILD COMPLETE ####" | tee -a $LOGFILE 142 | 143 | 144 | #################### 145 | #################### 146 | # BUILD BEGIN 147 | #################### 148 | #################### 149 | 150 | echo "#### BEGIN BUILD ####" | tee -a $LOGFILE 151 | 152 | # retrieves CSV of current Chromium releases, saves in a file "releasestargets" without extension 153 | curl https://omahaproxy.appspot.com/all -o releasestargets 154 | 155 | # returns the version number of the current stable Chromium release for mac, cutting on the comma 156 | # sample: 48.0.2564.116 157 | TARGET=$(grep mac,stable, releasestargets | cut -d, -f3) 158 | echo "target Chromium version is: $TARGET" | tee -a $LOGFILE 159 | rm releasestargets 160 | 161 | if [ -d /Applications/Chromium.app/ ] 162 | then 163 | echo "Chromium exists in /Applications/" | tee -a $LOGFILE 164 | echo "checking if latest stable release is newer than current install" | tee -a $LOGFILE 165 | CURRENT=$(mdls -name kMDItemVersion /Applications/Chromium.app/ | awk '/kMDItemVersion/{print $NF}' | sed 's/"//g') 166 | echo "current version is: $CURRENT" 167 | 168 | version_1=$TARGET 169 | version_2=$CURRENT 170 | 171 | #The following bash function will return 0 (true) if $version_1 > $version_2, 1 (false) otherwise, 172 | #as long as the variables $version_1 and $version_2 both contain only an arbitrary number of digit groups separated by periods 173 | #adapted from code by kopischke (credit cc-by-sa 3.0) on stack exchange: http://apple.stackexchange.com/a/86362 174 | 175 | function versions_check { 176 | while [[ $version_1 != "0" || $version_2 != "0" ]]; do 177 | (( ${version_1%%.*} > ${version_2%%.*} )) && return 0 178 | [[ ${version_1} =~ "." ]] && version_1="${version_1#*.}" || version_1=0 179 | [[ ${version_2} =~ "." ]] && version_2="${version_2#*.}" || version_2=0 180 | done 181 | false 182 | } 183 | #Implementing other comparisons, like greater or equal, is as simple as changing the comparison operator of the arithmetic 184 | #evaluation, i.e. (( ${version_1%%.*} >= "${version_2%%.*}" )). 185 | 186 | versions_check $version_1 $version_2 187 | if [[ $? -eq 0 ]]; then 188 | echo "TARGET version is newer than CURRENT, proceeding to update" | tee -a $LOGFILE 189 | else 190 | echo "TARGET version is NOT newer than CURRENT, aborting" | tee -a $LOGFILE 191 | exit 1; 192 | fi 193 | else 194 | echo "Chromium not found in /Applications/, proceeding to build from latest stable release" | tee -a $LOGFIE 195 | fi 196 | 197 | if [ -d ./src/ ] 198 | then 199 | echo "./src/ found, proceeding to gclient sync master" | tee -a $LOGFILE 200 | else 201 | echo "./src/ not found, assuming this is a fresh install, fetching chromium" | tee -a $LOGFILE 202 | fetch chromium | tee -a $LOGFILE 203 | fi 204 | 205 | cd src 206 | SRC_PATH=`pwd` 207 | echo "$SRC_PATH" 208 | 209 | 210 | git checkout master 211 | git fetch --tags origin | tee -a $LOGFILE 212 | # export GYP_DEFINES="fastbuild=1 mac_strip_release=1 ffmpeg_branding=Chrome proprietary_codecs=1 buildtype=Official" 213 | 214 | gclient sync --verbose --verbose --verbose --jobs 16 | tee -a $LOGFILE 215 | git checkout -b new_release$TARGET tags/$TARGET | tee -a $LOGFILE 216 | gclient sync --verbose --verbose --verbose --with_branch_heads --jobs 16 | tee -a $LOGFILE 217 | git checkout master | tee -a $LOGFILE 218 | gclient sync --verbose --verbose --verbose --jobs 16 | tee -a $LOGFILE 219 | git checkout new_release$TARGET | tee -a $LOGFILE 220 | 221 | #export GYP_DEFINES="fastbuild=1 mac_strip_release=1 ffmpeg_branding=Chrome proprietary_codecs=1 buildtype=Official" 222 | 223 | # build args.gn (replacement for obsolete GYP_DEFINES) 224 | touch "args.gn" 225 | echo -e 'symbol_level=1\nenable_stripping=true\nffmpeg_branding="Chrome"\nproprietary_codecs=1\nis_official_build=true' > ./args.gn 226 | 227 | gclient sync --verbose --verbose --verbose --with_branch_heads --jobs 16 | tee -a $LOGFILE 228 | 229 | echo "after all the gclient sync my pwd is: " | tee -a $LOGFILE 230 | pwd | tee -a $LOGFILE 231 | echo "gonna try to cd to src_path" | tee -a $LOGFILE 232 | cd "$SRC_PATH" | tee -a $LOGFILE 233 | echo "my new pwd is: " | tee -a $LOGFILE 234 | pwd | tee -a $LOGFILE 235 | gn gen out/foo | tee -a $LOGFILE 236 | ninja -C out/foo chrome | tee -a $LOGFILE 237 | 238 | #ARG_VAR="$SRC_VAR/out/Release chrome" 239 | #ninja -C "$ARG_VAR" -------------------------------------------------------------------------------- /Old/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this outputs to console and appends it to logfile (creating logfile if needed) 4 | # echo "my message" | tee -a ./easychromium.log 5 | 6 | # this is a multiline comment 7 | # : <<'COMMENT' 8 | # code 9 | # code 10 | # code 11 | # COMMENT 12 | 13 | # save to a filepath determined by a variable 14 | # LOGFILE="./logtest.log" 15 | # echo "does this work?" | tee -a $LOGFILE 16 | 17 | # $? - use that to see what the last executed command exited with 18 | # 1 is an error condition, 0 is a successful exit 19 | 20 | # see http://mywiki.wooledge.org/BashFAQ/031 21 | # for notes on [ ] vs. [[ ]] (for bash on OS X, just use [[ ]]) 22 | 23 | # redirect stderr to stdout: append 2>&1 to the command 24 | # example: XCODE_CHECK="$(command xcodebuild 2>&1)" 25 | # that captures the stderr and stdout of that command in the variable "$XCODE_CHECK" 26 | # use double quotes to preserve newlines in the variable 27 | # 0 == stdin, 1 == stdout, 2 == stderr 28 | 29 | # command -v is verbose. -V is more verbose. 30 | 31 | # list of conditionals in bash: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html 32 | 33 | if [ $# -lt 1 ]; then 34 | echo "Usage : bash easychromium.sh