[Nexus 5 Android Development] Dark_Eyes_:
Ok, so as promised, here are a few instructions to get to building ROMs. I decided to share it here instead of via PM so it can be used by everybody (but thanks again [MENTION=7147768]Rayfen Windspear[/MENTION] for the donation).

First, you'll need a build environment. It has to be on Unix or Mac, you can't build on Windows. Also, your PC needs to be 64bit, it won't work otherwise. There are a few sites to help you get started with that, even Google has a page for it : https://source.android.com/setup/initializing

Once you're done with that, the fun stuff begins. First, create a new directory called darkrom (or whatever you want) and enter it, then type

repo init -u git://github.com/darkeyes84/android.git -b darkrom

That will init the manifest (it's named default.xml) in my android repo. The manifest contains the links to all the repos that need to be downloaded. Notice that this is on my github (https://github.com/darkeyes84) and that it syncs the darkrom branch (-b darkrom). For instance, if you want to sync lineage 15, you would type

repo init -u git://github.com/LineageOS/android.git -b lineage-15.0

Other ROMs work just the same, but you have to know the github link, the repo name that contains the manifest (not always android.git) and the name of the branch you want to sync.

Once you have repo init, you can start syncing the whole manifest. That's gonna take a while and a lot of bandwidth (last I checked it was around 40 gigs of download). Type

repo sync

Let it do it's thing. When it's done, it's time to sync device specific repos. I always get my device and kernel repos from LineageOS directly. Let's give an example with hammerhead. For the device, go in the device folder in the directory you created earlier. Then type

git clone https://github.com/LineageOS/android_device_lge_hammerhead lge/hammerhead -b cm-14.1

That will clone the android_device_lge_hammerhead repo in the lge/hammerhead folder. I guess you already got the part where it will sync the cm-14.1 branch ;)

For kernel, go to the kernel folder in the main directory you created earlier and type

git clone https://github.com/LineageOS/android_kernel_lge_hammerhead lge/hammerhead -b cm-14.1

That will clone the android_kernel_lge_hammerhead repo, just like you did for the device repo. We are almost done now. All that is left is what is called the vendor files (might have heard them called blobs too), which are nothing but proprietary files from some manufacturers. You can get them from TheMuppets repo. First, go in the vendor directory on the main directory that you created earlier, and type

git clone https://github.com/TheMuppets/proprietary_vendor_lge lge -b cm-14.1

That will clone the entire lge vendor files, so you will notice that many other phone models will be in there. Fortunately, hammerhead is there too :)

Now, if all went well, you should be able to build straight away. Notice that I made changes to the device repo to remove force-encryption for example, so you won't have exactly the same build as I do, but it should be pretty close. If you are brave enough :), go back to your main directory and type

. build/envsetup.sh

Notice the whitespace between the . and the build/envsetup.sh. It is important. That will setup the environment and get it ready to build. You will need to do that step every time you start a fresh terminal. Then type

brunch lineage_hammerhead-userdebug

Hopefully, the build process will start and do it's thing. It should take around an hour or two to complete the build on a good PC to many hours on a low-end PC. If you are lucky it will finish without any problems. Most likely it will fail at some point and you'll have to figure out why. That's the fun (and not so fun) part of building.

Happy building guys!