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