1{ stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, help2man, python3,
2 alsaLib, xlibsWrapper, libxslt, systemd, libusb, libftdi1 }:
3
4stdenv.mkDerivation rec {
5 name = "lirc-0.10.1";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/lirc/${name}.tar.bz2";
9 sha256 = "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb";
10 };
11
12 # Fix installation of Python bindings
13 patches = [ (fetchpatch {
14 url = "https://sourceforge.net/p/lirc/tickets/339/attachment/0001-Fix-Python-bindings.patch";
15 sha256 = "088a39x8c1qd81qwvbiqd6crb2lk777wmrs8rdh1ga06lglyvbly";
16 }) ];
17
18 postPatch = ''
19 patchShebangs .
20
21 # fix overriding PYTHONPATH
22 sed -i 's,^PYTHONPATH *= *,PYTHONPATH := $(PYTHONPATH):,' \
23 Makefile.in
24 sed -i 's,PYTHONPATH=,PYTHONPATH=$(PYTHONPATH):,' \
25 doc/Makefile.in
26 '';
27
28 preConfigure = ''
29 # use empty inc file instead of a from linux kernel generated one
30 touch lib/lirc/input_map.inc
31 '';
32
33 nativeBuildInputs = [ autoreconfHook pkgconfig help2man
34 (python3.withPackages (p: with p; [ pyyaml setuptools ])) ];
35
36 buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ];
37
38 configureFlags = [
39 "--sysconfdir=/etc"
40 "--localstatedir=/var"
41 "--with-systemdsystemunitdir=$(out)/lib/systemd/system"
42 "--enable-uinput" # explicit activation because build env has no uinput
43 "--enable-devinput" # explicit activation because build env has no /dev/input
44 ];
45
46 installFlags = [
47 "sysconfdir=$out/etc"
48 "localstatedir=$TMPDIR"
49 ];
50
51 meta = with stdenv.lib; {
52 description = "Allows to receive and send infrared signals";
53 homepage = http://www.lirc.org/;
54 license = licenses.gpl2;
55 platforms = platforms.linux;
56 maintainers = with maintainers; [ pSub ];
57 };
58}