Build CyanogenMod 9 for Nexus Q

Initializing the Build Environment
Follow the instructions at http://source.android.com/source/initializing.html, with the following modifications:

[ Mac OS X Only ] : Use Homebrew instead of MacPorts
For Mac OS X, I recommend using installing Homebrew instead of MacPorts and using that to install repo:

$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Android:cm9 rwhitby$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" ==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1 Press ENTER to continue or any other key to abort ==> /usr/bin/sudo /bin/mkdir /usr/local ==> /usr/bin/sudo /bin/chmod g+rwx /usr/local ==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local ==> Downloading and Installing Homebrew... Warning: Install the "Command Line Tools for Xcode": http://connect.apple.com ==> Installation successful! You should run `brew doctor' *before* you install anything. Now type: brew help Android:cm9 rwhitby$

Then install the Command Line Tools from the xcode452cltools10_86938211a.dmg package found at Apple's Developer site (you need to be registered to download it).

Then install the following package:

$ brew install repo gnu-sed pngcrush

[ Mac OS X Only ] : Mac OS X 10.5 SDK Installation
When building Android 4.0.4 for the Nexus Q on Mac OS X, you will also need the Mac OS X 10.5 SDK installed.

You can find the Mac OS X 10.5 SDK in the xcode_3.2.6_and_ios_sdk_4.3.dmg package from Apple's Developer site (you need to be registered to download it).

The MacOSX10.5.pkg file is in a hidden folder named "Packages" on the disk image. After mounting the .dmg file, you can open the "Packages" directory from the command line with open /Volumes/Xcode\ and\ iOS\ SDK/Packages/. Right click the MacOSX10.5.pkg file, and choose "Open" (this allows you to bypass the unidentified developer restriction in Mountain Lion). When installing the package, choose change install location and option-click on the drive you want to install to, so that you can specify a folder. The target folder should be /Developer.

Downloading the Source
Follow the instructions at http://source.android.com/source/downloading.html, with the following modifications:

Initializing a Repo client
Use the following command to initialise the repo from CyanogenMod instead of from android.googlesource.com:

$ repo init -u git://github.com/CyanogenMod/android.git -b ics

Android:cm9 rwhitby$ repo init -u git://github.com/CyanogenMod/android.git -b ics ... Get git://github.com/CyanogenMod/android.git ... From git://github.com/CyanogenMod/android * [new branch]     cm-10.1    -> origin/cm-10.1 ... * [new branch]      cm-9.0.0   -> origin/cm-9.0.0 * [new branch]     cm-9.1.0   -> origin/cm-9.1.0 ... * [new branch]      ics        -> origin/ics * [new branch]     ics-release -> origin/ics-release ... repo initialized in /Volumes/Linux/cm9 Android:cm9 rwhitby$

Getting the files
Before running repo sync, create a .repo/local_manifest.xml file with the following contents:

          

$ repo sync

Android:cm9 rwhitby$ repo sync ... From git://github.com/CyanogenMod/android * [new branch]     ics        -> github/ics ... Fetching projects: 100% (267/267), done. ...

Building the System
Follow the instructions at http://source.android.com/source/building.html, with the following modifications:

Choose a Target
Use the following command instead of "lunch":

breakfast phantasm

You should see the following configuration settings reported:

============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=4.0.4 TARGET_PRODUCT=cm_phantasm TARGET_BUILD_VARIANT=userdebug TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon HOST_ARCH=x86 HOST_OS=darwin HOST_BUILD_TYPE=release BUILD_ID=IMM76L ============================================

Build the Code
Instead of "make -j4", use the following command:

mka bacon