libCEC Build from Source

  • Operation confirmed with our Ubuntu Mate/Minimal 18.04.1 on 4.14.87-153 kernel with the latest packages.

This guide provides how to build libCEC on your own to enable CEC feature with Ubuntu 18.04.

Preparation

We strongly recommend to update your system before proceeding.

$ sudo apt update && sudo apt full-upgrade

Install the necessary packages.

$ sudo apt install git cmake build-essential libudev-dev python-dev swig

Build / Install the sources

libCEC that we're going to use is an open source project by Pulse-Eight.

Clone platform for libCEC uses from the Github repository then build/install that.

$ git clone https://github.com/Pulse-Eight/platform.git
$ mkdir platform/build
$ cd platform/build
$ cmake ..
$ make -j 8
$ sudo make install

Clone libCEC from the Github repository then build/install that.

$ git clone https://github.com/Pulse-Eight/libcec.git
$ cd libcec
$ wget -O libcec.patch https://github.com/Kwiboo/libcec/commit/48255b7d4e1cba1050b8abfbd03be37c0737e832.patch
$ git apply libcec.patch
$ mkdir build
$ cd build
$ cmake -DHAVE_LINUX_API=1 ..
$ make -j 8
$ sudo make install
$ sudo ldconfig

Apply the built libCEC library

You have to remote exist libcec4 library to apply the new one.

After removing libcec4 via the apt package manager, you have to install cec-utils since cec-utils also will be removed when you remove libcec4.

$ sudo apt remove libcec4
$ sudo apt install cec-utils