Building TVHeadend from source

This is a brief guide demonstrating downloading and building (and optionally packaging) the TVHeadend source from GitHub.

The instructions are aimed at people running Debian and variants (i.e. Ubuntu) Linux distributions.

Instructions for other distributions may be found in the TVHeadend wiki at https://tvheadend.org/projects/tvheadend/wiki/Building.

The instructions are also specifically tailored to produce a build of TVHeadend that is identical to the one made available via the TVHeadend repositories so contains more dependencies than the official guide mentions.

Further more, this builds the very latest (read: unstable) code from GitHub. If you want to build the latest stable version then use the correct git command as detailed below.

Installing dependencies

To download the TVHeadend source code and build a working installtion, the following packages are required;

sudo apt-get install git build-essential pkg-config libssl-dev bzip2 wget libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavresample-dev python gettext cmake libdvbcsa-dev liburiparser-dev

or

sudo aptitude install git build-essential pkg-config libssl-dev bzip2 wget libavahi-client-dev zlib1g-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavresample-dev python gettext cmake libdvbcsa-dev liburiparser-dev

Downloading the source code

To download the latest stable (4.0) source code then running

git clone -b release/4.0 https://github.com/tvheadend/tvheadend.git

If you want to get the very latest (4.1) source code (which is considered unstable) then running

git clone https://github.com/tvheadend/tvheadend.git

Configuring the build tool

The command below configures the build tool to create a TVHeadend installation that is identical to that available via official sources. If you want to change where TVHeadend is installed then you need to amend the configuration line below before building TVHeadend.

From the TVHeadend source directory, run;

./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libexecdir=${prefix}/lib/tvheadend --disable-maintainer-mode --disable-dependency-tracking --enable-libffmpeg_static --enable-hdhomerun_static --enable-dvbcsa --enable-bundle --arch=x86_64

Building the source code

make -j 4

Installing the binaries

Once the source has built successfully, you can install the package by using the following command. If you have previously installed TVHeadend from the repositories then this will overwrite the currently installed version (don’t worry, if a new version is made available via the repositories you can always install the newwer package over the top)

sudo make install

If you want to create a redistributable .deb package see the ‘Packaging TVHeadend for distribution‘ guide.

Posted in TVHeadend Tagged with: ,