libcec: remove ? null from inputs, use postPatch

This commit is contained in:
Sandro Jäckel 2022-10-02 19:13:46 +02:00
parent 4c2dca627e
commit 82d94d1aed
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5
2 changed files with 18 additions and 11 deletions

View File

@ -1,4 +1,13 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, udev, libcec_platform, libraspberrypi ? null }:
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, udev
, libcec_platform
, withLibraspberrypi ? false
, libraspberrypi
}:
stdenv.mkDerivation rec {
pname = "libcec";
@ -11,17 +20,17 @@ stdenv.mkDerivation rec {
sha256 = "sha256-OWqCn7Z0KG8sLlfMWd0btJIFJs79ET3Y1AV/y/Kj2TU=";
};
nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [ udev libcec_platform ] ++
lib.optional (libraspberrypi != null) libraspberrypi;
cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
# Fix dlopen path
patchPhase = ''
postPatch = ''
substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
'';
nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [ udev libcec_platform ] ++
lib.optional withLibraspberrypi libraspberrypi;
cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
meta = with lib; {
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";

View File

@ -19463,9 +19463,7 @@ with pkgs;
libccd = callPackage ../development/libraries/libccd { };
libcec = callPackage ../development/libraries/libcec {
libraspberrypi = null;
};
libcec = callPackage ../development/libraries/libcec { };
libcec_platform = callPackage ../development/libraries/libcec/platform.nix { };