Kodi on Raspberry Pi 2 with Centos 7

This topic is a quite challenging and I have not manged to compile Kodi successfully yet. I end up with error messages regarding a player. So this topic definetely needs further investigation. At least by following the instructions, you should be able to get to the compilation phase. Let me know if you managed to compile.

sed -i ~s/%dist .el7.centos/%dist .el7/g /etc/rpm/macros.dist # This changes the distribution name for source compiled packes and removes a massive headache

cd ~/git
git clone git://github.com/xbmc/xbmc.git kodi

yum install wget libevent-devel libglib2 git make gcc glib2-devel gcc-c++ which yum-utils rpm-build https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # I can't remmeber if I had to adapt the EPEL link in /etc/yum.repo.d to use the x86_64 architecture files. Do this if you get package not found errors later on

# not sure if you need the following. I claim not, so don't add it just yet. I keep it for reference. All packages are not signed in this repository!
echo > /etc/yum.repos.d/unofficial-epel.repo << EOF
name=CentOS unofficial extra package rebuild

yum install mariadb mariadb-devel mariadb-libs mesa-libGL-devel mesa-libGLU-devel \
lzo-devel python-devel avahi-devel bluez-libs-devel \
bus-devel mesa-libEGL-devel fontconfig-devel fribidi-devel \
 zlib-devel yajl-devel pcre-devel sqlite-devel SDL2-devel tinyxml-devel  freetype-devel \
libcec-devel libmodplug-devel yasm libplist-devel libssh-devel libva-devel \
autoconf automake cmake curl gawk gperf libao-devel libbluray-devel  libcap-devel libcdio-devel \
libjpeg-devel libmicrohttpd-devel libpulse-devel \
libmpcdec-devel libpng-devel libsmbclient-devel libtool gnutls-devel \
  libusb-devel libvdpau-devel libXinerama-devel libxml2-devel libxslt-devel \
  libXmu-devel libXrandr-devel libXt-devel nasm python-devel python-imaging  swig unzip uuid-devel libuuid-devel zip \
java gettext-devel mesa-libGLES-devel freetype libplist libxslt taglib taglib-devel curl harfbuzz bzip2-devel


#-------- Compile missing packages ----------------

cd /tmp
#-- libass
yum install http://mirror.centos.org/centos/7/os/x86_64/Packages/gtk-doc-1.19-3.el7.noarch.rpm


rpmbuild --rebuild harfbuzz-0.9.36-1.el7.src.rpm
yum install /root/rpmbuild/RPMS/armv7hl/harfbuzz-devel-*  /root/rpmbuild/RPMS/armv7hl/harfbuzz-icu-*

rpmbuild --rebuild https://dl.fedoraproject.org/pub/epel/7/SRPMS/e/enca-1.18-1.el7.src.rpm
yum install yum install /root/rpmbuild/RPMS/armv7hl/enca-1.18-1.el7.centos.armv7hl.rpm

rpmbuild --rebuild https://dl.fedoraproject.org/pub/epel/7/SRPMS/l/libass-0.13.1-1.el7.src.rpm
yum install /root/rpmbuild/RPMS/armv7hl/libass-devel-* /root/rpmbuild/RPMS/armv7hl/libass-0.13.1*

#-- libcurl
yumdownloader --source curl
yum install -y groff libidn-devel libssh2-devel nss-devel openldap-devel stunnel
rpmbuild --rebuild curl*
yum install -y /root/rpmbuild/RPMS/armv7hl/libcurl-*

#-- tinyxml
rpmbuild --rebuild https://dl.fedoraproject.org/pub/epel/7/SRPMS/t/tinyxml-2.6.2-3.el7.src.rpm
yum install -y /root/rpmbuild/RPMS/armv7hl/tinyxml-2.6.2*

yum -y install libgcrypt-devel
yumdownloader --source libxslt
rpmbuild --rebuild libxslt-*
yum install -y /home/pi/rpmbuild/RPMS/armv7hl/libxslt-devel-*

#-- taglib
rpmbuild --rebuild


yum install -y /home/pi/rpmbuild/RPMS/armv7hl/taglib-1.11* /home/pi/rpmbuild/RPMS/armv7hl/taglib-


yum install -y doxygen
yumdownloader --source libssh
rpmbuild --rebuild libssh-*
yum install /home/pi/rpmbuild/RPMS/armv7hl/libssh-0.7* /home/pi/rpmbuild/RPMS/armv7hl/libssh-devel-*

#-- libnfs
cd ~/git
git clone https://github.com/sahlberg/libnfs.git
cd libnfs
make -j2
make install
echo /usr/local/lib > /etc/ld.so.conf.d/local-libs.conf
cd /tmp

#### more yum files here??

cd ~/git/kodi
make -j2 -C tools/depends/target/crossguid PREFIX=/usr/local

# Build JsonSchemaBuilder
make -j2 -C tools/depends/native/JsonSchemaBuilder/
cp tools/depends/native/JsonSchemaBuilder/bin/JsonSchemaBuilder /usr/local/bin
chmod 775 /usr/local/bin/JsonSchemaBuilder


# Next, play with the configure flags. These are some options to play with

./configure --disable-debug \
--disable-vaapi \
--disable-vdpau \
--disable-optical-drive \
--enable-alsa \
--disable-x11 \
    --disable-gl \
    --disable-airplay \
    --disable-libbluray \

--enable-player=omxplayer \
--disable-openmax \
--enable-libcec \
--with-platform=raspberry-pi \
--disable-xrandr \

    --disable-pulse \
    --disable-alsa \
    --enable-gles \
    --disable-sdl \
    --enable-ccache \
    --enable-optimization \
    --enable-external-libraries \
    --disable-hal \
    --disable-pulse \
    --disable-airplay \
    --disable-alsa \
    --disable-libbluray \
    --enable-avahi \

    --disable-hal \
    --disable-profiling \
    --enable-mid \
    --disable-nfs \
    --disable-projectm \
    --enable-rsxs \
    --enable-rtmp \
    --disable-vdadecoder \
    --disable-external-ffmpeg \
make -j2

# only continue if make runs without issues
make install

sed -i ~s/ENABLED=0/ENABLED=1/g /etc/default/kodi
sed -i ~s/USER=kodi/USER=pi/g /etc/default/kodi

systemctl enable kodi.service