lirc: add support for Python bindings

This commit is contained in:
Ben Wolsieffer 2018-10-12 13:39:26 -04:00 committed by Frederik Rietdijk
parent 1ba50fe163
commit 3055a0c975
2 changed files with 17 additions and 7 deletions

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, alsaLib, help2man, pkgconfig, xlibsWrapper, python3 { stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, help2man, python3,
, libxslt, systemd, libusb, libftdi1 }: alsaLib, xlibsWrapper, libxslt, systemd, libusb, libftdi1 }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "lirc-0.10.1"; name = "lirc-0.10.1";
@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
sha256 = "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb"; sha256 = "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb";
}; };
# Fix installation of Python bindings
patches = [ (fetchpatch {
url = "https://sourceforge.net/p/lirc/tickets/339/attachment/0001-Fix-Python-bindings.patch";
sha256 = "088a39x8c1qd81qwvbiqd6crb2lk777wmrs8rdh1ga06lglyvbly";
}) ];
postPatch = '' postPatch = ''
patchShebangs . patchShebangs .
@ -24,17 +30,17 @@ stdenv.mkDerivation rec {
touch lib/lirc/input_map.inc touch lib/lirc/input_map.inc
''; '';
nativeBuildInputs = [ pkgconfig help2man ]; nativeBuildInputs = [ autoreconfHook pkgconfig help2man
(python3.withPackages (p: with p; [ pyyaml setuptools ])) ];
buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ] buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ];
++ (with python3.pkgs; [ python pyyaml setuptools ]);
configureFlags = [ configureFlags = [
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--localstatedir=/var" "--localstatedir=/var"
"--with-systemdsystemunitdir=$(out)/lib/systemd/system" "--with-systemdsystemunitdir=$(out)/lib/systemd/system"
"--enable-uinput" # explicite activation because build env has no uinput "--enable-uinput" # explicit activation because build env has no uinput
"--enable-devinput" # explicite activation because build env has not /dev/input "--enable-devinput" # explicit activation because build env has no /dev/input
]; ];
installFlags = [ installFlags = [

View File

@ -2929,6 +2929,10 @@ in {
}; };
}; };
lirc = disabledIf isPy27 (toPythonModule (pkgs.lirc.override {
python3 = python;
}));
jupyter = buildPythonPackage rec { jupyter = buildPythonPackage rec {
version = "1.0.0"; version = "1.0.0";
name = "jupyter-${version}"; name = "jupyter-${version}";