[Android Software/Hacking General [Developers Only]] Adi Shakthi:
[Guide][Q&A][How To Build SOKP From Source][ Build SOKP for any open source** device]

Building SOKP from source for Any Device !!!​

Some Important Links Of SOKP

Official Web Page

Features of SOKP

Change-Logs of SOKP

Source Code

Credits:

@Stephen for his guide written to build cm for Shamu.

Part-1 Preparation : Setting up Build Environment & Downloading SOKP Source*

This guide will walk you through, how to build SOKP for any other device source. To complete this, you will need a PC with either virtual box setup and Ubuntu or duel boot Windows and Ubuntu or else system with ubuntu installed as standalone OS. I recommend Ubuntu 14.04LTS version of Ubuntu for this purpose .

Recommended configuration of PC required for build Process:

Processor : Intel I5

Ram * * * : Min 8GB

Hard Disk : 250 GB

OS * * * *: Ubuntu 14.04 LTS

A Decent net connection with unlimited Data Plan and min of 1Mbps speed .[Dont try this in 512Kbps net connection]

I won't go into too much detail on how to setup Ubuntu on your PC. For this guide, you do need to know the basic commands and how to use Ubuntu.

Some use-full links :

A list of basic Ubuntu commands

Ubuntu: A Beginner’s Guide

Virtual Box

Ubuntu ISO

Disclaimer:

I am not responsible for any damage done to your device, thermal nuclear war etc.

Please use at your own risk. Your warranty may be affected if you install a custom rom.

I am also not responsible if you go over your payment plan when downloading the source code.

It is large over 25gb+ so be careful *!!!!

So assuming you have Ubuntu 14.* set up, you will need to now set up your build environment

First on their guide it talks about installing the SDK tools. You do not need these to build the ROM. You only really need ADB commands. I installed fastboot as well.

Install ADB command

sudo apt-get install android-tools-adb

Install Fastboot command

sudo apt-get install android-tools-fastboot

Install Java

sudo apt-get install openjdk-7-jdk

Setting up the build Environment:

sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev*
git gnupg ccache lzop flex bison gperf build-essential zip curl libc6-dev lib32ncurses5-dev x11proto-core-dev lib32z1-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc libreadline6-dev lib32readline-gplv2-dev libncurses5-dev bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev phablet-tools pngquant*

If you have a 64bit PC install the following:*

g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev

Setting your build directory - This can be any folder you want. for my example I will use sokp as my root folder. Remember that Ubuntu is case sensitive when switching folders.*

mkdir -p ~/sokp

Install Repo

mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

Now for the good bit! We are about to download the source for SOKP *Warning: The download is large and will take a long time to download. *I believe the download is 25gb+ in size, so you will have to take this into consideration. Note: I will not be held responsible if you go over your payment plan with your service provider.

Identify Yourself to the Repo*

git config --global user.email "you@youremailaddress.com"*
git config --global user.name "yourpreferredusername"

Initialize the SOKP source repository

cd ~/sokp - this is your root folder
repo init -u repo init -u git://github.com/SOKP/platform_manifest.git -b sokp-l5.1

Download the source code

repo sync

or

repo sync -f

If repo sync errors and stops during download, don't worry you can simply run the command again and it will pick up were it left off.When you have completed the download run it again, to make sure it completes with out any errors. This way you know you have downloaded the full source code.*

Backup your home directory[optional]

Also at this point, what I do is make a backup using the inbuilt backup software in ubuntu. This backs up my entire home directory to a secondary hard drive I have set up in my PC. This way if I have any issues and need to start from scratch, I can simply delete my android directory, then restore from backup.*

This will Finish your Preparation Part .