Archive:HOW-TO compile Kodi for Linux on Arch/Manjaro: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(Created page with "This guide will show you how to compile Kodi on Arch or Manjaro linux. == Getting the source code == First, we are going to install git, which is needed to download the Kodi...")
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This guide will show you how to compile Kodi on Arch or Manjaro linux.
The recommended method to build/install Kodi on Arch Linux or Manjaro (and other Arch clones), is to build from a PKGBUILD rather than building/installing by hand.  The primary reason to build this way is that it allows all files to be managed by pacman which is adventitious for numerous reasons.


* To build the official Kodi package, use a utility such as [https://wiki.archlinux.org/index.php/Arch_Build_System#Retrieve_PKGBUILD_source_using_Git asp] which will pull the needed files.
* To build a dev version of Kodi, download a PKGBUILD the [https://wiki.archlinux.org/index.php/Arch_User_Repository AUR] which hosts  [https://aur.archlinux.org/packages/kodi-devel/ kodi-devel].
The remainder of this article shows steps to manually build and install.


== Getting the source code ==
== Getting the source code ==
Line 21: Line 25:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo pacman -S autoconf automake cmake curl jre8-openjdk gawk gperf libao alsa-lib libass avahi bluez-libs libbluray bzip2 libcap libcdio libcec curl dbus fontconfig freetype2 fribidi giflib mesa glu libjpeg-turbo libltdl lzo libmicrohttpd libmpcdec libnfs pcre libplist libpng libpulse shairplay smbclient sqlite libssh openssl ffmpeg taglib tinyxml libtool libsystemd libusb libva libvdpau libxml2 libxmu libxrandr libxslt libxt lsb-release rapidjson nasm python2 python2-pillow swig yasm zlib libmariadbclient libcrossguid
sudo pacman --needed --asdeps -S alsa-lib autoconf automake avahi bluez-libs bzip2 cmake curl dbus ffmpeg \
</syntaxhighlight>
flatbuffers fmt fontconfig freetype2 fribidi gawk giflib glu gperf jre8-openjdk libao libass libbluray \
 
libcap libcdio libcec libcrossguid libjpeg-turbo libltdl libmariadbclient libmicrohttpd libmpcdec libnfs libplist \
In addition to those, Kodi needs two packages that are currently unavailable in the official repo, but they can be installed from the AUR (Arch User Repo).
libpng libpulse libssh libsystemd libtool libusb libva libvdpau libxml2 libxmu libxrandr libxslt libxt lsb-release \
 
lzo mesa nasm openssl pcre python2 python2-pillow rapidjson shairplay smbclient sqlite swig taglib tinyxml yasm zlib
We need the yaourt package in order to install packages from the AUR, so let's install it first
 
<syntaxhighlight lang="bash">
sudo pacman -S yaourt
</syntaxhighlight>
</syntaxhighlight>


Once yaourt is installed, we can now get the last two packages Kodi needs
In addition to those, Kodi needs a few packages that are currently unavailable in the official repo, but they can be installed from the AUR (Arch User Repo)[https://aur.archlinux.org/].
 
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo yaourt -S cwiid fmt
cwiid fstrcmp
</syntaxhighlight>
</syntaxhighlight>


Those can either be installed manually[https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages] or by using a AUR Helpers[https://wiki.archlinux.org/index.php/AUR_helpers].


''Optional:'' For developers and anyone else who compiles frequently it is recommended to use ccache
''Optional:'' For developers and anyone else who compiles frequently it is recommended to use ccache
Line 43: Line 43:
sudo pacman -S ccache
sudo pacman -S ccache
</syntaxhighlight>
</syntaxhighlight>


== How to compile ==
== How to compile ==

Revision as of 20:18, 16 February 2020

The recommended method to build/install Kodi on Arch Linux or Manjaro (and other Arch clones), is to build from a PKGBUILD rather than building/installing by hand. The primary reason to build this way is that it allows all files to be managed by pacman which is adventitious for numerous reasons.

  • To build the official Kodi package, use a utility such as asp which will pull the needed files.
  • To build a dev version of Kodi, download a PKGBUILD the AUR which hosts kodi-devel.

The remainder of this article shows steps to manually build and install.

Getting the source code

First, we are going to install git, which is needed to download the Kodi source-code. Enter the following into the command line.

sudo pacman -S git

Once git is installed, we can now get the Kodi source-code

cd $HOME
git clone git://github.com/xbmc/xbmc.git kodi


Installing the required packages

Kodi needs several third party packages, most of them can be installed from the official Arch/Manjaro repository

sudo pacman --needed --asdeps -S alsa-lib autoconf automake avahi bluez-libs bzip2 cmake curl dbus ffmpeg \
flatbuffers fmt fontconfig freetype2 fribidi gawk giflib glu gperf jre8-openjdk libao libass libbluray \
libcap libcdio libcec libcrossguid libjpeg-turbo libltdl libmariadbclient libmicrohttpd libmpcdec libnfs libplist \
libpng libpulse libssh libsystemd libtool libusb libva libvdpau libxml2 libxmu libxrandr libxslt libxt lsb-release \
lzo mesa nasm openssl pcre python2 python2-pillow rapidjson shairplay smbclient sqlite swig taglib tinyxml yasm zlib

In addition to those, Kodi needs a few packages that are currently unavailable in the official repo, but they can be installed from the AUR (Arch User Repo)[1].

cwiid fstrcmp

Those can either be installed manually[2] or by using a AUR Helpers[3].

Optional: For developers and anyone else who compiles frequently it is recommended to use ccache

sudo pacman -S ccache

How to compile

To create the Kodi executable manually perform these steps:

Notes
  • By adding -j<number> to the 'cmake --build' command, you describe how many concurrent jobs will be used. So for dualcore the command is: make -j2
  • You may need to run the 'make install' command with sudo if your user doesn't have write permissions to the prefix you have provided.
cd $HOME/kodi/
mkdir kodi-build
cd kodi-build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build . -- VERBOSE=1 -j4
sudo make install

This will install Kodi in the prefix provided (/usr/local).


How to run

How to run xbmc depends on the type of installation you have done. If you chose to install Kodi using the '/usr' or '/usr/local' prefix, you can just issue 'kodi' in a teminal session.

kodi

You can also simply run from the application menu ofcourse.


In case you've overridden the prefix to install Kodi into some non-standard location, you will have to run kodi from a terminal, specifying the full path

/opt/kodi/bin/kodi


Uninstalling

If you ever need to uninstall Kodi, you can use the following command

cd $HOME/kodi/kodi-build
sudo make uninstall


See also