nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, udev, libcec_platform, libraspberrypi ? null }:
2
3stdenv.mkDerivation rec {
4 pname = "libcec";
5 version = "6.0.2";
6
7 src = fetchFromGitHub {
8 owner = "Pulse-Eight";
9 repo = "libcec";
10 rev = "libcec-${version}";
11 sha256 = "sha256-OWqCn7Z0KG8sLlfMWd0btJIFJs79ET3Y1AV/y/Kj2TU=";
12 };
13
14 nativeBuildInputs = [ pkg-config cmake ];
15 buildInputs = [ udev libcec_platform ] ++
16 lib.optional (libraspberrypi != null) libraspberrypi;
17
18 cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
19
20 # Fix dlopen path
21 patchPhase = ''
22 substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
23 '';
24
25 meta = with lib; {
26 description = "Allows you (with the right hardware) to control your device with your TV remote control using existing HDMI cabling";
27 homepage = "http://libcec.pulse-eight.com";
28 license = lib.licenses.gpl2Plus;
29 platforms = platforms.linux;
30 maintainers = [ maintainers.titanous ];
31 };
32}