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