Day 3: Github basics part 2 and preparing for compiling
Welcome to Day 3: Github basics part 2 and preparing for compiling! Lets beginn our "session" with a short test. Remember which command you have to use for cloing a repository (downloading the files to your computer)? Well we need this one here.
1. Again Github basics
Imagine the following situation; You want to help another person to fix a bug. You should create your own repository first to dont mix files up. In short we copy all files from a repository to our own new one. We have a point to start then and will use his code, but his code wont change when we change ours.
Go to www.github.com/
I create a short repository for you all, nothing special but you can practise with it.
Open the following page (its the repositiory shown in your webbrowser: https://github.com/fuss132/lerninggi...cal_repository
. Click on fork at the right:
If github is asking you to which user it should fork the files click the only availabe button ^^
You have now your own repository with the same files. We will download the files now. Open your terminal and navigate to the folder (it should be an empty one). So you have to do the following:
git clone email@example.com:<b>yourusernamehere</...repository.git
Now we "fix the bug" and do some changes to your local files.
sudo gedit memberlist
// add your name to the list, save and exit //
So we made the changes, now we will upload them, you should know the commands already. If you have any questions please post in this thread
git add -A
git commit -m "add my name to the list"
Brilliant, if you know visit https://github.com/yournamehere
/lerninggit_practical_repository you will see that your changes have been uploaded. So you fixed my problem, you should now share the solution with me.
Open your repository in a webbrowser https://github.com/yournamehere
/lerninggit_practical_repository and click on Pull Requests on the right side. Now select on the right side as head repo mine fuss132 one and as base repo in the left the default, your one. Describe what you did in the filed below and finally click on "Send pull request.
Thats it you now shared it with me and I will include your changes to my repo
2. Back to the roots: Prepare for compiling
Now cd to the folders you downloaded all the sources in. You should see folders like bionic, fendor, main... I will call this main source directory now
If you would compile the sources now you would stuck after some seconds
Android needs a special java version for building. And this one cant be downloaded anymore. Well, bad situation... We will give up here we will never compile android :'(
Ok, **** you java we will rule you
There is an error only because the build system does not recognize the java version when it is an openSDK
$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu2)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
To work around it, you can just comment out the following lines in build/core/main.mk:
ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
there should be
# ifneq ($(shell java -version 2>&1 | grep -i openjdk),)
# java_version :=
Java is now no longer checking its version and everything is working. Stupid solution, but working
The second part is that the linker would complain that it cannot find -lGL .
The workaround for it would be:
just execute this line:
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so
The last thing what we need is again the buildscript file, just do the following (you dont have to remember this):
Thats it for today, thanks for reading! Please press thanks if you like it and maybe click on "newsworthy thread". Questions, as usuall in this thread please