2022-10-06 18:32:54 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, udev
|
|
|
|
, libcec_platform
|
|
|
|
, withLibraspberrypi ? false
|
|
|
|
, libraspberrypi
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-18 21:22:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libcec";
|
2021-07-18 21:22:44 +00:00
|
|
|
version = "6.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Pulse-Eight";
|
|
|
|
repo = "libcec";
|
|
|
|
rev = "libcec-${version}";
|
|
|
|
sha256 = "sha256-OWqCn7Z0KG8sLlfMWd0btJIFJs79ET3Y1AV/y/Kj2TU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
# Fix dlopen path
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ udev libcec_platform ] ++
|
2022-10-06 18:32:54 +00:00
|
|
|
lib.optional withLibraspberrypi libraspberrypi;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=1"
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
"-DHAVE_LINUX_API=1"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Allows you (with the right hardware) to control your device with your TV remote control using existing HDMI cabling";
|
|
|
|
homepage = "http://libcec.pulse-eight.com";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.titanous ];
|
|
|
|
};
|
|
|
|
}
|