FORUMS
Remove All Ads from XDA

Establishing Android Build Enviroment under openSuse Leap

638 posts
Thanks Meter: 934
 
By aZuZu, Recognized Developer on 18th September 2016, 07:16 PM
Post Reply Email Thread
Tutorial how set up Android Build Enviroment on openSUSE Leap

If this help's u hit Thanks!

1) If you don’t have fresh installed 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 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.

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

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

9) Time to get the source, many gigabytes of downloading await.
Don't worry, it's automated. It's the last one!
Code:
repo sync
Check back periodically every hour or so. It all depends on how fast your connection is.

That's it! Everything should be ready to go.
The Following 8 Users Say Thank You to aZuZu For This Useful Post: [ View ]
 
 
19th December 2016, 07:33 PM |#2  
dani020110's Avatar
Senior Member
Flag Lima
Thanks Meter: 209
 
More
Thanks for the guide
In Tumbleweed, the package is liblz4-1_7
There is a typo, it should be python-wxWidgets-devel
Also, the link to repo should be complete:
Code:
http://commondatastorage.googleapis.com/git-repo-downloads/repo
The Following User Says Thank You to dani020110 For This Useful Post: [ View ] Gift dani020110 Ad-Free
2nd October 2017, 01:31 AM |#3  
Member
Flag Aveiro
Thanks Meter: 9
 
More
Thanks
does it worth to have a separate user for builds?
17th February 2019, 04:40 AM |#4  
_mone's Avatar
Recognized Developer
London
Thanks Meter: 2,778
 
More
Android Build Enviroment for openSUSE tumbleweed early 2019
Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:
Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc
You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools

Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip
Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.
The Following User Says Thank You to _mone For This Useful Post: [ View ]
20th March 2019, 05:49 PM |#5  
Senior Member
Thanks Meter: 68
 
More
Quote:
Originally Posted by _mone

Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:

Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc
You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools

Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip
Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.

Thanks for this. I'm still getting an error and wondering what SSL packages you have installed? I'm obviously missing one below.
EDIT: i kept installing SSL packages until it worked, can't remember which one did the trick but it seems it's chugging along now

/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
#include <openssl/bio.h>
^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:101: scripts/extract-cert] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/Makefile:558: scripts] Error 2
make[1]: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/out/target/product/fajita/obj/KERNEL_OBJ'
make: *** [Makefile:152: sub-make] Error 2
make: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845'
[ 0% 70/94167] //external/protobuf:aprotoc clang++ src/google/protobuf/compiler/javanano/javanano_extension.cc [linux_glibc]
ninja: build stopped: subcommand failed.
12:41:48 ninja failed with: exit status 1
20th May 2019, 05:00 PM |#6  
Member
Flag Vadodara
Thanks Meter: 9
 
More
Quote:
Originally Posted by _mone

Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:

Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc
You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools

Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip
Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.

So you just do this on a clean install?
Post Reply Subscribe to Thread

Tags
android build enviroment opensuse

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes