1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 Alex Kost <alezost@gmail.com>
3 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
4 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
21 (define-module (gnu packages lirc)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system python)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages pkg-config)
30 #:use-module (gnu packages libusb)
31 #:use-module (gnu packages linux)
32 #:use-module (gnu packages xml)
33 #:use-module (gnu packages xorg)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages python-xyz))
43 (uri (string-append "mirror://sourceforge/lirc/LIRC/" version
44 "/lirc-" version ".tar.bz2"))
47 "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb"))
48 (patches (search-patches "lirc-localstatedir.patch"
49 "lirc-reproducible-build.patch"))))
50 (build-system gnu-build-system)
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.
59 (modify-phases %standard-phases
60 (add-after 'unpack 'disable-kernel-sniffing
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"))
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"))))
75 (add-after 'unpack 'patch-doc/Makefile.in
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"))
87 `(("pkg-config" ,pkg-config)
88 ("libxslt" ,libxslt)))
91 ("libusb-compat" ,libusb-compat)
92 ("linux-headers" ,linux-libre-headers)
93 ("alsa-lib" ,alsa-lib)
95 (home-page "http://www.lirc.org/")
96 (synopsis "Linux Infrared Remote Control")
98 "LIRC allows computers to send and receive IR signals of many commonly
99 used remote controls. The most important part of LIRC is the @code{lircd}
100 daemon that decodes IR signals received by the device drivers. The second
101 daemon program @code{lircmd} allows to translate IR signals to mouse movements.
102 The user space applications allow you to control your computer with a remote
103 control: you can send X events to applications, start programs and much more
104 on just one button press.")
105 (license license:gpl2+)))
107 (define-public python-lirc
108 (let ((commit "c28708bbeb6e02d85f13dd7e0b24e8e86abc215b")
112 (version (git-version "1.2.1" revision commit))
117 (url "https://github.com/tompreston/python-lirc.git")
119 (file-name (git-file-name name version))
122 "13s9zqyfh871ls1aha47rhmk13b4mcyfckcn2sw70bvc26832gk6"))))
123 (build-system python-build-system)
127 `(("python-cython" ,python-cython)))
129 `(#:tests? #f ; the only tests that exist are interactive
131 (modify-phases %standard-phases
132 (add-before 'build 'build-from-cython-files
133 (lambda _ (invoke "make" "py3"))))))
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)))))))
140 (define-public python2-lirc
141 (let ((base (package-with-python2 (strip-python2-variant python-lirc))))
145 `(#:tests? #f ; the only tests that exist are human-interactive
147 (modify-phases %standard-phases
148 (add-before 'build 'build-from-cython-files
149 (lambda _ (invoke "make" "py2"))))))
151 `(("python2-cython" ,python2-cython))))))