1{ stdenv, fetchurl, cmake, pkgconfig, udev, libcec_platform }:
2
3let version = "3.0.1"; in
4
5stdenv.mkDerivation {
6 name = "libcec-${version}";
7
8 src = fetchurl {
9 url = "https://github.com/Pulse-Eight/libcec/archive/libcec-${version}.tar.gz";
10 sha256 = "0gi5gq8pz6vfdx80pimx23d5g243zzgmc7s8wpb686csjk470dky";
11 };
12
13 buildInputs = [ cmake pkgconfig udev libcec_platform ];
14
15 cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
16
17 # Fix dlopen path
18 patchPhase = ''
19 substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
20 '';
21
22 meta = with stdenv.lib; {
23 description = "Allows you (with the right hardware) to control your device with your TV remote control using existing HDMI cabling";
24 homepage = "http://libcec.pulse-eight.com";
25 repositories.git = "https://github.com/Pulse-Eight/libcec.git";
26 license = stdenv.lib.licenses.gpl2Plus;
27 platforms = platforms.linux;
28 maintainers = [ maintainers.titanous ];
29 };
30}