Page MenuHomePhorge

Compile Kodi for ARM
Updated 1,916 Days AgoPublic

So you don't want to use LibreELEC, and are annoyed with the Kodi team for not bothering to publish ARM binaries in their PPA, probably because they really want to make LibreELEC happen? Well here we go.

Official Instructions:

WIP:

  • {T64}

Get the dependencies

sudo apt install debhelper autoconf automake autopoint gettext autotools-dev cmake curl default-jre doxygen gawk gcc gdc gperf libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt-dev libgif-dev libgles2-mesa-dev libgl1-mesa-dev libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libiso9660-dev libjpeg-dev liblcms2-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmariadb-dev-compat libmariadb-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev  libsmbclient-dev libsqlite3-dev libssl-dev libtag1-dev libtiff5-dev libtinyxml-dev libtool libudev-dev libva-dev libvdpau-dev libvorbis-dev libxmu-dev libxrandr-dev libxslt1-dev libxt-dev lsb-release python-dev python-pil rapidjson-dev swig unzip uuid-dev yasm zip zlib1g-dev libcec-dev libfmt-dev liblirc-dev libgbm-dev libinput-dev libxkbcommon-dev libunistring-dev

Compared to the official instructions, this removes the following packages not available on contemporary Debian-based ARM distros:

  • libshairplay-dev, which is presumably for AirPlay and what kinda asshole even has an iOS device anyways?
  • flatbuffers-dev, which can theoretically be compiled within Kodi itself (see cmake flag used below)

I also add the following:

  • libxkbcommon-dev
  • libinput-dev
  • libgbm-dev since we're gonna be aiming for using GBM rather than X11
  • libunistring-dev since the compile failed with a library error with it

And I swapped:

  • libmariadb-dev-compat and libmariadb-dev for libmysqlclient-dev

Get the source

# Clone to a Kodi folder. Probably go into somewhere like ~/Code/git or something first.
git clone https://github.com/xbmc/xbmc kodi

# Check what tags are available, then switch to the latest stable
cd kodi
git tag
git checkout tags/18.4-Leia

Compilin' time

# Presuming we're inside the checkout right now, the hot new thing all the kids are doing is out-of-source builds, and Kodi is nothing if not trendy.
mkdir ../build-kodi
cd ../build-kodi

# Now run cmake with the flags for what we want to do here
cmake ../kodi -DCMAKE_INSTALL_PREFIX=/usr/local  -DENABLE_INTERNAL_FLATBUFFERS=on -DCORE_PLATFORM_NAME=gbm -DENABLE_X=OFF -DENABLE_OPENGLES=ON -DENABLE_OPENGL=OFF -DGBM_RENDER_SYSTEM=gles

# If that succeeded, then lets build! The subshell used here should spit out "4" to append to the -j argument on a Pi 3, and thus use all 4 cores. We're gonna need 'em . . .
cmake --build . -- VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)

Install and service

Annoyingly, checkinstall doesn't seem to work right. Damn CMake. So I guess just outright install it...

sudo cmake install

Then define a service file, ex.

/etc/systemd/system/kodi-gbm-local.service
[Unit]
Description=Kodi standalone (GBM) self-compiled
After=systemd-user-sessions.service network.target network-online.target sound.target upower.service mysqld.service
Requires=graphical.target
Wants=network.target network-online.target
Conflicts=getty@tty1.service

[Service]
User=kodi
Group=kodi
PAMName=login
TTYPath=/dev/tty1
Environment=WINDOWING=gbm
ExecStart=/usr/local/bin/kodi-standalone
Restart=on-abort
StandardInput=tty

[Install]
WantedBy=graphical.target

Make sure you systemctl disable any other Kodi services you have enabled.

Last Author
keithzg
Last Edited
Sep 23 2019, 8:27 PM

Event Timeline

keithzg edited the content of this document. (Show Details)
keithzg added a project: Restricted Project.
keithzg edited the content of this document. (Show Details)
keithzg edited the content of this document. (Show Details)
keithzg published a new version of this document.