[General Topics] ZeroX7C:
Due to the apparent lack in proper documentation on building the Snapdragon browser CAF (Code Aurora Forums) has developed, I've decided to take it upon myself to try and build it. You can find out more about it on the Code Aurora Forums Wiki. This guide only builds for m46. To build for m42, repeat the process but with the .gclient configuration provided on the CAF Wiki.

Requirements:

- At least 50GB of free space (to be safe)

- A stable Internet connection (fast one preferred)

- Ubuntu 14.04 x64 ISO

1. First, you'll need to install Ubuntu 14.04 (64-bit) on your system. You can grab the ISO image on Ubuntu's website.

2. When Ubuntu boots, connect to the Internet and open the Terminal. Run the following commands:

sudo apt-get install git-core
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH":~/depot_tools

* - Note: If you are doing it on a daily machine you may cd into another directory for your convenience, and change '~/depot_tools' to where depot_tools is installed.

* - If you wish too you can add the export line to your ~/.bashrc for convenience too.

3. Create a file called .gclient and enter the following into the text editor:

solutions = [
{ "name" : "src",
"url" : "git://codeaurora.org/quic/chrome4sdp/chromium/src.git@refs/remotes/origin/m46",
"deps_file" : "DEPS",
"managed" : True,
"safesync_url": "",
},
]
target_os = ["android"]

* - You can always type 'nano .gclient' into the terminal to launch possibly the world's best text editor, just type CTRL + X, Y, then ENTER when you're done to save.

4. Now here comes the part which will take up a load of disk space (and Internet bandwidth). First run the following command:

gclient sync -n --no-nag-max

This will download the Android build dependencies and sources.

* - Make sure you do not disconnect from the Internet in the process.

* - You may see nothing change for a long time, just let the process run.

* - This personally took me 12 hours to finish due to my slow Internet connection.

(Optional) Then open src/build/install-build-deps-android.sh and remove the following lines:

DownloadFromBucket() {
bin=$1
path=$2
gs_url=$3
known_hash=$4
tmpfile=${bin}_$(/bin/date +%s)
if [ ! -x ${path}/${bin} ]; then
/b/build/scripts/slave/gsutil cp ${gs_url} ${tmpfile}
md5=$(md5sum ${tmpfile} | cut -d' ' -f 1)
if [[ $known_hash == $md5 ]]; then
/usr/bin/sudo /bin/mv ${tmpfile} ${path}/${bin}
/usr/bin/sudo /bin/chmod a+x ${path}/${bin}
/usr/bin/sudo /bin/chown root:root ${path}/${bin}
else
echo 'ERROR: Bad md5sum. Not installing' ${bin}
exit 1
fi
fi
}

DownloadFromBucket apktool /usr/local/bin \
'gs://chromium-apktool-bucket/apktool_1_5_2/apktool' \
89d099df9f8b12c043dc74f6f1368f36

DownloadFromBucket apktool.jar /usr/local/bin \
'gs://chromium-apktool-bucket/apktool_1_5_2/apktool.jar' \
2d616934a8eaa37c4501868f05c62871

* - These lines were supposed to be removed but CAF did not update their sources.

* - They are near the bottom of the file.

Afterwards, run the command:

cd src
. build/install-build-deps-android.sh

5. When all the dependencies are done installing, enter the following commands to build:

GYP_DEFINES="$GYP_DEFINES clang=0 OS=android" gclient runhooks -v
ninja -C out/Release swe_browser_apk

Have fun! Let me know in the comments below if there are any problems and I'll try my best to reply.

Credits:

hisname - for troubleshooting

enricoros.com - for providing the m46 .gclient file

Screenshots in attachments below. (m42 and m46)