gnu: gnome-tweaks: Update to 3.34.1.
[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>
22df0a1f 4;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
aadd1d24
TGR
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages hardware)
02ee43e4 22 #:use-module (gnu packages admin)
22a98cda 23 #:use-module (gnu packages autotools)
02ee43e4 24 #:use-module (gnu packages bash)
aadd1d24 25 #:use-module (gnu packages compression)
02ee43e4 26 #:use-module (gnu packages check)
febd19da 27 #:use-module (gnu packages cpp)
02ee43e4
BW
28 #:use-module (gnu packages crypto)
29 #:use-module (gnu packages documentation)
5eff4380 30 #:use-module (gnu packages gcc)
aadd1d24
TGR
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages libusb)
33 #:use-module (gnu packages linux)
0ba0ab81 34 #:use-module (gnu packages ncurses)
02ee43e4 35 #:use-module (gnu packages openldap)
aadd1d24 36 #:use-module (gnu packages pkg-config)
02ee43e4
BW
37 #:use-module (gnu packages polkit)
38 #:use-module (gnu packages protobuf)
aadd1d24 39 #:use-module (gnu packages xdisorg)
22df0a1f 40 #:use-module (gnu packages xml)
aadd1d24
TGR
41 #:use-module (gnu packages xorg)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix download)
0ba0ab81 44 #:use-module (guix git-download)
aadd1d24 45 #:use-module ((guix licenses) #:prefix license:)
907b9dc8
TGR
46 #:use-module (guix packages)
47 #:use-module (guix utils))
aadd1d24
TGR
48
49;; This is a module for packages related to physical hardware that don't (yet)
50;; have a more specific home like gps.scm, security-token.scm, &c.
51
52(define-public ddcutil
53 (package
54 (name "ddcutil")
63e4eee9 55 (version "0.9.9")
aadd1d24
TGR
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "https://www.ddcutil.com/tarballs/"
ec756fa5 60 "ddcutil-" version ".tar.gz"))
aadd1d24 61 (sha256
63e4eee9 62 (base32 "0anyxy53k2613hq9glaad16llqlv6iim5p8gz0rs5pnpp8p00dg1"))))
aadd1d24
TGR
63 (build-system gnu-build-system)
64 (native-inputs
65 `(("pkg-config" ,pkg-config)))
66 (inputs
67 `(("eudev" ,eudev)
68 ("glib" ,glib)
69 ("libdrm" ,libdrm) ; enhanced diagnostics
70 ("libusb" ,libusb) ; support USB monitors
71 ("libx11" ,libx11) ; enhanced diagnostics
72 ("libxrandr" ,libxrandr)
73 ("zlib" ,zlib)))
74 (home-page "https://www.ddcutil.com/")
75 (synopsis "Control external monitor settings")
76 (description
77 "ddcutil can query and modify most external monitors' settings, such as
78brightness, colour levels, and input sources. Generally speaking, any setting
79that can be changed by pressing buttons on the monitor can be modified by
80ddcutil.
81
82ddcutil communicates directly with monitors implementing the Monitor Control
83Command Set (@dfn{MCCS}). It usually does so through the the Display Data
84Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
85communicate over USB as per the USB Monitor Control Class Specification.
86
87One particular use case is in colour profile management. Monitor calibration
88is relative to the monitor colour settings currently in effect, e.g. red gain.
89ddcutil allows colour-related settings to be saved at the time a monitor is
90calibrated, and restored when the calibration is applied.")
91 (license (list license:bsd-3 ; FindDDCUtil.cmake
92 license:gpl2+)))) ; everything else
6e8c75b8 93
8fe681b9
BW
94(define-public edid-decode
95 (let ((commit "74b64180d67bb009d8d9ea1b6f18ad41aaa16396") ; 2020-04-22
96 (revision "1"))
97 (package
98 (name "edid-decode")
99 (version (git-version "0.0.0" revision commit))
100 (source
101 (origin
102 (method git-fetch)
103 (file-name (git-file-name name version))
104 (uri (git-reference
105 (url "git://linuxtv.org/edid-decode.git")
106 (commit commit)))
107 (sha256
108 (base32 "0nirp5bza08zj5d8bjgcm0p869hdg3qg3mwa7999pjdrzmn7s2ah"))))
109 (build-system gnu-build-system)
110 (arguments
111 `(#:tests? #f ; No test suite
112 #:make-flags
113 (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
114 "bindir=/bin" "mandir=/share/man")
115 #:phases
116 (modify-phases %standard-phases
117 (add-after 'unpack 'fix-cross-compilation
118 (lambda* (#:key native-inputs target #:allow-other-keys)
119 (when target
120 (substitute* "Makefile"
121 (("\\$\\(CXX\\)")
122 (string-append target "-g++"))))
123 #t))
124 (delete 'configure))))
125 (home-page "https://git.linuxtv.org/edid-decode.git/")
126 (synopsis "Decode @dfn{EDID} data in human-readable format")
127 (description "edid-decode decodes @dfn{EDID} monitor description data in
128human-readable format and checks if it conforms to the standards.")
129 (license license:expat))))
130
5eff4380
TGR
131;; Distinct from memtest86, which is obsolete.
132(define-public memtest86+
133 (package
134 (name "memtest86+")
135 ;; Update the description when/if UEFI support is released.
136 (version "5.01")
137 (source
138 (origin
139 (method url-fetch)
140 (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-"
141 version ".tar.gz"))
142 (sha256
143 (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l"))))
144 (build-system gnu-build-system)
145 (arguments
146 `(#:system "i686-linux" ; the result runs outside of any OS
147 #:tests? #f ; no way to test this
148 #:phases
149 (modify-phases %standard-phases
150 (delete 'configure) ; no configure script
151 (replace 'build
152 ;; The default 'make all' does wonderful things, like scp(1) a file to
153 ;; 192.168.0.12. Build the bootable images and nothing more.
154 (lambda _
155 (invoke "make"
156 "memtest" ; ELF executable
157 "memtest.bin"))) ; DOS/MBR boot sector
158 (replace 'install
159 (lambda* (#:key outputs #:allow-other-keys)
160 (let* ((out (assoc-ref outputs "out"))
161 (lib (string-append out "/lib/memtest86+"))
162 (doc (string-append out "/share/doc/memtest86+-" ,version)))
163 (for-each
164 (lambda (file)
165 (install-file file lib))
166 (list "memtest"
167 "memtest.bin"))
168 (for-each
169 (lambda (file)
170 (install-file file doc))
171 (list "FAQ"
fb541251
TGR
172 "README"))
173 #t))))))
5eff4380
TGR
174 (native-inputs
175 ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors.
176 `(("gcc" ,gcc-4.9)))
177 (supported-systems (list "i686-linux" "x86_64-linux"))
178 (home-page "https://www.memtest.org/")
179 (synopsis "Thorough real-mode memory tester")
180 (description
181 "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It
182repeatedly writes different patterns to all memory locations, reads them back
183again, and verifies whether the result is the same as what was written. This
184can help debug even intermittent and non-deterministic errors.
185
186It runs independently of any operating system, at computer boot-up, so that it
187can scan as much of your RAM as possible for hardware defects.
188
189Memtest86+ cannot currently be used on computers booted with UEFI.")
190 (license license:gpl2)))
191
fb541251
TGR
192(define-public memtester
193 (package
194 (name "memtester")
b6ad6089 195 (version "4.5.0")
fb541251
TGR
196 (source
197 (origin
198 (method url-fetch)
199 ;; Even the latest release is available under 'old-versions/'.
200 (uri (string-append "http://pyropus.ca/software/memtester/old-versions/"
201 "memtester-" version ".tar.gz"))
202 (sha256
b6ad6089 203 (base32 "0dxfwayns3hjjplkxkpkm1409lmjlpi4chcrahcvdbnl0q6jpmcf"))))
fb541251
TGR
204 (build-system gnu-build-system)
205 (arguments
206 `(#:make-flags
907b9dc8 207 (list ,(string-append "CC=" (cc-for-target)))
fb541251
TGR
208 #:phases
209 (modify-phases %standard-phases
210 (replace 'configure
211 ;; This is a home-brewed configuration system where the cc/ld command
212 ;; lines are stored in one-line files.
213 (lambda* (#:key outputs #:allow-other-keys)
214 (let* ((out (assoc-ref outputs "out")))
215 (substitute* (list "conf-cc" "conf-ld")
216 (("^cc") "gcc"))
217 (substitute* "Makefile"
218 (("(INSTALLPATH.*=).*" _ assignment)
219 (string-append assignment out)))
220 #t)))
221 (replace 'check
222 ;; There is no test suite. Test some RAM for a single iteration.
223 (lambda _
224 (invoke "./memtester" "64K" "1"))))))
225 (home-page "http://pyropus.ca/software/memtester/")
226 (synopsis "User-space memory subsystem tester")
227 (description
228 "Memtester stress-tests the memory subsystem of your operating system and
229computer. It repeatedly writes different patterns to all memory locations,
230reads them back again, and verifies whether the result is the same as what was
231written. This can help debug even intermittent and non-deterministic errors.
232
233Memtester runs entirely in user space. This means that you don't need to reboot
234to test your memory, but also that it's not possible to test all of the RAM
235installed in the system.
236
237It can also be told to test memory starting at a particular physical address.")
238 (license license:gpl2)))
239
6e8c75b8
TGR
240(define-public msr-tools
241 (package
242 (name "msr-tools")
243 (version "1.3")
244 (source
245 (origin
246 (method url-fetch)
247 (uri (string-append "https://01.org/sites/default/files/downloads/"
248 name "/" name "-" version ".zip"))
249 (sha256
250 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
251 (build-system gnu-build-system)
252 (arguments
253 `(#:make-flags
254 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
255 #:phases
256 (modify-phases %standard-phases
257 (delete 'configure) ; no configure script
258 (add-before 'install 'create-output-directory
259 (lambda* (#:key outputs #:allow-other-keys)
260 ;; 'make install' assumes that sbindir exists.
261 (let* ((out (assoc-ref outputs "out"))
262 (sbin (string-append out "/sbin")))
263 (mkdir-p sbin)
264 #t))))
265 #:tests? #f)) ; no test suite
266 (native-inputs
267 `(("unzip" ,unzip)))
268 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
269 (supported-systems (list "i686-linux" "x86_64-linux"))
270 (home-page "https://01.org/msr-tools/")
271 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
272 (description
273 "The MSR Tools project provides console utilities to directly access the
274Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
275
276@itemize
277@item @command{cpuid}: show identification and feature information of any CPU
278@item @command{rdmsr}: read MSRs from any CPU or all CPUs
279@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
280@end itemize
281
282These tools can be used to query and modify certain low-level CPU parameters,
283such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
284
285MSR addresses differ (greatly) between processors, and any such modification can
286be dangerous and may void your CPU or system board's warranty.")
287 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+
0ba0ab81
TGR
288
289(define-public wavemon
290 (package
291 (name "wavemon")
2666bb81 292 (version "0.9.2")
0ba0ab81
TGR
293 (source
294 (origin
295 (method git-fetch)
296 (uri (git-reference
b0e7b699 297 (url "https://github.com/uoaerg/wavemon")
0ba0ab81
TGR
298 (commit (string-append "v" version))))
299 (file-name (git-file-name name version))
300 (sha256
2666bb81
TGR
301 (base32 "0y984wm03lzqf7bk06a07mw7d1fzjsp9x7zxcvlx4xqmv7wlgb29"))
302 (patches
303 (list
304 ;; Two upstream commits required to find the correct <ncurses.h>.
305 (origin
306 (method url-fetch)
307 (uri (string-append
308 "https://github.com/uoaerg/wavemon/commit/"
309 "ce7f9c4da90767bb50e4b80cdb3cee61264d8d12.patch"))
310 (sha256
311 (base32 "04b4qbsa5l0jr41dkj0c8yw74lm8z8b50nw1iwas6hnzq41dwdm3")))
312 (origin
313 (method url-fetch)
314 (uri (string-append
315 "https://github.com/uoaerg/wavemon/commit/"
316 "31e3def1c7332ad830bd966e7d21b343b4f2da54.patch"))
317 (sha256
318 (base32 "0kyv3sbkv9hl8b88xnk6bq550axh9wzfjlhp3jbvqd4fqf7663br")))))))
0ba0ab81
TGR
319 (build-system gnu-build-system)
320 (arguments
321 `(#:make-flags
322 (list "CC=gcc"
323 ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to Guix's
324 ;; standard --docdir since it's only used as such.
325 (string-append "datadir=" (assoc-ref %outputs "out")
326 "/share/doc/" ,name "-" ,version))
327 #:tests? #f)) ; no tests
328 (native-inputs
329 `(("pkg-config" ,pkg-config)))
330 (inputs
331 `(("libcap" ,libcap)
332 ("libnl" ,libnl)
333 ("ncurses" ,ncurses)))
334 (home-page "https://github.com/uoaerg/wavemon")
335 (synopsis "Wireless network device monitor")
336 (description
337 "Wavemon is a wireless device monitor with an interactive ncurses terminal
338interface. It can display and plot signal and noise levels in real time. It
339also reports packet statistics, device configuration, network parameters, and
340access points and other wireless clients of your wireless network hardware.
341
342Wavemon should work (with varying levels of detail and features) with any device
343supported by the Linux kernel.")
344 ;; Source file headers still say GPL2+, but the authorial intent
345 ;; (from COPYING and the F9 'about' screen) is clearly GPL3+.
346 (license license:gpl3+)))
22a98cda
JN
347
348(define-public rkdeveloptool
349 (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
350 (revision "0"))
351 (package
352 (name "rkdeveloptool")
353 (version (git-version "1.3" revision commit))
354 (source
355 (origin
356 (method git-fetch)
357 (uri (git-reference
b0e7b699 358 (url "https://github.com/rockchip-linux/rkdeveloptool")
22a98cda
JN
359 (commit commit)))
360 (file-name (git-file-name name version))
361 (sha256
362 (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
363 (build-system gnu-build-system)
364 (native-inputs
365 `(("autoconf" ,autoconf)
366 ("automake" ,automake)
367 ("pkg-config" ,pkg-config)))
368 (inputs
369 `(("libusb" ,libusb)))
370 (home-page "https://github.com/rockchip-linux/rkdeveloptool")
371 (synopsis "Read from and write to RockChicp devices over USB")
372 (description
373 "Rkdeveloptool can read from and write to RockChip devices over USB, such
374as the Pinebook Pro.")
375 (license license:gpl2+))))
22df0a1f
BW
376
377(define-public libqb
378 (package
379 (name "libqb")
380 ;; NOTE: We are using a Release Candidate version (for 2.0) here because
381 ;; of the linker issues with the previous release.
382 (version "1.9.1")
383 (source (origin
384 (method url-fetch)
385 (uri (string-append
386 "https://github.com/ClusterLabs/libqb/releases/download/v"
387 version "/libqb-" version ".tar.xz"))
388 (sha256
389 (base32
390 "008vvw504kh40br5v2xkqavnp9vpmjvf768faqzv1d00fd53ingn"))))
391 (build-system gnu-build-system)
392 (native-inputs
393 `(("pkg-config" ,pkg-config)
394 ("xmllint" ,libxml2)))
395 (home-page "https://clusterlabs.github.io/libqb/")
396 (synopsis "Library providing high performance logging, tracing, ipc, and poll")
397 (description "Libqb is a library with the primary purpose of providing
398high-performance, reusable features for client-server architecture, such as
399logging, tracing, inter-process communication (IPC), and polling. Libqb is
400not intended to be an all-encompassing library, but instead provide focused
401APIs that are highly tuned for maximum performance for client-server
402applications.")
403 (license license:lgpl2.1)))
02ee43e4
BW
404
405(define-public usbguard
406 (package
407 (name "usbguard")
38ebe227 408 (version "0.7.8")
02ee43e4
BW
409 (source (origin
410 (method url-fetch)
411 (uri (string-append
412 "https://github.com/USBGuard/usbguard/releases/download/usbguard-"
413 version "/usbguard-" version ".tar.gz"))
414 (file-name (git-file-name name version))
415 (sha256
38ebe227 416 (base32 "1il5immqfxh2cj8wn1bfk7l42inflzgjf07yqprpz7r3lalbxc25"))))
02ee43e4
BW
417 (build-system gnu-build-system)
418 (arguments
419 `(#:phases
420 (modify-phases %standard-phases
f96ddb60
BW
421 (add-after 'unpack 'patch-build-scripts
422 (lambda* (#:key inputs #:allow-other-keys)
423 (substitute* "configure"
424 (("/usr/include/catch")
425 (string-append (assoc-ref inputs "catch") "/include")))
02ee43e4 426 ;; Do not create log directory.
f96ddb60 427 (substitute* "Makefile.in" ((".*/log/usbguard.*") ""))
02ee43e4 428 ;; Disable LDAP tests: they use 'sudo'.
f96ddb60
BW
429 (substitute* "src/Tests/Makefile.in"
430 (("\\$\\(am__append_2\\)") ""))
02ee43e4
BW
431 #t))
432 (add-after 'install 'delete-static-library
433 (lambda* (#:key outputs #:allow-other-keys)
434 ;; It can't be direclty disabled since it's needed for the tests.
435 (delete-file (string-append (assoc-ref outputs "out")
436 "/lib/libusbguard.a"))
437 #t))
438 (add-after 'install 'install-zsh-completion
439 (lambda* (#:key outputs #:allow-other-keys)
440 (let* ((out (assoc-ref outputs "out"))
441 (site-functions
442 (string-append out "/share/zsh/site-functions")))
443 (mkdir-p site-functions)
444 (copy-file "scripts/usbguard-zsh-completion"
445 (string-append site-functions "/_usbguard"))
446 #t))))
447 #:make-flags
448 (list (string-append "BASH_COMPLETION_DIR="
449 (assoc-ref %outputs "out")
450 "/etc/bash_completion.d"))
451 #:configure-flags
452 (list
453 "--localstatedir=/var"
02ee43e4
BW
454 "--enable-systemd=no"
455 "--with-ldap"
456 "--with-dbus"
457 "--with-polkit")))
458 (inputs
459 `(("audit" ,audit)
460 ("catch" ,catch-framework)
461 ("dbus-glib" ,dbus-glib)
462 ("ldap" ,openldap)
463 ("libcap-ng" ,libcap-ng)
464 ("libseccomp" ,libseccomp)
465 ("libsodium" ,libsodium)
febd19da 466 ("pegtl" ,pegtl)
02ee43e4
BW
467 ("polkit" ,polkit)
468 ("protobuf" ,protobuf)
469 ("libqb" ,libqb)))
470 (native-inputs
471 `(("asciidoc" ,asciidoc)
02ee43e4
BW
472 ("bash-completion" ,bash-completion)
473 ("gdbus-codegen" ,glib "bin")
474 ("umockdev" ,umockdev)
475 ("xmllint" ,libxml2)
476 ("xsltproc" ,libxslt)
477 ("pkg-config" ,pkg-config)))
478 (home-page "https://usbguard.github.io")
479 (synopsis "Helps to protect your computer against rogue USB devices (a.k.a. BadUSB)")
480 (description "USBGuard is a software framework for implementing USB device
481authorization policies (what kind of USB devices are authorized) as well as
482method of use policies (how a USB device may interact with the system).
483Simply put, it is a USB device whitelisting tool.")
484 (license license:gpl2)))