Some quick definitions that will help you understand what's going on here:
- A branch is a line of development - maybe a new version, or a new feature that someone is working on. They can be merged back together later.
- A git clone fetches all items that make up a remote project and copies them locally into a new, empty directory on your machine.
- A commit is a specific point in the git history - effectively, a contribution to a branch, or a change affecting one of more chunks of the code.
- A git checkout is when you switch from one part of the code to another, such as between branches or back and forth through the commit history.
- A git fetch finds out what the current HEAD is of whatever you have checked out, and goes and gets any missing objects (files, code, images) for you.
- The HEAD is the tip of whatever branch you currently have checked out. If you've checked out a commit that isn't the HEAD, you have a detached HEAD
- A git merge weaves new objects (mostly code, but not exclusively) into your local copy of the project.
- A git pull is a bit like fetch but it immediately writes any changes into your local copy without any further debate - effectively, git fetch followed by git merge.
- A tag is a pointer to a specific commit, frequently used to label a particular release ("the code for version xyz stopped at this point).
There's an awful lot more to git than that, but that will help with these instructions.
If you've only just cloned Kodi as above, then you have the whole code base, and can build any version that's contained in it, so you can carry on. If, however, you cloned some time ago, there will inevitably be new commits that don't yet exist on your machine, and you should really bring your code up to date to make sure you've got all the latest changes. At this point, then:
- If you're happy to sit at the tip of the master branch, and haven't moved from that (more on this in a moment), then a simple
git pullwill bring you up to date. - If you've made any changes to your local code, then
git fetchwill get the latest updates for you (but won't switch you away from wherever you are in the history of the code, such as your current tag), as willgit checkout master && git pull(which will also move you back to the very latest commit as in option 1). - And, if it all gets too much, you could delete the directory and run
git cloneagain. A tad dramatic, but effective!
So, back to that comment about "the tip of the master branch". By default, you're sitting at the latest code commit (in git terms, the HEAD of the master branch), so building at this point will give you the very latest and greatest version of Kodi possible - potentially with bugs and instabilities, as it's not yet ready for release.
If you want to build a specific release of Kodi, then, you need to wind the code backwards to that specific point in time. The key to this is tags: these are pointers to specific bits of the project ("commits") that are usually used to represent the point at which version X was declared "done".
git tag -l will list all available tags.
git checkout tags/<tag> will then move you to the commit specified by that tag - so, to specifically build 20.3 (for example), you'd use git checkout tags/20.3-Nexus to jump to that point in history.
You can move back and forth between any tags that existed when you pulled the code - so, anything in that tag list you just saw. As time moves on, new tags will inevitably be created, and you'll get these as and when you update your local copy of the code.
So, you're now sitting where you want to, and are ready to build the specific version you're after.
If you get a Could NOT find... error message during CMake configuration step, take a note of the missing dependencies and either install them from repositories (if available) or build the missing dependencies manually.
.... wiki continues
I'm not sure this should be the first option :D
It should be noted though that in case of any build problems at all, the cmake build directory should definitely be nuked. Might be already in the guide though.
Is it clear to people what "update your code" would mean here? I'm having trouble interpreting that, but I might already know "too much".
a specific release, rather?
specific bits of the repository? specific snapshots of the code?