aboutsummaryrefslogtreecommitdiff
path: root/docs/README.linux
blob: a9f1f271e5bff7f0a381e94e1308c8fa633f9c4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
TOC
1. Introduction
2. Getting the source code
3. Installing the required libraries and headers
4. How to compile
5. How to run
6. Uninstalling

-----------------------------------------------------------------------------
1. Introduction
-----------------------------------------------------------------------------

A graphics-adapter with OpenGL acceleration is highly recommended.
24/32 bitdepth is required along with OpenGL.

Note to new Linux users.
All lines that are prefixed with the '$' character are commands,
that need to be typed into a terminal window / console. The '$' equals the prompt.
Note: The '$' character itself should NOT be typed as part of the command.

-----------------------------------------------------------------------------
2. Getting the source code
-----------------------------------------------------------------------------

You will have to grab the source code of course, here we use git as example.
First install the git package provided by your distribution.
Then from a terminal, type:

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

Note: You can clone any specific branch.

.1  $ git clone -b <branch> git://github.com/xbmc/xbmc.git kodi

-----------------------------------------------------------------------------
3. Installing the required libraries and headers
-----------------------------------------------------------------------------

You will then need the required libraries. The following is the list of packages
that are used to build Kodi packages on Debian/Ubuntu (with all supported
external libraries enabled).

Build-Depends: autoconf, automake, autopoint, autotools-dev, cmake, curl,
  debhelper (>= 7.0.50~), default-jre, gawk, gperf, libao-dev, libasound2-dev,
  libass-dev (>= 0.9.8), libavahi-client-dev, libavahi-common-dev, libavcodec-dev,
  libavfilter-dev, libavformat-dev, libavutil-dev, libbluetooth-dev, libbluray-dev,
  libboost-dev, libboost-thread-dev, libbz2-dev, libcap-dev, libcdio-dev, libcec-dev,
  libcurl4-gnutls-dev | libcurl4-openssl-dev | libcurl-dev, libcwiid-dev, libdbus-1-dev, 
  libenca-dev, libfontconfig-dev, libfreetype6-dev, libfribidi-dev, libgif-dev (>= 4.1.6), 
  libgl1-mesa-dev | libgl-dev, libglew-dev, libglu1-mesa-dev | libglu-dev, libiso9660-dev,
  libjasper-dev, libjpeg-dev, libltdl-dev, liblzo2-dev, libmad0-dev, libmicrohttpd-dev,
  libmodplug-dev, libmpcdec-dev, libmpeg2-4-dev, libmysqlclient-dev, libnfs-dev, libogg-dev,
  libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpostproc-dev, libpulse-dev,
  librtmp-dev, libsdl2-dev, libshairplay-dev, libsmbclient-dev, libsqlite3-dev, libssh-dev,
  libssl-dev, libswscale-dev, libtag1-dev (>= 1.8), libtiff-dev, libtinyxml-dev (>= 2.6.2), libtool,
  libudev-dev, libusb-dev, libva-dev, libvdpau-dev, libvorbis-dev, libxinerama-dev,
  libxml2-dev, libxmu-dev, libxrandr-dev, libxslt1-dev, libxt-dev, libyajl-dev (>=2.0),
  lsb-release, nasm [!amd64], python-dev, python-imaging, python-support, swig, unzip,
  yasm, zip, zlib1g-dev
  
Note: For developers and anyone else who compiles frequently it is recommended to use ccache.

   $ sudo apt-get install ccache

-----------------------------------------------------------------------------
3.1. Using the Kodi PPA to get all build dependencies (Debian/Ubuntu only)
-----------------------------------------------------------------------------

For this, you need to specify the PPA in your apt sources.
Please find them on the following wiki link:
Note: See README.ubuntu as well

http://kodi.wiki/index.php?title=Official_Ubuntu_PPA

Update apt:
   $ sudo apt-get update

The command to get the build dependencies, used to compile the version on the PPA.

   $ sudo apt-get build-dep kodi

-----------------------------------------------------------------------------
4. How to compile
-----------------------------------------------------------------------------

To create the Kodi executable manually perform these steps:

.0  $ ./bootstrap

.1  $ ./configure <option1> <option2> ... (See --help for available options)
       A full listing of supported options can be viewed by typing './configure --help'.

.2  $ make

Tip: By adding -j<number> to the make command, you describe how many
     concurrent jobs will be used. So for dualcore the command is:

    $ make -j2

Note: From v14 with commit 4090a5f a new API for binary audio encoder addons is available, if you need to compile them do:
    
    $ make -C tools/depends/target/xbmc-audioencoder-addons PREFIX=/<system prefix you added on step 4.1

.3  $ make install

This will install Kodi in the prefix provided in 4.1 as well as a launcher script.

Note: You may need to run this with sudo (sudo make install) if your user doesn't have write permissions
to the prefix you have provided (as in the default case, /usr/local).

Tip: To override the location that Kodi is installed, use PREFIX=<path>.
For example.

    $ make install DESTDIR=$HOME/kodi

-----------------------------------------------------------------------------
4.1. Test Suite
-----------------------------------------------------------------------------

Kodi has a test suite which uses the Google C++ Testing Framework.
This framework is provided directly in Kodi's source tree.
It has very little requirements, in order to build and run.
See the README file for the framework at 'lib/gtest/README' for specific requirements.

To compile and run Kodi's test suite:
The configure option '--enable-gtest' is enabled by default during the configure stage.
Once configured, to build the testsuite, type the following:

    $ make check

To compile the test suite without running it, type the following.

    $ make testsuite

The test suite program can be run manually as well.
The name of the test suite program is 'xbmc-test' and will build in the Kodi source tree.
To bring up the 'help' notes for the program, type the following:

    $ ./xbmc-test --gtest_help

The most useful options are,

    --gtest_list_tests
      List the names of all tests instead of running them.
	  The name of TEST(Foo, Bar) is "Foo.Bar".
      
    --gtest_filter=POSTIVE_PATTERNS[-NEGATIVE_PATTERNS]
      Run only the tests whose name matches one of the positive patterns but
      none of the negative patterns. '?' matches any single character; '*'
      matches any substring; ':' separates two patterns.

Note: If the '--enable-gtest' option is not set during the configure stage,
the make targets 'check,' 'testsuite,' and 'testframework' will simply show a message saying
the framework has not been configured, and then silently succeed (i.e. it will not return an error).

-----------------------------------------------------------------------------
5. How to run
-----------------------------------------------------------------------------

How to run Kodi depends on the type of installation you have done.
It is possible to run Kodi without the requirement to install Kodi anywhere else.
In this case, type the following from the top source directory.

    $ ./kodi.bin

Or run in 'portable' mode

    $ ./kodi.bin -p

If you chose to install Kodi using '/usr' or '/usr/local' as the PREFIX,
you can just issue 'kodi' in a terminal session.

If you have overridden PREFIX to install Kodi into some non-standard location,
you will have to run Kodi by directly running 'kodi.bin'.

For example:

    $ $HOME/kodi/usr/lib/kodi/kodi.bin

You should still run the wrapper via
    $ $PREFIX/bin/kodi

If you wish to use VDPAU decoding you will now have to change the Render Method
in Settings->Videos->Player from "Auto Detect" to "VDPAU".

-----------------------------------------------------------------------------
6. Uninstalling
-----------------------------------------------------------------------------

Issue the commands prepending "sudo", if your user doesn't have write permission,
to the install directory.

Note: If you have rerun configure with a different prefix,
you will either need to rerun configure with the correct prefix for this step to work correctly.

    $ make uninstall
.0  $ sudo make uninstall

If you would like to also remove any settings and 3rd party addons (skins, scripts, etc)
you should also run:

.1  $ rm -rf ~/.kodi

EOF