forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / libcec / default.nix
blob4116f2a0172ad7f675a060c7716f876b43051893
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 = [
33     "-DBUILD_SHARED_LIBS=1"
34   ] ++ lib.optionals stdenv.hostPlatform.isLinux [
35     "-DHAVE_LINUX_API=1"
36   ];
38   meta = with lib; {
39     description = "Allows you (with the right hardware) to control your device with your TV remote control using existing HDMI cabling";
40     homepage = "http://libcec.pulse-eight.com";
41     license = lib.licenses.gpl2Plus;
42     platforms = platforms.linux;
43     maintainers = teams.kodi.members;
44   };