Skip to content
Stefano Gottardo edited this page Sep 2, 2024 · 25 revisions

Here we provide guidelines on how to build for some common systems, in a similar way it will be possible to build on other systems or distributions.

Choose the operating system on which to build the add-on:

Build on Windows (64 bit) [click to expand]

Prerequisites

Compile

  1. Make a new folder in your disk root e.g. C:\<folder> to use as main folder
  2. Right click on the new folder, on the context menu select Git Bash Here, a terminal will be opened to this folder
  3. git clone --branch master https://github.com/xbmc/xbmc.git *1
  4. git clone --branch Nexus https://github.com/xbmc/inputstream.adaptive.git *1
  5. mkdir inputstream.adaptive/build/
  6. cd inputstream.adaptive/build/
  7. Run the following command: *2
cmake -T host=x64 -DADDONS_TO_BUILD=inputstream.adaptive -DCMAKE_BUILD_TYPE=Release -DADDON_SRC_PREFIX=../.. -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
  1. cmake --build . --config Release --target inputstream.adaptive *3
  2. At this point the add-on binary is builded inside C:\<folder>\xbmc\addons path, then:
  • You can zip the inputstream.adaptive to make it installable via Kodi add-on browser

How to resolve the expat build syntax error errors

If you find many errors in the building of expat dependency, you are most likely using VisualStudio in a language other than English, or with more languages installed.

Unfortunately, the use of several languages leads to the localisation of CMake output, this cause the failing of check_c_compiler_flag in expat/ConfigureChecks.cmake, that is the main cause of broken build.

One way to solve the problem is uninstall all language packs of Visual Studio and install/keep only the English language pack. After this you can build with success.

Build on Raspbian for Raspberry Pi (instructions may be outdated) [click to expand]

Prerequisites

  • Install tools: sudo apt install autoconf bison build-essential curl default-jdk gawk git gperf libcurl4-openssl-dev zlib1g-dev cmake zip

Compile

Open the terminal and execute these commands in sequence:

  1. Make a new folder in your home directory mkdir <folder> to use as main folder
  2. cd <folder>
  3. git clone https://github.com/raspberrypi/tools --depth=1
  4. git clone https://github.com/raspberrypi/firmware --depth=1
  5. git clone --branch master https://github.com/xbmc/xbmc.git *1
  6. git clone --branch Nexus https://github.com/xbmc/inputstream.adaptive.git *1
  7. mkdir inputstream.adaptive/build/
  8. cd inputstream.adaptive/build/
  9. Run the following command: *2
cmake -DADDONS_TO_BUILD=inputstream.adaptive -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
  1. make
  2. At this point the add-on binary is builded inside home/<folder>/xbmc/addons path, then:
  • To make an installable Kodi add-on zip: zip -r ../../inputstream.adaptive.zip inputstream.adaptive, you will find the zip in home/<folder>
  • To browse builded files: cd ../../xbmc/addons/inputstream.adaptive
Build on Linux - Ubuntu [click to expand]

Prerequisites

  • GIT
  • GCC
  • CMAKE
  • G++

To install the prerequisites run in the terminal: sudo apt install git cmake gcc g++

Compile

Open the terminal and execute these commands in sequence:

  1. Make a new folder in your home directory mkdir <folder> to use as main folder
  2. cd <folder>
  3. git clone --branch master https://github.com/xbmc/xbmc.git *1
  4. git clone --branch Nexus https://github.com/xbmc/inputstream.adaptive.git *1
  5. mkdir inputstream.adaptive/build/
  6. cd inputstream.adaptive/build/
  7. Run the following command: *2
cmake -DADDONS_TO_BUILD=inputstream.adaptive -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons
  1. make
  2. At this point the add-on binary is builded inside home/<folder>/xbmc/addons path, then:
  • To make an installable Kodi add-on zip: zip -r ../../inputstream.adaptive.zip inputstream.adaptive, you will find the zip in home/<folder>
  • To browse builded files: cd ../../xbmc/addons/inputstream.adaptive

Other linux generic build instructions

You can also find others ways to build the add-on from Kodi repository documentation:

https://github.com/xbmc/xbmc/blob/master/docs/README.Linux.md#5-build-binary-add-ons

Build for Android by using linux (e.g. ubuntu) [click to expand]

Prerequisites

  • Install required packages as explained on docs, chapter: Install the required packages
  • Install SDK as explained on docs, chapter: Prerequisites
  • Install NDK by taking in account for what kodi version you want to build. Each Kodi version use a different NDK version. This is specified on the file docs/README.Android.md of each xbmc repository branch, relative to each kodi version.

Compile

  1. Make a new folder in your home directory mkdir <folder> to use as main folder
  2. cd <folder>
  3. git clone --branch master https://github.com/xbmc/xbmc.git *1
  4. git clone --branch Piers https://github.com/xbmc/inputstream.adaptive.git *1
  5. Save the following bash (copy it in to a file e.g. build.sh) in to the main <folder>, edit it to configure relative settings, then run it ./build.sh to build ISA:
#!/bin/sh
# Before run this script, remember to install required SDK/NDK on your system based on Kodi version to be used.
# Examples:
# Kodi 22: NDK "26.2.11394342" API 24
# Kodi 21: NDK "21.4.7075529"  API 21

# -------------- Build configuration

# set the android host architecture ("aarch64-linux-android" == armv8-64 / "arm-linux-androideabi" == armv7)
HOST_ARCH="aarch64-linux-android"
# set NDK version to be used
NDK_VER="26.2.11394342"
NDK_API=24
# set the sdk path
ANDROID_SDK_ROOT="${HOME}/android-tools/android-sdk-linux"
# set the path to the xbmc (kodi) source code path
KODI_SRC_PATH="${HOME}/dev/xbmc"
# set the parent folder path that contains the InputStream Adaptive source code folder
ISA_SRC_PARENT_PATH="${HOME}/dev"
# set the build type ("Release" or "Debug")
BUILD_TYPE="Debug"

ADDON_ID="inputstream.adaptive"

# -------------- Building flow

cd $KODI_SRC_PATH/tools/depends

echo ">>>>>>>>>>>>>>>>>>>>>>>>>> SCRIPT MESSAGE - EVENT: BOOSTRAP"
./bootstrap


echo ">>>>>>>>>>>>>>>>>>>>>>>>>> SCRIPT MESSAGE - EVENT: CONFIGURING TOOLCHAIN"
CONFIGURE_EXTRA_OPTIONS="--with-ndk-api=${NDK_API} --with-sdk-path=${ANDROID_SDK_ROOT} --with-ndk-path=${ANDROID_SDK_ROOT}/ndk/${NDK_VER}"
./configure --host=${HOST_ARCH} --prefix=$KODI_SRC_PATH/xbmc-depends $CONFIGURE_EXTRA_OPTIONS


echo ">>>>>>>>>>>>>>>>>>>>>>>>>> SCRIPT MESSAGE - EVENT: BUILDING ADD-ON"
cd $KODI_SRC_PATH
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS=$ADDON_ID ADDON_SRC_PREFIX=${HOME}/dev INSTALL_PREFIX=${KODI_SRC_PATH}/addons EXTRA_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=${BUILD_TYPE}"

# The builded files are on: $KODI_SRC_PATH/addons/$ADDON_ID

Note

  • *1: You can change the branch name according to the Kodi version to use.
  • *2: If you have to debug the component CMAKE_BUILD_TYPE value must be set to Debug (Kodi should also be built as Debug).
  • *3: If you have to debug the component --config value must be set to Debug (Kodi should also be built as Debug).
Clone this wiki locally