Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libcec / default.nix
blob1d6fd44acb69ed0d2e979707e3fc60d7b9658972
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , pkg-config
6 , udev
7 , libcec_platform
8 , withLibraspberrypi ? false
9 , libraspberrypi
12 stdenv.mkDerivation rec {
13   pname = "libcec";
14   version = "6.0.2";
16   src = fetchFromGitHub {
17     owner = "Pulse-Eight";
18     repo = "libcec";
19     rev = "libcec-${version}";
20     sha256 = "sha256-OWqCn7Z0KG8sLlfMWd0btJIFJs79ET3Y1AV/y/Kj2TU=";
21   };
23   # Fix dlopen path
24   postPatch = ''
25     substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
26   '';
28   nativeBuildInputs = [ pkg-config cmake ];
29   buildInputs = [ udev libcec_platform ] ++
30     lib.optional withLibraspberrypi libraspberrypi;
32   cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
34   meta = with lib; {
35     description = "Allows you (with the right hardware) to control your device with your TV remote control using existing HDMI cabling";
36     homepage = "http://libcec.pulse-eight.com";
37     license = lib.licenses.gpl2Plus;
38     platforms = platforms.linux;
39     maintainers = [ maintainers.titanous ];
40   };