gnu: emacs-sly: Update to 20200228.
[jackhill/guix/guix.git] / gnu / packages / lirc.scm
CommitLineData
e7682771 1;;; GNU Guix --- Functional package management for GNU
41342e89
AK
2;;; Copyright © 2015, 2016, 2017 Alex Kost <alezost@gmail.com>
3;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
4c523c45 4;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
e7682771
AK
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages lirc)
22 #:use-module (guix packages)
23 #:use-module (guix download)
231313f7 24 #:use-module (guix git-download)
e7682771 25 #:use-module (guix build-system gnu)
231313f7 26 #:use-module (guix build-system python)
e7682771
AK
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages pkg-config)
a88825d9 30 #:use-module (gnu packages libusb)
e7682771 31 #:use-module (gnu packages linux)
678932aa 32 #:use-module (gnu packages xml)
e7682771 33 #:use-module (gnu packages xorg)
44d10b1f
RW
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages python-xyz))
e7682771
AK
36
37(define-public lirc
38 (package
39 (name "lirc")
41342e89 40 (version "0.10.1")
e7682771
AK
41 (source (origin
42 (method url-fetch)
de67e922
LF
43 (uri (string-append "mirror://sourceforge/lirc/LIRC/" version
44 "/lirc-" version ".tar.bz2"))
e7682771
AK
45 (sha256
46 (base32
41342e89 47 "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb"))
c324ad52
LC
48 (patches (search-patches "lirc-localstatedir.patch"
49 "lirc-reproducible-build.patch"))))
e7682771
AK
50 (build-system gnu-build-system)
51 (arguments
41342e89
AK
52 '(#:configure-flags
53 '("--localstatedir=/var"
54 ;; "configure" script fails to enable "devinput" driver as it
55 ;; checks for "/dev/input" directory (which is not available),
56 ;; so enable it explicitly.
57 "--enable-devinput")
a88825d9
AK
58 #:phases
59 (modify-phases %standard-phases
794cced6
TGR
60 (add-after 'unpack 'disable-kernel-sniffing
61 (lambda _
62 ;; Correct the faulty assumption that systemd support should be
63 ;; hard-wired when a build host's /proc/version contains "Ubuntu".
64 (substitute* "configure"
65 (("kernelversion=.*") "kernelversion=irrelevant\n"))
66 #t))
a88825d9
AK
67 (add-after 'unpack 'patch-lirc-make-devinput
68 (lambda* (#:key inputs #:allow-other-keys)
69 ;; 'lirc-make-devinput' script assumes that linux headers
70 ;; are placed in "/usr/...".
71 (let ((headers (assoc-ref inputs "linux-headers")))
72 (substitute* "tools/lirc-make-devinput"
73 (("/usr/include") (string-append headers "/include"))))
74 #t))
75 (add-after 'unpack 'patch-doc/Makefile.in
76 (lambda _
77 ;; Lirc wants to install several images and a useless html page
78 ;; to "$(localstatedir)/lib/lirc/". This makes 'install' phase
79 ;; fail as localstatedir is "/var", so do not install these
80 ;; files there (the same images are installed in
81 ;; "share/doc/lirc/images/" anyway).
82 (substitute* "doc/Makefile.in"
83 (("^vardocs_DATA =.*") "vardocs_DATA =\n")
84 (("^varimage_DATA =.*") "varimage_DATA =\n"))
85 #t)))))
e7682771 86 (native-inputs
678932aa
AK
87 `(("pkg-config" ,pkg-config)
88 ("libxslt" ,libxslt)))
e7682771
AK
89 (inputs
90 `(("libx11" ,libx11)
a88825d9
AK
91 ("libusb-compat" ,libusb-compat)
92 ("linux-headers" ,linux-libre-headers)
e7682771
AK
93 ("alsa-lib" ,alsa-lib)
94 ("python" ,python)))
95 (home-page "http://www.lirc.org/")
96 (synopsis "Linux Infrared Remote Control")
97 (description
98 "LIRC allows computers to send and receive IR signals of many commonly
36a4366d
EF
99used remote controls. The most important part of LIRC is the @code{lircd}
100daemon that decodes IR signals received by the device drivers. The second
101daemon program @code{lircmd} allows to translate IR signals to mouse movements.
102The user space applications allow you to control your computer with a remote
e7682771
AK
103control: you can send X events to applications, start programs and much more
104on just one button press.")
105 (license license:gpl2+)))
231313f7
DM
106
107(define-public python-lirc
4c523c45
RW
108 (let ((commit "c28708bbeb6e02d85f13dd7e0b24e8e86abc215b")
109 (revision "2"))
231313f7 110 (package
5dee9186 111 (name "python-lirc")
4c523c45 112 (version (git-version "1.2.1" revision commit))
5dee9186 113 (source
4c523c45
RW
114 (origin
115 (method git-fetch)
116 (uri (git-reference
117 (url "https://github.com/tompreston/python-lirc.git")
118 (commit commit)))
119 (file-name (git-file-name name version))
120 (sha256
121 (base32
122 "13s9zqyfh871ls1aha47rhmk13b4mcyfckcn2sw70bvc26832gk6"))))
5dee9186
LF
123 (build-system python-build-system)
124 (inputs
125 `(("lirc" ,lirc)))
126 (native-inputs
127 `(("python-cython" ,python-cython)))
231313f7 128 (arguments
4c523c45 129 `(#:tests? #f ; the only tests that exist are interactive
231313f7 130 #:phases
5dee9186
LF
131 (modify-phases %standard-phases
132 (add-before 'build 'build-from-cython-files
4c523c45 133 (lambda _ (invoke "make" "py3"))))))
5dee9186
LF
134 (home-page "https://github.com/tompreston/python-lirc")
135 (synopsis "Python bindings for LIRC")
136 (description "@code{lirc} is a Python module which provides LIRC bindings.")
137 (license license:gpl3)
138 (properties `((python2-variant . ,(delay python2-lirc)))))))
139
140 (define-public python2-lirc
141 (let ((base (package-with-python2 (strip-python2-variant python-lirc))))
142 (package
143 (inherit base)
144 (arguments
145 `(#:tests? #f ; the only tests that exist are human-interactive
146 #:phases
147 (modify-phases %standard-phases
148 (add-before 'build 'build-from-cython-files
4c523c45 149 (lambda _ (invoke "make" "py2"))))))
5dee9186 150 (native-inputs
f3b98f4f 151 `(("python2-cython" ,python2-cython))))))