gnu: python-pandas: Fix build on 32-bit.
[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
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"))))
58 #t))
59 (add-after 'unpack 'patch-doc/Makefile.in
60 (lambda _
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"))
69 #t)))))
e7682771 70 (native-inputs
678932aa
AK
71 `(("pkg-config" ,pkg-config)
72 ("libxslt" ,libxslt)))
e7682771
AK
73 (inputs
74 `(("libx11" ,libx11)
a88825d9
AK
75 ("libusb-compat" ,libusb-compat)
76 ("linux-headers" ,linux-libre-headers)
e7682771
AK
77 ("alsa-lib" ,alsa-lib)
78 ("python" ,python)))
79 (home-page "http://www.lirc.org/")
80 (synopsis "Linux Infrared Remote Control")
81 (description
82 "LIRC allows computers to send and receive IR signals of many commonly
83used remote controls. The most important part of LIRC is the 'lircd' daemon
84that decodes IR signals received by the device drivers. The second daemon
85program 'lircmd' allows to translate IR signals to mouse movements. The
86user space applications allow you to control your computer with a remote
87control: you can send X events to applications, start programs and much more
88on just one button press.")
89 (license license:gpl2+)))
231313f7
DM
90
91(define-public python-lirc
5dee9186
LF
92 (let ((commit "4091fe918f3eed2513dad008828565cace408d2f")
93 (revision "1"))
231313f7 94 (package
5dee9186
LF
95 (name "python-lirc")
96 (version (string-append "1.2.1-" revision "." (string-take commit 7)))
97 (source
98 (origin
99 (method git-fetch)
100 (uri (git-reference
101 (url "https://github.com/tompreston/python-lirc.git")
102 (commit commit)))
103 (sha256
104 (base32
105 "0cm47s5pvijfs3v2k7hmpxv3mvp4n5la0ihnsczk5ym3iq166jil"))
106 (file-name (string-append name "-" version))))
107 (build-system python-build-system)
108 (inputs
109 `(("lirc" ,lirc)))
110 (native-inputs
111 `(("python-cython" ,python-cython)))
231313f7 112 (arguments
5dee9186 113 `(#:tests? #f ; the only tests that exist are human-interactive
231313f7 114 #:phases
5dee9186
LF
115 (modify-phases %standard-phases
116 (add-before 'build 'build-from-cython-files
117 (lambda _
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)))))))
124
125 (define-public python2-lirc
126 (let ((base (package-with-python2 (strip-python2-variant python-lirc))))
127 (package
128 (inherit base)
129 (arguments
130 `(#:tests? #f ; the only tests that exist are human-interactive
131 #:phases
132 (modify-phases %standard-phases
133 (add-before 'build 'build-from-cython-files
134 (lambda _
135 (zero? (system* "make" "py2")))))))
136 (native-inputs
f3b98f4f 137 `(("python2-cython" ,python2-cython))))))