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