Wintermute0110 / kodi-install

Scripts to compile and install Kodi in Linx Debian/Ubuntu
15 stars 10 forks source link

Compile and install Kodi on Debian/Ubuntu distributions

Table of Contents

WARNING

Currently there is a problem when building the binary addons for Kodi Matrix with the scripts build-binary-addons-*.sh. I am investigating the issue and will publish a fix when ready.

Readme me first

The Kodi source directory, the Kodi build directory, the Kodi Install directory and the Kodi build tag, AKA the version you want to compile, can be configured in the file configuration.sh.

# Kodi install configuration file. No trailing / in these variables.

# Kodi source directory.
KODI_SOURCE_DIR=/home/kodi/kodi-source
KODI_SOURCE_TAG=18.9-Leia
KODI_BUILD_DIR=/home/kodi/kodi-build
KODI_INSTALL_DIR=/home/kodi/kodi-bin

For the time being do not use spaces in the directory names and do not include a tralining / in the directory names. The above example is for a Linux user name kodi whose home directory is /home/kodi. Following with the example:

Once compiled and installed, you can execute Kodi in several ways:

$ /home/kodi/kodi-bin/bin/kodi
$ /home/kodi/kodi-bin/bin/kodi-standalone
$ /home/kodi/kodi-bin/lib/kodi/kodi-x11

The actual Kodi executable is /home/kodi/kodi-bin/lib/kodi/kodi-x11. The first two files are shell scripts that call the actual Kodi executable kodi-x11.

Cloning this repository

If you don't have git installed then execute as root user:

# apt-get install git

To clone this repository:

$ cd /home/kodi/
$ git clone https://github.com/Wintermute0110/Kodi-Install.git

The Kodi compilation tools will be cloned into the directory /home/kodi/Kodi-Install/.

Clone and prepare Kodi source code

As the kodi user clone the Kodi source code. This will take a while:

$ cd /home/kodi/
$ git clone https://github.com/xbmc/xbmc.git kodi-source

If you want to compile a particular version of Kodi first have a look at the tags in the repository:

$ cd /home/kodi/kodi-source/
$ git tag
...
16.0-Jarvis
17.0-Krypton
17.6-Krypton
18.0-Leia
18.9-Leia
19.0-Matrix
19.1-Matrix
...
$ 

Each tag corresponds to a released version of Kodi. Now, tell git to set the Kodi source code to the version you want:

$ cd /home/kodi/kodi-source/
$ git checkout 19.1-Matrix

The Kodi source code is now ready for compilation.

Compile and installing Kodi for the first time

First you need to install the build dependencies required to compile Kodi. As root execute:

# cd /home/kodi/Kodi-Install/
# ./install-build-dependencies-debian.sh

As the kodi user, the Kodi build directory needs to be configured before compilation:

$ cd /home/kodi/Kodi-Install/
$ ./configure-kodi.sh

Now it's time to compile Kodi. This will take a while (about 15 minutes on a fast computer):

$ ./build-kodi-x11.sh

Finally, to install Kodi, the Kodi binary addons and the required runtime files like the default skin execute:

$ ./install-kodi.sh

The first time you execute Kodi the userdata directory /home/.kodi/ will be created.

Now that Kodi is installed you can safely delete the Kodi build directory to save disk space:

$ ./purge-build-directory.sh

Do not purge the build directory before compiling the binary addons.

Compiling the Kodi binary addons

To compile all the binary addons:

$ cd /home/kodi/Kodi-Install/
$ ./build-binary-addons-all.sh

or instead execute this if you are not going to use Kodi personal video recorder (PVR) features. This command compiles all binary addons except the PVR addons:

$ cd /home/kodi/Kodi-Install/
$ ./build-binary-addons-no-pvr.sh

the binary addons are automatically installed in /home/kodi/bin-kodi/ after compilation.

To compile the Libretro cores (Kodi addons that let you play games) first edit the file /home/kodi/KodiInstall/build-binary-addons-libretro-cores.sh and comment/uncomment the Libretro cores you want to build. Note that building all the cores takes about 5/6 hours on a fast machine. Each MAME core takes 1 hour! Build only the cores you plan to use.

# --- Build the addons ---
# --- Uncomment the cores you want to build. Cores are shorted alphabetically.
# --- For a list of all cores see http://mirrors.kodi.tv/addons/leia/
# --- and look for the game.libretro.* addons.
# compile_core game.libretro.2048
# compile_core game.libretro.4do
compile_core game.libretro.beetle-bsnes
# compile_core game.libretro.beetle-gba
...

Finally, compile the Libretro cores:

$ cd /home/kodi/Kodi-Install/
$ ./build-binary-addons-libretro-cores.sh

the Libretro cores addons are automatically installed in /home/kodi/bin-kodi/ after compilation.

Update Kodi

Update Kodi source code:

$ cd /home/kodi/kodi-source/
$ git checkout master
$ git pull

If you wish to set a specific version:

$ git checkout 18.1-Leia

Then configure, compile and install Kodi again:

$ cd /home/kodi/Kodi-Install/
$ ./configure-kodi.sh
$ ./build-kodi-x11.sh
$ ./install-kodi.sh
$ ./build-binary-addons-no-pvr.sh
$ ./build-binary-addons-libretro-cores.sh

Notes

Current bugs

22:46:37.511 T:140428854687488   ERROR: AddOnLog: Joystick Support: ScanEvents: failed to read joystick "Xbox 360 Wireless Receiver" on /dev/input/js0 - 19 (No such device)
22:46:38.921 T:140429205022464   ERROR: Previous line repeats 86 times.
22:46:38.921 T:140429205022464  NOTICE: UnregisterRemovedDevices - device removed from joystick/peripheral.joystick/0: Xbox 360 Wireless Receiver (0000:0000)
22:48:47.805 T:140429205022464  NOTICE: Register - new joystick device registered on addon->peripheral.joystick/1: Xbox 360 Wireless Receiver