[Galaxy Note 4 General] _mone:
Hi there!

I'm receiving some pm about users that want to learn how to build LineageOS for the Galaxy Note 4 (snapdragon), so here is a quick guide:

Only supported device for now are trltexx/trltedt (N910F/N910G) and trltetmo/trltecan (N910T/N910W8)

I suggest to use a LTS version of ubuntu, in this guide I'll be using Ubuntu 16.04

Let's start with a bit of cleaning:

sudo apt-get remove openjdk-* icedtea-* icedtea6-*

Install java8:

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update && sudo apt-get install openjdk-8-jdk

Install build tools:

sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven

Install repo:

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

Edit ~/.bashrc (in this exaple I'm using gedit to do it):

gedit ~/.bashrc

Add those 2 lines at the bottom of the file (we are going to add also ccache to speed up our build time):

export PATH=~/bin:$PATH
export USE_CCACHE=1

Save it, close gedit and run:

source ~/.bashrc

Let's create some folders where we'll be doing the magic:

mkdir ~/android && cd ~/android
mkdir lineageos && cd lineageos

Initialize the local repo and download the source:

repo init -u git://github.com/LineageOS/android.git -b cm-14.1
repo sync --force-sync

It'll take quite some time, depends on your internet connection.

Once it's done downloading and checking out the files:

cd .repo
mkdir local_manifests && cd local_manifests

Now create a new file in this folder, name it "roomservice.xml" and add this into it:

For trltexx/trltedt:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="underscoremone/android_kernel_samsung_trlte" path="kernel/samsung/trlte" remote="github" revision="cm-14.1" />
<project name="underscoremone/android_device_samsung_trlte-common" path="device/samsung/trlte-common" remote="github" revision="cm-14.1" />
<project name="underscoremone/android_device_samsung_trltexx" path="device/samsung/trltexx" remote="github" revision="cm-14.1" />
<project name="underscoremone/proprietary_vendor_samsung_trlte" path="vendor/samsung" remote="github" revision="cm-14.1" />
<project name="LineageOS/android_device_samsung_qcom-common" path="device/samsung/qcom-common" remote="github" revision="cm-14.1" />
<project name="LineageOS/android_external_stlport" path="external/stlport" remote="github" revision="cm-14.1" />
<project name="LineageOS/android_device_qcom_common" path="device/qcom/common" remote="github" revision="cm-14.1" />
</manifest>

For trltetmo/trltecan:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="underscoremone/android_kernel_samsung_trlte" path="kernel/samsung/trlte" remote="github" revision="cm-14.1" />
<project name="underscoremone/android_device_samsung_trlte-common" path="device/samsung/trlte-common" remote="github" revision="cm-14.1" />
<project name="fat-tire/android_device_samsung_trltetmo" path="device/samsung/trltetmo" remote="github" revision="cm-14.1" />
<project name="underscoremone/proprietary_vendor_samsung_trlte" path="vendor/samsung" remote="github" revision="cm-14.1" />
<project name="LineageOS/android_device_samsung_qcom-common" path="device/samsung/qcom-common" remote="github" revision="cm-14.1" />
<project name="LineageOS/android_external_stlport" path="external/stlport" remote="github" revision="cm-14.1" />
<project name="LineageOS/android_device_qcom_common" path="device/qcom/common" remote="github" revision="cm-14.1" />
</manifest>

Now go back to the root of the source ("lineageos" folder) and repo sync again

cd ../..
repo sync

It'll now download the specific repositories for your device.

Then run

for trltexx/trltedt

. build/envsetup.sh && brunch trltexx

or for trltetmo/trltecan

. build/envsetup.sh && brunch trltetmo

And your build will start.

Once done you'll find your flashable rom.zip file in out/target/product/trlte**/

Congratulations you've successfully compiled LineageOS 14.1 for your device.

Remember to "make clean" every now and then.

------

Sometimes you'll get some errors, try to google the error and if you can not find a solution ask for help here at xda.

------

Hopefully I didn't forget anything.. if you have any trouble following this guide reply to this thread; myself or someone else will try to help you as soon as possible.