summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/libraries/lirc/default.nix20
-rw-r--r--pkgs/top-level/python-packages.nix4
2 files changed, 17 insertions, 7 deletions
diff --git a/pkgs/development/libraries/lirc/default.nix b/pkgs/development/libraries/lirc/default.nix
index ad6d2df1d8b..13fbe2b55b6 100644
--- a/pkgs/development/libraries/lirc/default.nix
+++ b/pkgs/development/libraries/lirc/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, alsaLib, help2man, pkgconfig, xlibsWrapper, python3
-, libxslt, systemd, libusb, libftdi1 }:
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, help2man, python3,
+  alsaLib, xlibsWrapper, libxslt, systemd, libusb, libftdi1 }:
 
 stdenv.mkDerivation rec {
   name = "lirc-0.10.1";
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
     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 = ''
     patchShebangs .
 
@@ -24,17 +30,17 @@ stdenv.mkDerivation rec {
     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 ]
-  ++ (with python3.pkgs; [ python pyyaml setuptools ]);
+  buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ];
 
   configureFlags = [
     "--sysconfdir=/etc"
     "--localstatedir=/var"
     "--with-systemdsystemunitdir=$(out)/lib/systemd/system"
-    "--enable-uinput" # explicite activation because build env has no uinput
-    "--enable-devinput" # explicite activation because build env has not /dev/input
+    "--enable-uinput" # explicit activation because build env has no uinput
+    "--enable-devinput" # explicit activation because build env has no /dev/input
   ];
 
   installFlags = [
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 981b3146a07..f5b747b165c 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -2929,6 +2929,10 @@ in {
     };
   };
 
+  lirc = disabledIf isPy27 (toPythonModule (pkgs.lirc.override {
+    python3 = python;
+  }));
+
   jupyter = buildPythonPackage rec {
     version = "1.0.0";
     name = "jupyter-${version}";