gnu: umockdev: Fix test.
[jackhill/guix/guix.git] / gnu / packages / hardware.scm
CommitLineData
aadd1d24 1;;; GNU Guix --- Functional package management for GNU
21724ed9 2;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
01782ad0 3;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
aadd1d24
TGR
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages hardware)
22a98cda 21 #:use-module (gnu packages autotools)
aadd1d24 22 #:use-module (gnu packages compression)
5eff4380 23 #:use-module (gnu packages gcc)
aadd1d24
TGR
24 #:use-module (gnu packages glib)
25 #:use-module (gnu packages libusb)
26 #:use-module (gnu packages linux)
0ba0ab81 27 #:use-module (gnu packages ncurses)
aadd1d24
TGR
28 #:use-module (gnu packages pkg-config)
29 #:use-module (gnu packages xdisorg)
30 #:use-module (gnu packages xorg)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix download)
0ba0ab81 33 #:use-module (guix git-download)
aadd1d24
TGR
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages))
36
37;; This is a module for packages related to physical hardware that don't (yet)
38;; have a more specific home like gps.scm, security-token.scm, &c.
39
40(define-public ddcutil
41 (package
42 (name "ddcutil")
21724ed9 43 (version "0.9.8")
aadd1d24
TGR
44 (source
45 (origin
46 (method url-fetch)
47 (uri (string-append "https://www.ddcutil.com/tarballs/"
ec756fa5 48 "ddcutil-" version ".tar.gz"))
aadd1d24 49 (sha256
21724ed9 50 (base32 "13ccxbqgyz4ah9jwbcylnfkgl8j3ida8xd00xkcq4xnfyyv5mg6v"))))
aadd1d24
TGR
51 (build-system gnu-build-system)
52 (native-inputs
53 `(("pkg-config" ,pkg-config)))
54 (inputs
55 `(("eudev" ,eudev)
56 ("glib" ,glib)
57 ("libdrm" ,libdrm) ; enhanced diagnostics
58 ("libusb" ,libusb) ; support USB monitors
59 ("libx11" ,libx11) ; enhanced diagnostics
60 ("libxrandr" ,libxrandr)
61 ("zlib" ,zlib)))
62 (home-page "https://www.ddcutil.com/")
63 (synopsis "Control external monitor settings")
64 (description
65 "ddcutil can query and modify most external monitors' settings, such as
66brightness, colour levels, and input sources. Generally speaking, any setting
67that can be changed by pressing buttons on the monitor can be modified by
68ddcutil.
69
70ddcutil communicates directly with monitors implementing the Monitor Control
71Command Set (@dfn{MCCS}). It usually does so through the the Display Data
72Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
73communicate over USB as per the USB Monitor Control Class Specification.
74
75One particular use case is in colour profile management. Monitor calibration
76is relative to the monitor colour settings currently in effect, e.g. red gain.
77ddcutil allows colour-related settings to be saved at the time a monitor is
78calibrated, and restored when the calibration is applied.")
79 (license (list license:bsd-3 ; FindDDCUtil.cmake
80 license:gpl2+)))) ; everything else
6e8c75b8 81
8fe681b9
BW
82(define-public edid-decode
83 (let ((commit "74b64180d67bb009d8d9ea1b6f18ad41aaa16396") ; 2020-04-22
84 (revision "1"))
85 (package
86 (name "edid-decode")
87 (version (git-version "0.0.0" revision commit))
88 (source
89 (origin
90 (method git-fetch)
91 (file-name (git-file-name name version))
92 (uri (git-reference
93 (url "git://linuxtv.org/edid-decode.git")
94 (commit commit)))
95 (sha256
96 (base32 "0nirp5bza08zj5d8bjgcm0p869hdg3qg3mwa7999pjdrzmn7s2ah"))))
97 (build-system gnu-build-system)
98 (arguments
99 `(#:tests? #f ; No test suite
100 #:make-flags
101 (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
102 "bindir=/bin" "mandir=/share/man")
103 #:phases
104 (modify-phases %standard-phases
105 (add-after 'unpack 'fix-cross-compilation
106 (lambda* (#:key native-inputs target #:allow-other-keys)
107 (when target
108 (substitute* "Makefile"
109 (("\\$\\(CXX\\)")
110 (string-append target "-g++"))))
111 #t))
112 (delete 'configure))))
113 (home-page "https://git.linuxtv.org/edid-decode.git/")
114 (synopsis "Decode @dfn{EDID} data in human-readable format")
115 (description "edid-decode decodes @dfn{EDID} monitor description data in
116human-readable format and checks if it conforms to the standards.")
117 (license license:expat))))
118
5eff4380
TGR
119;; Distinct from memtest86, which is obsolete.
120(define-public memtest86+
121 (package
122 (name "memtest86+")
123 ;; Update the description when/if UEFI support is released.
124 (version "5.01")
125 (source
126 (origin
127 (method url-fetch)
128 (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-"
129 version ".tar.gz"))
130 (sha256
131 (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l"))))
132 (build-system gnu-build-system)
133 (arguments
134 `(#:system "i686-linux" ; the result runs outside of any OS
135 #:tests? #f ; no way to test this
136 #:phases
137 (modify-phases %standard-phases
138 (delete 'configure) ; no configure script
139 (replace 'build
140 ;; The default 'make all' does wonderful things, like scp(1) a file to
141 ;; 192.168.0.12. Build the bootable images and nothing more.
142 (lambda _
143 (invoke "make"
144 "memtest" ; ELF executable
145 "memtest.bin"))) ; DOS/MBR boot sector
146 (replace 'install
147 (lambda* (#:key outputs #:allow-other-keys)
148 (let* ((out (assoc-ref outputs "out"))
149 (lib (string-append out "/lib/memtest86+"))
150 (doc (string-append out "/share/doc/memtest86+-" ,version)))
151 (for-each
152 (lambda (file)
153 (install-file file lib))
154 (list "memtest"
155 "memtest.bin"))
156 (for-each
157 (lambda (file)
158 (install-file file doc))
159 (list "FAQ"
fb541251
TGR
160 "README"))
161 #t))))))
5eff4380
TGR
162 (native-inputs
163 ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors.
164 `(("gcc" ,gcc-4.9)))
165 (supported-systems (list "i686-linux" "x86_64-linux"))
166 (home-page "https://www.memtest.org/")
167 (synopsis "Thorough real-mode memory tester")
168 (description
169 "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It
170repeatedly writes different patterns to all memory locations, reads them back
171again, and verifies whether the result is the same as what was written. This
172can help debug even intermittent and non-deterministic errors.
173
174It runs independently of any operating system, at computer boot-up, so that it
175can scan as much of your RAM as possible for hardware defects.
176
177Memtest86+ cannot currently be used on computers booted with UEFI.")
178 (license license:gpl2)))
179
fb541251
TGR
180(define-public memtester
181 (package
182 (name "memtester")
183 (version "4.3.0")
184 (source
185 (origin
186 (method url-fetch)
187 ;; Even the latest release is available under 'old-versions/'.
188 (uri (string-append "http://pyropus.ca/software/memtester/old-versions/"
189 "memtester-" version ".tar.gz"))
190 (sha256
191 (base32 "127xymmyzb9r6dxqrwd69v7gf8csv8kv7fjvagbglf3wfgyy5pzr"))))
192 (build-system gnu-build-system)
193 (arguments
194 `(#:make-flags
195 (list "CC=gcc")
196 #:phases
197 (modify-phases %standard-phases
198 (replace 'configure
199 ;; This is a home-brewed configuration system where the cc/ld command
200 ;; lines are stored in one-line files.
201 (lambda* (#:key outputs #:allow-other-keys)
202 (let* ((out (assoc-ref outputs "out")))
203 (substitute* (list "conf-cc" "conf-ld")
204 (("^cc") "gcc"))
205 (substitute* "Makefile"
206 (("(INSTALLPATH.*=).*" _ assignment)
207 (string-append assignment out)))
208 #t)))
209 (replace 'check
210 ;; There is no test suite. Test some RAM for a single iteration.
211 (lambda _
212 (invoke "./memtester" "64K" "1"))))))
213 (home-page "http://pyropus.ca/software/memtester/")
214 (synopsis "User-space memory subsystem tester")
215 (description
216 "Memtester stress-tests the memory subsystem of your operating system and
217computer. It repeatedly writes different patterns to all memory locations,
218reads them back again, and verifies whether the result is the same as what was
219written. This can help debug even intermittent and non-deterministic errors.
220
221Memtester runs entirely in user space. This means that you don't need to reboot
222to test your memory, but also that it's not possible to test all of the RAM
223installed in the system.
224
225It can also be told to test memory starting at a particular physical address.")
226 (license license:gpl2)))
227
6e8c75b8
TGR
228(define-public msr-tools
229 (package
230 (name "msr-tools")
231 (version "1.3")
232 (source
233 (origin
234 (method url-fetch)
235 (uri (string-append "https://01.org/sites/default/files/downloads/"
236 name "/" name "-" version ".zip"))
237 (sha256
238 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
239 (build-system gnu-build-system)
240 (arguments
241 `(#:make-flags
242 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
243 #:phases
244 (modify-phases %standard-phases
245 (delete 'configure) ; no configure script
246 (add-before 'install 'create-output-directory
247 (lambda* (#:key outputs #:allow-other-keys)
248 ;; 'make install' assumes that sbindir exists.
249 (let* ((out (assoc-ref outputs "out"))
250 (sbin (string-append out "/sbin")))
251 (mkdir-p sbin)
252 #t))))
253 #:tests? #f)) ; no test suite
254 (native-inputs
255 `(("unzip" ,unzip)))
256 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
257 (supported-systems (list "i686-linux" "x86_64-linux"))
258 (home-page "https://01.org/msr-tools/")
259 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
260 (description
261 "The MSR Tools project provides console utilities to directly access the
262Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
263
264@itemize
265@item @command{cpuid}: show identification and feature information of any CPU
266@item @command{rdmsr}: read MSRs from any CPU or all CPUs
267@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
268@end itemize
269
270These tools can be used to query and modify certain low-level CPU parameters,
271such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
272
273MSR addresses differ (greatly) between processors, and any such modification can
274be dangerous and may void your CPU or system board's warranty.")
275 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+
0ba0ab81
TGR
276
277(define-public wavemon
278 (package
279 (name "wavemon")
5976d0b0 280 (version "0.9.1")
0ba0ab81
TGR
281 (source
282 (origin
283 (method git-fetch)
284 (uri (git-reference
285 (url "https://github.com/uoaerg/wavemon.git")
286 (commit (string-append "v" version))))
287 (file-name (git-file-name name version))
288 (sha256
5976d0b0 289 (base32 "109ycwnjjqc2vpnd8b86njfifczlxglnyv4rh2qmbn2i5nw2wryg"))))
0ba0ab81
TGR
290 (build-system gnu-build-system)
291 (arguments
292 `(#:make-flags
293 (list "CC=gcc"
294 ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to Guix's
295 ;; standard --docdir since it's only used as such.
296 (string-append "datadir=" (assoc-ref %outputs "out")
297 "/share/doc/" ,name "-" ,version))
298 #:tests? #f)) ; no tests
299 (native-inputs
300 `(("pkg-config" ,pkg-config)))
301 (inputs
302 `(("libcap" ,libcap)
303 ("libnl" ,libnl)
304 ("ncurses" ,ncurses)))
305 (home-page "https://github.com/uoaerg/wavemon")
306 (synopsis "Wireless network device monitor")
307 (description
308 "Wavemon is a wireless device monitor with an interactive ncurses terminal
309interface. It can display and plot signal and noise levels in real time. It
310also reports packet statistics, device configuration, network parameters, and
311access points and other wireless clients of your wireless network hardware.
312
313Wavemon should work (with varying levels of detail and features) with any device
314supported by the Linux kernel.")
315 ;; Source file headers still say GPL2+, but the authorial intent
316 ;; (from COPYING and the F9 'about' screen) is clearly GPL3+.
317 (license license:gpl3+)))
22a98cda
JN
318
319(define-public rkdeveloptool
320 (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
321 (revision "0"))
322 (package
323 (name "rkdeveloptool")
324 (version (git-version "1.3" revision commit))
325 (source
326 (origin
327 (method git-fetch)
328 (uri (git-reference
329 (url "https://github.com/rockchip-linux/rkdeveloptool.git")
330 (commit commit)))
331 (file-name (git-file-name name version))
332 (sha256
333 (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
334 (build-system gnu-build-system)
335 (native-inputs
336 `(("autoconf" ,autoconf)
337 ("automake" ,automake)
338 ("pkg-config" ,pkg-config)))
339 (inputs
340 `(("libusb" ,libusb)))
341 (home-page "https://github.com/rockchip-linux/rkdeveloptool")
342 (synopsis "Read from and write to RockChicp devices over USB")
343 (description
344 "Rkdeveloptool can read from and write to RockChip devices over USB, such
345as the Pinebook Pro.")
346 (license license:gpl2+))))