nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, fetchurl, cmake, pkgconfig, udev, libcec_platform }:
2
3let version = "4.0.2"; 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 = "09xsw9hfymzl9fi9r2r8n5cxk80fc00x9drsy1r59pgbycqxvf5q";
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}