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