Archive:Compile Kodi on Fedora/Red Hat/CentOS

From Official Kodi Wiki
Revision as of 17:50, 4 August 2013 by Centinel (talk | contribs) (Added information about what to do if "make" doesn't work.)
Jump to navigation Jump to search

Template:GoToParent

This is a tutorial on how to install XBMC on Fedora 8/9/10/11/12/13/14 & CentOS 5.2

(RPM Fusion does provide XBMC binaries for Fedora and CentOS 6.)

Checkout with Git

git clone git://github.com/xbmc/xbmc.git

Install Packages

Fedora 8-17

sudo rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

CentOS 5 (32)

sudo rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

CentOS 5 (64)

sudo rpm -Uvh http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

Cut & Paste Fun

sudo yum -y install SDL* glew glew-devel libmad-devel tre tre-devel libogg libogg-devel libvorbis libvorbis-devel boost \
boost-devel bzip2-devel bzip2-libs fribidi* lzo lzo-devel mysql-libs mysql-devel jasper jasper-devel faac faac-devel \
enca enca-devel hal hal-devel hal-libs cmake gperf nasm libXmu-devel fontconfig-devel freetype-devel libXinerama-devel \
pcre-devel gcc-c++ sqlite-devel curl-devel mysql-devel libcdio-devel libmms-devel faad2-devel flac-devel libsmbclient-devel \
libXtst-devel libsamplerate-devel libtiff-devel pulseaudio-libs-devel avahi-devel wavpack-devel libmpeg2-devel libtool \
libmicrohttpd-devel libmodplug-devel redhat-lsb expat-devel gettext-devel python-devel libass-devel bluez-libs-devel \
libssh-devel yajl-devel tinyxml-devel libcap-devel afpfs-ng-devel taglib-devel libplist-devel
  • Added the "libass-devel" package. This package is needed for subtitles.
  • Added the "python-devel taglib-devel libplist-devel" package. This package is essential.
  • Added the "bluez-libs-devel" package to supply libbluetooth
  • Added the "gettext-devel" package. This package is needed for autopoint.

Otherwise you get this error:

Can't exec "autopoint": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 345.
autoreconf: failed to run autopoint: No such file or directory
autoreconf: autopoint is needed because this package uses Gettext

If you are wanting to include support for VDPAU or VDAAP you must install the devel packages for these to be included in the compilation process, same goes for bluray support: Packages include

sudo yum -y install libvdpau-devel libva-devel libbluray-devel

other development packages that are useful are

sudo yum -y install libdca-devel   # for DTS support
sudo yum -y install librtmp-devel  # for rtmp streaming support
sudo yum -y install lame-devel     # for mp3 encoding support using lame

Not sure if it is required but I also install the libraries for good measure.

Build instructions for libnfs to add NFS support:

wget https://github.com/downloads/sahlberg/libnfs/libnfs-1.3.0.tar.gz
tar -xzf libnfs-1.3.0.tar.gz
cd libnfs-1.3.0
./bootstrap
./configure
make
sudo make install
su -c 'echo /usr/local/lib > /etc/ld.so.conf.d/local-libs.conf'
sudo ldconfig
cd ..

If you're running CentOS, you need to remove the version of taglib that's available in your repositories and compile the latest version. Follow the steps here.

Configure

Just to appease the configure application, you may have to show it where libmysqlclient is.

sudo ln -s /usr/lib/mysql/libmysqlclient.so.??.0.0 /usr/lib/libmysqlclient.so
cd XBMC/
./bootstrap

Are you going to use LIRC and a remote control? Starting with Fedora 12 the default LIRC socket file name has changed to /var/run/lirc/lircd (from /dev/lircd). You might need to provide the configure script with this parameter before compiling XBMC:

./configure --with-lirc-device=/var/run/lirc/lircd

If not, simply do

./configure

With the above installed packages this should go smoothly :)

Build

make


If you recieve a compile error on Fedora 16/17 or CentOS related to afp.h, please see the related bug ticket for a fix. On CentOS 6, afp.h is located at /usr/include/afpfs-ng/afp.h.

If XBMC fails to build for some other reason, don't worry! It may just be a temporary problem. Because people are adding new code to XBMC's master branch all the time, an update may have broken something. Read the information under "How do I obtain useful compiler output?" in this XBMC forum post to learn more about what to do in this situation.

Install

sudo make install

When this completes you are done!

For Fedora 10-12, SELinux will prevent loading of some .so files due to potential security problems. To allow the loading of these files (thats what you probably want), simply open a terminal and as sudo (or as root) execute the following commands:

sudo chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/avutil-50-i486-linux.so'
sudo chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/avcodec-52-i486-linux.so'
sudo chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/avformat-52-i486-linux.so'
sudo chcon -t textrel_shlib_t '/usr/local/share/xbmc/system/players/dvdplayer/swscale-0.6.1-i486-linux.so'

In Fedora 14 i found after compilation that xbmc was failing to run. The logs suggested that xbmc could not find libmicrohttpd.so.5 this was true as there had been a recent update to this library. XBMC should really link to libmicrohttpd.so rather than so.5 but until then a symlink does the trick

sudo ln -s /usr/lib64/libmicrohttpd.so /usr/lib64/libmicrohttpd.so.5

or replace lib64 with lib for 32 bit systems

Simply log into Gnome (or KDE) and open up a terminal and type 'xbmc' and it will load.





Fedora Kickstart File

Here is the kickstart file created by Cookieboy that was used to create the Fedora 12 buildslave. You can use this to do a full install with all the required packages to build XBMC from Source. This kickstart file will grab the packages from the Internet. You can modify the kickstart file to grab all the packages it can from the CDROM install and then the Net for the other packages if you would like. Cookieboy created the file with a local fedora repo rsynced down on a local network. This file has been modified to download from the public Internet.

After this kickstart file is used, in the /source folder you will find two scripts. One will download the latest CrystalHD header files to compile against, as well as a simple script to download xbmc trunk to the /source folder. Run those if you wish, and you can edit them to suit your needs. The other thing this file does, is turn on yum-updatesd and has it run every 24 hours to download any system updates so that they can be installed quickly.

To learn more about Kickstart files, visit the link here.


###########################################
### Kickstart file created by Cookieboy ###
### Created Jan 25th 2010               ###
###########################################

install
url --url http://mirrors.xmission.com/fedora/releases/12/Fedora/i386/os/
lang en_US.UTF-8
keyboard us

### Network - DHCP
network --device eth0 --bootproto dhcp

### Network - Static
#network --bootproto=static --ip=10.0.5.25 --netmask=255.255.255.0 --gateway=10.0.5.1 --nameserver=10.0.5.1 --hostname=myxbmc.mylocal.net

#rootpw rootpasshere

firewall --disabled
authconfig --enableshadow --enablemd5
selinux --disabled
timezone America/Denver
bootloader --location=mbr

#################################################
### REQUIRED REPOS FOR THE YUM PACKAGES BELOW ###
#################################################

repo --name=Fedora-Everything --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-12&arch=i386
repo --name=Fedora-Updates --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f12&arch=i386
repo --name=RPMFusion-Free --mirrorlist=http://mirrors.rpmfusion.org/free/fedora/12/i386
repo --name=RPMFusion-Free-Updates --mirrorlist=http://mirrors.rpmfusion.org/free/fedora/updates/12/i386
repo --name=RPMFusion-NonFree --mirrorlist=http://mirrors.rpmfusion.org/nonfree/fedora/12/i386
repo --name=RPMFusion-NonFree-Updates --mirrorlist=http://mirrors.rpmfusion.org/nonfree/fedora/updates/12/i386


#########################
### ADD THE XBMC USER ###
#########################

user --name=xbmcuser --password=xbmcuserpass

services --disabled=acpid,anacron,atd,bluetooth,cups,firstboot,ip6tables,iptables,mdmonitor,sendmail --enable=yum-updatesd


############################
### HARDDRIVE PARTITIONS ###
############################

#  Uncomment the lines below to auto format your HD...
#clearpart --all --drives=sda
#part /boot --fstype ext4 --size=200
#part swap --size=1024
#part / --fstype ext4 --size=100 --grow


####################
### Yum Packages ###
####################

%packages

@base
@base-x
@development-tools
@xfce-desktop
kernel-devel
kernel-headers
yum-updatesd
subversion
git
gcc-c++
boost-devel
mesa-libGL-devel
glew-devel
libmad-devel
libjpeg-devel
libsamplerate-devel
libogg-devel
libvorbis-devel
freetype-devel
fontconfig-devel
bzip2-devel
fribidi-devel
sqlite-devel
mysql-devel
libpng-devel
pcre-devel
lzo-devel
libcdio-devel
libsmbclient-devel
SDL-devel
SDL_image-devel
SDL_mixer-devel
enca-devel
jasper-devel
libmms-devel
libXt-devel
libXtst-devel
libXmu-devel
libXinerama-devel
libcurl-devel
dbus-devel
hal-devel
pulseaudio-libs-devel
pulseaudio-libs-zeroconf
faac-devel
avahi-devel
ffmpeg-devel
a52dec-devel
libdca-devel
faad2-devel
mpeg2dec-devel
libass-devel
libmpcdec-devel
flac-devel
wavpack-devel
python-devel
cmake
gperf
unzip
make
libtool
flex
bison
libtiff-devel
libvdpau
nasm
libvdpau-devel
lirc
lirc-devel
e2fsprogs-devel
libdvdread-devel
tre-devel
libdvdread
tre
# Added Feb 16 2010
libmodplug-devel
libmodplug
# Added Feb 21 2010
libmicrohttpd
libmicrohttpd-devel

%end

reboot

%post

#####################################################################
### XFCE: create /etc/sysconfig/desktop (needed for installation) ###
#####################################################################

cat > /etc/sysconfig/desktop <<EOF
PREFERRED=/usr/bin/startxfce4
EOF

########################################
### Create Nesessary Changes / Setup ###
########################################

mkdir /source

################################################################
### HERE IS WHERE WE SET UP THE AUTO-LOGIN FOR THE XBMC USER ###
################################################################

cat >> /etc/gdm/custom.conf <<EOF
[daemon]
TimedLoginEnable=true
TimedLogin=xbmcuser
TimedLoginDelay=2
EOF

###############################
### make XBMC user use Xfce ###
###############################

echo "startxfce4" > /home/xbmcuser/.Xclients
chmod a+x /home/xbmcuser/.Xclients
chown xbmcuser:xbmcuser /home/xbmcuser/.Xclients

#############################
### make XBMC dep scripts ###
#############################

#########################
OUTFILE=/source/setup-xbmc-crystalhd.sh
(
cat <<'EOF'
#!/bin/sh
# This script will SVN Export the needed libraries to compile crystalHD in XBMC

### Create folders and export CrystalHD Headers
mkdir -p /usr/local/include/libcrystalhd
svn export --force https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/lib/libcrystalhd/ /usr/local/include/libcrystalhd/
EOF
) > $OUTFILE

if [ -f "$OUTFILE" ]
then
  chmod +x $OUTFILE
  # Make the generated file executable.
else
  echo "Problem in creating file: \"$OUTFILE\""
fi

###########################
OUTFILE=/source/setup-xbmc-trunk.sh
(
cat <<'EOF'
#!/bin/sh
### Check out SVN Trunk to /source/xbmc

svn co https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/ /source/xbmc/
EOF
) > $OUTFILE

if [ -f "$OUTFILE" ]
then
  chmod +x $OUTFILE
  # Make the generated file executable.
else
  echo "Problem in creating file: \"$OUTFILE\""
fi
############################


OUTFILE=

######################################################################
### Modify yum-updated to auto download any updates every 24 hours ###
######################################################################

sed -i -e 's/run_interval \= 3600/run_interval \= 86400/' /etc/yum/yum-updatesd.conf
sed -i -e 's/emit_via \= dbus/emit_via \= syslog/' /etc/yum/yum-updatesd.conf
sed -i -e 's/do_update \= no/do_update \= no/' /etc/yum/yum-updatesd.conf
sed -i -e 's/do_download \= no/do_download \= yes/' /etc/yum/yum-updatesd.conf
sed -i -e 's/do_download_deps \= no/do_download_deps \= yes/' /etc/yum/yum-updatesd.conf


%end