projects/guix·blob javascript-team · refs

126 lines · 5.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2016, 2017 Alex Kost <[email protected]>
3;;; Copyright © 2016 Danny Milosavljevic <[email protected]>
4;;; Copyright © 2017 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2019 Ricardo Wurmus <[email protected]>
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 gexp)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix git-download)
27 #:use-module (guix build-system gnu)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages libusb)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages xml)
34 #:use-module (gnu packages xorg)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages python-build)
37 #:use-module (gnu packages python-xyz))
38
39(define-public lirc
40 (package
41 (name "lirc")
42 (version "0.10.2")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "mirror://sourceforge/lirc/LIRC/" version
46 "/lirc-" version ".tar.bz2"))
47 (sha256
48 (base32
49 "0ai27l6hxfgkwvkqa3fy1b1gqzw2y10md030y5ig4748fj1fqi1x"))
50 (patches (search-patches "lirc-localstatedir.patch"
51 "lirc-reproducible-build.patch"))))
52 (build-system gnu-build-system)
53 (arguments
54 (list
55 #:configure-flags
56 #~(list "--localstatedir=/var"
57 ;; "configure" script fails to enable "devinput" driver as it
58 ;; checks for "/dev/input" directory (which is not available),
59 ;; so enable it explicitly.
60 "--enable-devinput")
61 #:phases
62 #~(modify-phases %standard-phases
63 (add-after 'unpack 'disable-kernel-sniffing
64 (lambda _
65 ;; Correct the faulty assumption that systemd support should be
66 ;; hard-wired when a build host's /proc/version contains "Ubuntu".
67 (substitute* "configure"
68 (("kernelversion=.*")
69 "kernelversion=irrelevant\n"))))
70 (add-after 'unpack 'patch-lirc-make-devinput
71 (lambda* (#:key inputs #:allow-other-keys)
72 ;; 'lirc-make-devinput' script assumes that linux headers
73 ;; are placed in "/usr/...".
74 (let ((headers (assoc-ref inputs "kernel-headers")))
75 (substitute* "tools/lirc-make-devinput"
76 (("/usr/include")
77 (string-append headers "/include"))))))
78 (add-after 'unpack 'fix-gcc14-build
79 (lambda _
80 ;; Fix missing sys/sysmacros.h for major() and minor() macros
81 (substitute* "plugins/default.c"
82 (("#include <sys/types.h>" all)
83 (string-append all "\n#include <sys/sysmacros.h>")))))
84 (add-after 'unpack 'patch-doc/Makefile.in
85 (lambda _
86 ;; Lirc wants to install several images and a useless html page
87 ;; to "$(localstatedir)/lib/lirc/". This makes 'install' phase
88 ;; fail as localstatedir is "/var", so do not install these
89 ;; files there (the same images are installed in
90 ;; "share/doc/lirc/images/" anyway).
91 (substitute* "doc/Makefile.in"
92 (("^vardocs_DATA =.*")
93 "vardocs_DATA =\n")
94 (("^varimage_DATA =.*")
95 "varimage_DATA =\n"))))
96 (add-after 'unpack 'omit-pip-sourceball
97 ;; ‘make install’ invokes ’setup.py sdist’, which has no known (to
98 ;; nckx) way to enforce mtimes. The utility of this is questionable,
99 ;; IMO: let's disable it entirely & listen for complaints, if any.
100 (lambda _
101 (substitute* "Makefile.in"
102 (("(PYTHON_TARBALL.*=).*" _ tarball=)
103 (string-append tarball= "\n")))))
104 (add-before 'configure 'build-reproducibly
105 (lambda _
106 (setenv "LIRC_IRDB_CACHE_ID" "build time"))))))
107 (native-inputs
108 (list libxslt
109 pkg-config
110 python-setuptools))
111 (inputs
112 (list libx11
113 libusb-compat
114 alsa-lib
115 python))
116 (home-page "https://www.lirc.org/")
117 (synopsis "Linux Infrared Remote Control")
118 (description
119 "LIRC allows computers to send and receive IR signals of many commonly
120used remote controls. The most important part of LIRC is the @code{lircd}
121daemon that decodes IR signals received by the device drivers. The second
122daemon program @code{lircmd} translates IR signals to mouse movements.
123The user space applications allow you to control your computer with a remote
124control: you can send X events to applications, start programs and much more
125on just one button press.")
126 (license license:gpl2+)))