gnu: icecat: Add fixes from mozilla-esr60 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / hardware.scm
CommitLineData
aadd1d24
TGR
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
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 hardware)
20 #:use-module (gnu packages compression)
5eff4380 21 #:use-module (gnu packages gcc)
aadd1d24
TGR
22 #:use-module (gnu packages glib)
23 #:use-module (gnu packages libusb)
24 #:use-module (gnu packages linux)
25 #:use-module (gnu packages pkg-config)
26 #:use-module (gnu packages xdisorg)
27 #:use-module (gnu packages xorg)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix download)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages))
32
33;; This is a module for packages related to physical hardware that don't (yet)
34;; have a more specific home like gps.scm, security-token.scm, &c.
35
36(define-public ddcutil
37 (package
38 (name "ddcutil")
9e783d0b 39 (version "0.9.2")
aadd1d24
TGR
40 (source
41 (origin
42 (method url-fetch)
43 (uri (string-append "https://www.ddcutil.com/tarballs/"
44 name "-" version ".tar.gz"))
45 (sha256
9e783d0b 46 (base32 "0nhi261vf2n3jpi0a0n6659911kxi3lj7a4h7cmv0ip6sbb8rk88"))))
aadd1d24
TGR
47 (build-system gnu-build-system)
48 (native-inputs
49 `(("pkg-config" ,pkg-config)))
50 (inputs
51 `(("eudev" ,eudev)
52 ("glib" ,glib)
53 ("libdrm" ,libdrm) ; enhanced diagnostics
54 ("libusb" ,libusb) ; support USB monitors
55 ("libx11" ,libx11) ; enhanced diagnostics
56 ("libxrandr" ,libxrandr)
57 ("zlib" ,zlib)))
58 (home-page "https://www.ddcutil.com/")
59 (synopsis "Control external monitor settings")
60 (description
61 "ddcutil can query and modify most external monitors' settings, such as
62brightness, colour levels, and input sources. Generally speaking, any setting
63that can be changed by pressing buttons on the monitor can be modified by
64ddcutil.
65
66ddcutil communicates directly with monitors implementing the Monitor Control
67Command Set (@dfn{MCCS}). It usually does so through the the Display Data
68Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
69communicate over USB as per the USB Monitor Control Class Specification.
70
71One particular use case is in colour profile management. Monitor calibration
72is relative to the monitor colour settings currently in effect, e.g. red gain.
73ddcutil allows colour-related settings to be saved at the time a monitor is
74calibrated, and restored when the calibration is applied.")
75 (license (list license:bsd-3 ; FindDDCUtil.cmake
76 license:gpl2+)))) ; everything else
6e8c75b8 77
5eff4380
TGR
78;; Distinct from memtest86, which is obsolete.
79(define-public memtest86+
80 (package
81 (name "memtest86+")
82 ;; Update the description when/if UEFI support is released.
83 (version "5.01")
84 (source
85 (origin
86 (method url-fetch)
87 (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-"
88 version ".tar.gz"))
89 (sha256
90 (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l"))))
91 (build-system gnu-build-system)
92 (arguments
93 `(#:system "i686-linux" ; the result runs outside of any OS
94 #:tests? #f ; no way to test this
95 #:phases
96 (modify-phases %standard-phases
97 (delete 'configure) ; no configure script
98 (replace 'build
99 ;; The default 'make all' does wonderful things, like scp(1) a file to
100 ;; 192.168.0.12. Build the bootable images and nothing more.
101 (lambda _
102 (invoke "make"
103 "memtest" ; ELF executable
104 "memtest.bin"))) ; DOS/MBR boot sector
105 (replace 'install
106 (lambda* (#:key outputs #:allow-other-keys)
107 (let* ((out (assoc-ref outputs "out"))
108 (lib (string-append out "/lib/memtest86+"))
109 (doc (string-append out "/share/doc/memtest86+-" ,version)))
110 (for-each
111 (lambda (file)
112 (install-file file lib))
113 (list "memtest"
114 "memtest.bin"))
115 (for-each
116 (lambda (file)
117 (install-file file doc))
118 (list "FAQ"
fb541251
TGR
119 "README"))
120 #t))))))
5eff4380
TGR
121 (native-inputs
122 ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors.
123 `(("gcc" ,gcc-4.9)))
124 (supported-systems (list "i686-linux" "x86_64-linux"))
125 (home-page "https://www.memtest.org/")
126 (synopsis "Thorough real-mode memory tester")
127 (description
128 "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It
129repeatedly writes different patterns to all memory locations, reads them back
130again, and verifies whether the result is the same as what was written. This
131can help debug even intermittent and non-deterministic errors.
132
133It runs independently of any operating system, at computer boot-up, so that it
134can scan as much of your RAM as possible for hardware defects.
135
136Memtest86+ cannot currently be used on computers booted with UEFI.")
137 (license license:gpl2)))
138
fb541251
TGR
139(define-public memtester
140 (package
141 (name "memtester")
142 (version "4.3.0")
143 (source
144 (origin
145 (method url-fetch)
146 ;; Even the latest release is available under 'old-versions/'.
147 (uri (string-append "http://pyropus.ca/software/memtester/old-versions/"
148 "memtester-" version ".tar.gz"))
149 (sha256
150 (base32 "127xymmyzb9r6dxqrwd69v7gf8csv8kv7fjvagbglf3wfgyy5pzr"))))
151 (build-system gnu-build-system)
152 (arguments
153 `(#:make-flags
154 (list "CC=gcc")
155 #:phases
156 (modify-phases %standard-phases
157 (replace 'configure
158 ;; This is a home-brewed configuration system where the cc/ld command
159 ;; lines are stored in one-line files.
160 (lambda* (#:key outputs #:allow-other-keys)
161 (let* ((out (assoc-ref outputs "out")))
162 (substitute* (list "conf-cc" "conf-ld")
163 (("^cc") "gcc"))
164 (substitute* "Makefile"
165 (("(INSTALLPATH.*=).*" _ assignment)
166 (string-append assignment out)))
167 #t)))
168 (replace 'check
169 ;; There is no test suite. Test some RAM for a single iteration.
170 (lambda _
171 (invoke "./memtester" "64K" "1"))))))
172 (home-page "http://pyropus.ca/software/memtester/")
173 (synopsis "User-space memory subsystem tester")
174 (description
175 "Memtester stress-tests the memory subsystem of your operating system and
176computer. It repeatedly writes different patterns to all memory locations,
177reads them back again, and verifies whether the result is the same as what was
178written. This can help debug even intermittent and non-deterministic errors.
179
180Memtester runs entirely in user space. This means that you don't need to reboot
181to test your memory, but also that it's not possible to test all of the RAM
182installed in the system.
183
184It can also be told to test memory starting at a particular physical address.")
185 (license license:gpl2)))
186
6e8c75b8
TGR
187(define-public msr-tools
188 (package
189 (name "msr-tools")
190 (version "1.3")
191 (source
192 (origin
193 (method url-fetch)
194 (uri (string-append "https://01.org/sites/default/files/downloads/"
195 name "/" name "-" version ".zip"))
196 (sha256
197 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
198 (build-system gnu-build-system)
199 (arguments
200 `(#:make-flags
201 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
202 #:phases
203 (modify-phases %standard-phases
204 (delete 'configure) ; no configure script
205 (add-before 'install 'create-output-directory
206 (lambda* (#:key outputs #:allow-other-keys)
207 ;; 'make install' assumes that sbindir exists.
208 (let* ((out (assoc-ref outputs "out"))
209 (sbin (string-append out "/sbin")))
210 (mkdir-p sbin)
211 #t))))
212 #:tests? #f)) ; no test suite
213 (native-inputs
214 `(("unzip" ,unzip)))
215 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
216 (supported-systems (list "i686-linux" "x86_64-linux"))
217 (home-page "https://01.org/msr-tools/")
218 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
219 (description
220 "The MSR Tools project provides console utilities to directly access the
221Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
222
223@itemize
224@item @command{cpuid}: show identification and feature information of any CPU
225@item @command{rdmsr}: read MSRs from any CPU or all CPUs
226@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
227@end itemize
228
229These tools can be used to query and modify certain low-level CPU parameters,
230such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
231
232MSR addresses differ (greatly) between processors, and any such modification can
233be dangerous and may void your CPU or system board's warranty.")
234 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+