1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
19 (define-module (gnu packages lirc)
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix git-download)
23 #:use-module (guix build-system gnu)
24 #:use-module (guix build-system python)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages libusb)
29 #:use-module (gnu packages linux)
30 #:use-module (gnu packages xml)
31 #:use-module (gnu packages xorg)
32 #:use-module (gnu packages python))
40 (uri (string-append "mirror://sourceforge/lirc/LIRC/" version
41 "/lirc-" version ".tar.bz2"))
44 "1l2xzhnm4hrla51ik09hcafki0y8wnww7svfm7j63zbl2rssc66x"))
45 (patches (search-patches "lirc-localstatedir.patch"))))
46 (build-system gnu-build-system)
48 '(#:configure-flags '("--localstatedir=/var")
50 (modify-phases %standard-phases
51 (add-after 'unpack 'patch-lirc-make-devinput
52 (lambda* (#:key inputs #:allow-other-keys)
53 ;; 'lirc-make-devinput' script assumes that linux headers
54 ;; are placed in "/usr/...".
55 (let ((headers (assoc-ref inputs "linux-headers")))
56 (substitute* "tools/lirc-make-devinput"
57 (("/usr/include") (string-append headers "/include"))))
59 (add-after 'unpack 'patch-doc/Makefile.in
61 ;; Lirc wants to install several images and a useless html page
62 ;; to "$(localstatedir)/lib/lirc/". This makes 'install' phase
63 ;; fail as localstatedir is "/var", so do not install these
64 ;; files there (the same images are installed in
65 ;; "share/doc/lirc/images/" anyway).
66 (substitute* "doc/Makefile.in"
67 (("^vardocs_DATA =.*") "vardocs_DATA =\n")
68 (("^varimage_DATA =.*") "varimage_DATA =\n"))
71 `(("pkg-config" ,pkg-config)
72 ("libxslt" ,libxslt)))
75 ("libusb-compat" ,libusb-compat)
76 ("linux-headers" ,linux-libre-headers)
77 ("alsa-lib" ,alsa-lib)
79 (home-page "http://www.lirc.org/")
80 (synopsis "Linux Infrared Remote Control")
82 "LIRC allows computers to send and receive IR signals of many commonly
83 used remote controls. The most important part of LIRC is the 'lircd' daemon
84 that decodes IR signals received by the device drivers. The second daemon
85 program 'lircmd' allows to translate IR signals to mouse movements. The
86 user space applications allow you to control your computer with a remote
87 control: you can send X events to applications, start programs and much more
88 on just one button press.")
89 (license license:gpl2+)))
91 (define-public python-lirc
92 (let ((commit "4091fe918f3eed2513dad008828565cace408d2f")
96 (version (string-append "1.2.1-" revision "." (string-take commit 7)))
101 (url "https://github.com/tompreston/python-lirc.git")
105 "0cm47s5pvijfs3v2k7hmpxv3mvp4n5la0ihnsczk5ym3iq166jil"))
106 (file-name (string-append name "-" version))))
107 (build-system python-build-system)
111 `(("python-cython" ,python-cython)))
113 `(#:tests? #f ; the only tests that exist are human-interactive
115 (modify-phases %standard-phases
116 (add-before 'build 'build-from-cython-files
118 (zero? (system* "make" "py3")))))))
119 (home-page "https://github.com/tompreston/python-lirc")
120 (synopsis "Python bindings for LIRC")
121 (description "@code{lirc} is a Python module which provides LIRC bindings.")
122 (license license:gpl3)
123 (properties `((python2-variant . ,(delay python2-lirc)))))))
125 (define-public python2-lirc
126 (let ((base (package-with-python2 (strip-python2-variant python-lirc))))
130 `(#:tests? #f ; the only tests that exist are human-interactive
132 (modify-phases %standard-phases
133 (add-before 'build 'build-from-cython-files
135 (zero? (system* "make" "py2")))))))
137 `(("python2-cython" ,python2-cython))))))