2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, pkg-config, udev, libcec_platform, libraspberrypi ? null }:
|
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
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/Pulse-Eight/libcec/archive/libcec-${version}.tar.gz";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "0xrkrcgfgr5r8r0854bw3i9jbq4jmf8nzc5vrrx2sxzvlkbrc1h9";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ udev libcec_platform ] ++
|
2021-02-05 17:12:51 +00:00
|
|
|
lib.optional (libraspberrypi != null) libraspberrypi;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
|
|
|
|
|
|
|
|
# Fix dlopen path
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
|
|
|
|
'';
|
|
|
|
|
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";
|
|
|
|
repositories.git = "https://github.com/Pulse-Eight/libcec.git";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|