This is a complete hack to fetch(clone), update(pull), compile and install Kodi from source on Linux.
I wrote this script to automate the compilation of Kodi on my Linux system. It checks if you have the source, if you don't it will ask if you want to download it. Then it asks if you want to compile and install the binary-addons.
Kodi 18 Leia uses cmake and checks for installled libraries automatically without the need to specify them during configuration. Compared to configuring Kodi Krypton v17, it's a lot easier and feels more bullet proof.
Also, the introduction to using ccache speeds up build times after the first compilation. I've introduced an option that will disable ccache if you want to compile Kodi with a sort of clean slate (for a lack of better words...).
It uses the Z Shell (ZSH) as I find it more than capable for my needs.
The script also uses sudo to install Kodi and the binary-addons. Please make sure you are in the sudoers list.
Default installation dir is /opt/leia. This can be changed by editing the PREFIX variable in etc/build.leia.conf.
See build.leia --help for your options.
- Standard requirements for building Kodi on Linux
- ZSH
- git
- You must be in the sudoers file
- Unless you want to install Kodi to your home directory. Then you'll have to edit the PREFIX setting and remove the sudo commands from the script.
- Ninja
- It is now possible to use ninja to build Kodi 18 Leia with build.leia
If you want to be on the cutting-edge, you can download the master branch. There may be a lot of bugs until the next version is released.
git clone https://github.com/kekePower/build.leia
The script will first check to see if you have the Kodi Leia source in the directory specified in etc/build.leia.conf. If it's not there, it will ask you if you want it to clone the source from Github.
It will then ask you if you also want to compile the binary-addons later.
I've created a patch that lets you define your own, personalized string in the System information screen.
The build.leia.conf now includes "MY_GIT_VERSION" that gives you the option to make this screen look like
Kodi 18.0-ALPHA1 by kekePower
Or, if you edit build.leia.conf, your own string.
There is a new option to use Ninja to build Kodi for you. The script will check if you have Ninja installed and if not, will fall back to using cmake. See this PR.
You have to check the differences in your current build.leia.conf towards the new one. There is a new entry called USE_NINJA=true or false. Set this to your preference.
I've also added the possibility to optimise the build of Kodi for your CPU. See this table and use MY_CPU_ARCH=<YourCPU>. The default is native, which normally is good enough.
build.leia - The default is the same as build.leia --with=clean,addons
build.leia --help will show you a few examples of use
build.leia --with= - This is where the magic happens.
Your options are:
--with=clean - This will remove the build-kodi directory and recreate it.
--with=dirty - This will simply pull the updated source and compile as is.
--with=addons - This will clean and compile the binary-addons.
--with=no-git - This will skip pulling for updates from Github and just carry on with the compilation. This can be used if one compilation has failed after an update and you want to run it again.
--with=force - This will compile Kodi even if there are no new updates from Github.
--with=no-ccache - Disable ccache when configuring Kodi
--with=only-addons - Will clean and compile and install the binary-addons only
--with=nn - Will disable the two questions about clearing ccache and deleting PREFIX. This also defaults to include --with=clean,addons. You can now use the combination --with=clean,nn which will skip the previous assumption. It became a neccesity for me and hopefully you'll like it too.
You can use any of these options together, except from clean and dirty.
build.leia --with=clean,addons,force will remove the kodi-build directory, recreate it, check to see if there are updates from Github and even if there are no new updates, it will continue with the compilation and lastly it will do a distclean for the binary-addons and re-compile them.
Sometimes the configuration or compilation failes. If this happens, you can try the following suggestions.
Please cd into your Leia source code: cd ${HOME}/kodi/Leia/kodi-build and run the following command: cmake ..
You will see the complete output of the command and possibly find you're missing some libraries and/or tools necessary to compile Kodi. Install the missing libraries and/or tools and try again. Once you've sorted all this out, you're ready to run the script.
If you experience compilation issues, a good idea is to delete the source tree and let the script download a fresh copy.
I only know two languages, Norwegian and English, but I've decided to add Spanish and Romanian because my woman speaks both languages and was able to help me.
If you want to help out with translation, please fork the project and copy the language files from include/build.leia/language/.
The en_US.inc is the most up-to-date file.
So far, these are the supported languages:
- Norsk Bokmål (no_NB)
- American English (en_US)
- Español Castellano (es_ES)
- Română (ro_RO)
The road ahead is made as I think of things to add/fix/modify/enhance/hack/break/fix again and so on!
I've written two extension that are not included in the tar-ball.
You can download them at my gist page