Establishing Android Build Enviroment under openSUSE Leap
Tutorial how set up Android Build Enviroment on
openSUSE Leap
If this help's u hit Thanks! --
Over on XDA
0) Make sure your repo's are up to date:
sudo zypper refresh
1) If you don't have a fresh installation of
openSUSE Leap first you need remove all Java installation, many people might have the wrong version of Java installed.
Code:
sudo zypper remove openjdk-* icedtea-* icedtea6-*
Follow the on-screen instructions to remove any stray Java versions. Otherwise, move on to the next step.
2) Install the main build tools with this command:
Code:
sudo zypper install bison curl flex git gnupg gperf libesd-devel liblz4-1_4 ncurses-devel libSDL-devel python-wxWi dgets-devel
libxml2-2 libxml2-tools lzop java-1.7.0-openjdk java-1.7.0-openjdk-devel schedtool squashfs libxslt1 zip zlib-devel make gcc-c++
Appendx A to 2:
To setup maven which is needed for building:
1. Download maven:
wget http://mirrors.ibiblio.org/apache/ma...3.9-bin.tar.gz
2. Extract the file
tar -xvzf apache-maven-3.3.9-bin.tar.gz /tmp
3. Move to /opt/ folder
sudo mv /tmp/apache-maven-3.3.9 /opt/
4. Update environment, cd to home directory
cd ~
nano .bashrc
5. Append the path
export PATH=$PATH:/opt/apache-maven-3.3.9/bin
6. Reload
source .bashrc
7. Verify maven
mvn --version
Appendix B to 2:
For 64-bit system also install:
sudo zypper install glibc-devel-32bit ncurses-devel-32bit readline-devel-32bit libz1-32bit
>> build-essential << is an
Ubuntu meta package which in
openSUSE is devel_basis
And u can install it by command
sudo zypper install --type pattern devel_basis
Select
y to what it is offering to install.
To see if it is already installed use:
sudo zypper se -t pattern devel
3) Repo install...
mkdir ~/bin && curl http://commondatastorage.googleapis....downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Appendix to 3:
To fix repo sync u will need install this:
sudo zypper install libpth20-32bit
maybe this to:
sudo zypper install openjdk-8-devel
4) Use your favorite text editor to open ~/.bashrc - I like nano:
Code:
nano ~/.bashrc
By default nano is not installed so install it by command:
sudo zypper install nano
5) At the very bottom (use the Page Down key) paste this code to a new line:
Code:
export PATH=~/bin:$PATH
export USE_CCACHE=1
6) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc
7) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder.
Code:
mkdir ~/android
cd android
mkdir lineage
cd lineage
8) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.
For the purposes of this tutorial, here's the command for Cyanogenmod 13 (Marshmallow) :
Code:
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
Well I am changing it to LineageOS 14.1
Code:
repo init -u https://github.com/CyanogenMod/android.git -b cm-14.1
And then to LineageOS 15.1
Code:
repo init -u git://github.com/LineageOS/android.git -b lineage-15.1
9) Time to get the source, many gigabytes of downloading await.
Don't worry, it's automated. It's the last one!
And it is the same for all 3.
Code:
repo sync
Check back periodically every hour or so. It all depends on how fast your connection is.
When finished jump to
Build 14.1
or
Build 15.1
Fetching projects: 98% (636/648) error: Cannot fetch LineageOS/android_external_libdrm (GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata, use `repo sync --force-sync external/libdrm` to proceed.)
From _litz: January 10th, 2014
it's a matter of "what does what" ...
all repo init does, is pull down manifest.xml and start seeding the information in the .repo directory.
repo sync is what actually goes to each and every project listed in either manifest.xml or
local_manifest.xml, and pulls the actual code down, project by project by project. The reason you use
"-j 8" or "-j 16" is to allow it to pull multiple projects in parallel, thus speeding up the process.
Remember:
manifest.xml = all of the CM projects, android OS projects, etc.
local_manifest.xml = all of the device specific stuff that makes a Rezound a Rezound
(and makes android actually work on a Rezound)
That's it! Everything should be ready to go.
Comments...