gnu: pegtl: Update to 3.2.2.
[jackhill/guix/guix.git] / gnu / packages / hardware.scm
CommitLineData
aadd1d24 1;;; GNU Guix --- Functional package management for GNU
e1f223c5 2;;; Copyright © 2018–2021 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>
7c3cefde 7;;; Copyright © 2021 Denis Carikli <GNUtoo@cyberdimension.org>
7ba5ce94
RG
8;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
9;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
0cd05b5e 10;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
fb856885 11;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com>
651765ec
ZZ
12;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
13;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
aadd1d24
TGR
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages hardware)
a0fd9a35 31 #:use-module (gnu packages)
02ee43e4 32 #:use-module (gnu packages admin)
22a98cda 33 #:use-module (gnu packages autotools)
02ee43e4 34 #:use-module (gnu packages bash)
aadd1d24 35 #:use-module (gnu packages compression)
02ee43e4 36 #:use-module (gnu packages check)
febd19da 37 #:use-module (gnu packages cpp)
02ee43e4 38 #:use-module (gnu packages crypto)
34861ac8 39 #:use-module (gnu packages curl)
02ee43e4 40 #:use-module (gnu packages documentation)
7ba5ce94 41 #:use-module (gnu packages flex)
5eff4380 42 #:use-module (gnu packages gcc)
192cb790 43 #:use-module (gnu packages gettext)
aadd1d24 44 #:use-module (gnu packages glib)
ec732a46 45 #:use-module (gnu packages gtk)
aadd1d24
TGR
46 #:use-module (gnu packages libusb)
47 #:use-module (gnu packages linux)
0ba0ab81 48 #:use-module (gnu packages ncurses)
02ee43e4 49 #:use-module (gnu packages openldap)
7c3cefde 50 #:use-module (gnu packages pciutils)
192cb790 51 #:use-module (gnu packages perl)
aadd1d24 52 #:use-module (gnu packages pkg-config)
02ee43e4
BW
53 #:use-module (gnu packages polkit)
54 #:use-module (gnu packages protobuf)
192cb790 55 #:use-module (gnu packages python)
7c3cefde
DGC
56 #:use-module (gnu packages python-web)
57 #:use-module (gnu packages python-xyz)
9c172059 58 #:use-module (gnu packages qt)
34861ac8 59 #:use-module (gnu packages tls)
7ba5ce94 60 #:use-module (gnu packages virtualization)
34861ac8 61 #:use-module (gnu packages web)
aadd1d24 62 #:use-module (gnu packages xdisorg)
22df0a1f 63 #:use-module (gnu packages xml)
aadd1d24 64 #:use-module (gnu packages xorg)
9c172059 65 #:use-module (guix build-system cmake)
aadd1d24 66 #:use-module (guix build-system gnu)
0cd05b5e 67 #:use-module (guix build-system meson)
7c3cefde 68 #:use-module (guix build-system python)
aadd1d24 69 #:use-module (guix download)
b1cf1d44 70 #:use-module (guix gexp)
0ba0ab81 71 #:use-module (guix git-download)
7c3cefde 72 #:use-module (guix svn-download)
aadd1d24 73 #:use-module ((guix licenses) #:prefix license:)
907b9dc8 74 #:use-module (guix packages)
651765ec
ZZ
75 #:use-module (guix utils)
76 #:use-module (srfi srfi-1))
aadd1d24
TGR
77
78;; This is a module for packages related to physical hardware that don't (yet)
79;; have a more specific home like gps.scm, security-token.scm, &c.
80
7ba5ce94
RG
81(define-public hwinfo
82 (package
83 (name "hwinfo")
ebb9efac 84 (version "21.80")
7ba5ce94
RG
85 (home-page "https://github.com/openSUSE/hwinfo")
86 (source
87 (origin
88 (method git-fetch)
89 (uri
90 (git-reference
91 (url home-page)
92 (commit version)))
93 (file-name (git-file-name name version))
94 (sha256
ebb9efac 95 (base32 "07058vjqdcd3la8y4b92f7fvcqxvmw1p0q4lg5kcn85pvbbg52ag"))
7ba5ce94
RG
96 (modules
97 '((guix build utils)))
98 (snippet
99 `(begin
100 ;; Remove git2log program file.
101 (delete-file "git2log")
102 ;; Remove variables that depends on git2log.
103 (substitute* "Makefile"
104 (("GIT2LOG.*\\:=.*$") "")
105 (("GITDEPS.*\\:=.*$") "")
106 (("BRANCH.*\\:=.*$") ""))
107 ;; Create version file.
108 (call-with-output-file "VERSION"
109 (lambda (port)
258a27ee 110 (format port ,version)))))))
7ba5ce94
RG
111 (build-system gnu-build-system)
112 (outputs '("out" "dev" "doc"))
113 (arguments
114 `(#:tests? #f ; no test-suite available
115 #:phases
116 (modify-phases %standard-phases
117 (add-after 'unpack 'patch
118 (lambda* (#:key outputs #:allow-other-keys)
119 (let* ((out (assoc-ref outputs "out"))
120 (dev (assoc-ref outputs "dev"))
121 (doc (assoc-ref outputs "doc"))
122 (incl-dir (string-append dev "/include"))
123 (lib-dir (string-append dev "/lib"))
124 (sbin-dir (string-append out "/sbin"))
125 (share-dir (string-append out "/share"))
126 (doc-dir (string-append doc "/share/doc")))
127 ;; Generate HTML documentation in the output "doc".
128 (mkdir-p doc-dir)
129 (substitute* "doc/libhd.doxy"
130 (("OUTPUT_DIRECTORY.*=.*libhd")
131 (string-append "OUTPUT_DIRECTORY = " doc-dir "/libhd")))
132 ;; Correct values of the version and install directories.
133 (substitute* "Makefile"
134 (("VERSION.*\\:=.*$")
135 (string-append "VERSION := " ,version "\n"))
136 (("LIBDIR.*\\?=.*$")
137 (string-append "LIBDIR ?= " lib-dir "\n"))
138 (("/usr/include") incl-dir)
139 (("/(usr|var)/(lib|lib64)") lib-dir)
140 (("/usr/sbin") sbin-dir)
141 (("/usr/share") share-dir)
142 (("\\$\\(DESTDIR\\)/sbin ") ""))
143 ;; Add output "dev" to the run-path.
144 (substitute* "Makefile.common"
145 (("-Lsrc")
146 (string-append "-Lsrc " "-Wl,-rpath=" lib-dir)))
147 ;; Correct program name of the lexical analyzer.
148 (substitute* "src/isdn/cdb/Makefile"
149 (("lex isdn_cdb.lex") "flex isdn_cdb.lex"))
150 ;; Patch pkgconfig file to point to output "dev".
151 (substitute* "hwinfo.pc.in"
152 (("/usr") dev)))))
153 (delete 'configure)
154 (replace 'build
155 (lambda _
156 (setenv "CC" ,(cc-for-target))
157 (invoke "make" "shared")
158 (invoke "make" "doc")))
159 (add-after 'install 'install-manpages
160 (lambda* (#:key outputs #:allow-other-keys)
161 (let* ((out (assoc-ref outputs "out"))
162 (man-dir (string-append out "/share/man"))
163 (man1-dir (string-append man-dir "/man1"))
164 (man8-dir (string-append man-dir "/man8")))
165 (for-each
166 (lambda (x) (install-file x man1-dir))
167 (find-files "doc" "\\.1$"))
168 (for-each
169 (lambda (y) (install-file y man8-dir))
170 (find-files "doc" "\\.8$"))))))))
171 (native-inputs
8394619b 172 (list doxygen flex perl pkg-config))
7ba5ce94
RG
173 (inputs
174 `(("libx86emu" ,libx86emu)
175 ("util-linux:lib" ,util-linux "lib")))
176 (synopsis "Hardware information tool")
177 (description "HwInfo is used to probe for the hardware present in the system.
178It can be used to generate a system overview log which can be later used for
179support.")
180 (license license:gpl2+)))
181
aadd1d24
TGR
182(define-public ddcutil
183 (package
184 (name "ddcutil")
e1f223c5 185 (version "1.1.0")
aadd1d24
TGR
186 (source
187 (origin
188 (method url-fetch)
189 (uri (string-append "https://www.ddcutil.com/tarballs/"
ec756fa5 190 "ddcutil-" version ".tar.gz"))
aadd1d24 191 (sha256
e1f223c5 192 (base32 "19kkwb9ijzn6ya3mvjanggh1c96fcc0lkbk7xnyi2qp6wsr4nhxp"))))
aadd1d24
TGR
193 (build-system gnu-build-system)
194 (native-inputs
8394619b 195 (list pkg-config))
aadd1d24 196 (inputs
8394619b
LC
197 (list eudev
198 glib
199 libdrm ; enhanced diagnostics
200 libusb ; support USB monitors
201 libx11 ; enhanced diagnostics
202 libxrandr
203 zlib))
aadd1d24
TGR
204 (home-page "https://www.ddcutil.com/")
205 (synopsis "Control external monitor settings")
206 (description
207 "ddcutil can query and modify most external monitors' settings, such as
208brightness, colour levels, and input sources. Generally speaking, any setting
209that can be changed by pressing buttons on the monitor can be modified by
210ddcutil.
211
212ddcutil communicates directly with monitors implementing the Monitor Control
213Command Set (@dfn{MCCS}). It usually does so through the the Display Data
214Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
215communicate over USB as per the USB Monitor Control Class Specification.
216
217One particular use case is in colour profile management. Monitor calibration
218is relative to the monitor colour settings currently in effect, e.g. red gain.
219ddcutil allows colour-related settings to be saved at the time a monitor is
220calibrated, and restored when the calibration is applied.")
221 (license (list license:bsd-3 ; FindDDCUtil.cmake
222 license:gpl2+)))) ; everything else
6e8c75b8 223
9c172059
BW
224(define-public ddcui
225 (package
226 (name "ddcui")
227 (version "0.1.2")
228 (source
229 (origin
230 (method git-fetch)
231 (uri (git-reference
232 (url "https://github.com/rockowitz/ddcui")
233 (commit (string-append "v" version))))
234 (file-name (git-file-name name version))
235 (sha256
236 (base32 "0myma1zw6dlygv3xbin662d91zcnwss10syf12q2fppkrd8qdgqf"))))
237 (build-system cmake-build-system)
238 (arguments
239 '(#:tests? #f)) ; No test suite
240 (native-inputs
8394619b 241 (list pkg-config qttools))
9c172059 242 (inputs
8394619b 243 (list ddcutil glib qtbase-5))
9c172059
BW
244 (home-page "https://www.ddcutil.com/")
245 (synopsis "Graphical user interface for ddcutil")
246 (description "ddcui is a graphical user interface for ddcutil, implemented
247using Qt. It provide a dynamic way to inspect and configure external monitors
248through the Display Data Channel Command Interface (@dfn{DDC/CI}) protocol.")
249 (license (list license:gpl2+))))
250
8fe681b9
BW
251(define-public edid-decode
252 (let ((commit "74b64180d67bb009d8d9ea1b6f18ad41aaa16396") ; 2020-04-22
253 (revision "1"))
254 (package
255 (name "edid-decode")
256 (version (git-version "0.0.0" revision commit))
257 (source
258 (origin
259 (method git-fetch)
260 (file-name (git-file-name name version))
261 (uri (git-reference
262 (url "git://linuxtv.org/edid-decode.git")
263 (commit commit)))
264 (sha256
265 (base32 "0nirp5bza08zj5d8bjgcm0p869hdg3qg3mwa7999pjdrzmn7s2ah"))))
266 (build-system gnu-build-system)
267 (arguments
268 `(#:tests? #f ; No test suite
269 #:make-flags
270 (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
271 "bindir=/bin" "mandir=/share/man")
272 #:phases
273 (modify-phases %standard-phases
274 (add-after 'unpack 'fix-cross-compilation
275 (lambda* (#:key native-inputs target #:allow-other-keys)
276 (when target
277 (substitute* "Makefile"
278 (("\\$\\(CXX\\)")
279 (string-append target "-g++"))))
280 #t))
281 (delete 'configure))))
282 (home-page "https://git.linuxtv.org/edid-decode.git/")
283 (synopsis "Decode @dfn{EDID} data in human-readable format")
284 (description "edid-decode decodes @dfn{EDID} monitor description data in
285human-readable format and checks if it conforms to the standards.")
286 (license license:expat))))
287
7c3cefde
DGC
288(define-public h-client
289 (let ((version "0.0a0")
290 (revision 138))
291 (package
292 (name "h-client")
293 (version (string-append version "-" (number->string revision)))
294 (source
295 (origin
296 (method svn-fetch)
297 (uri
298 (svn-reference
299 (url "https://svn.savannah.nongnu.org/svn/h-client/trunk/h-client")
300 (revision revision)))
301 (file-name (git-file-name name version))
302 (sha256
303 (base32 "1pdd2qhyaa5vh7z4rkpwjlby1flkwhzmp8zlglalx5y5sv95l4kp"))))
304 (build-system python-build-system)
305 (arguments
306 `(#:python ,python-2
307 ;; Tests depends on /etc/os-release which does not exist in the
308 ;; build container.
309 #:tests? #f))
310 (inputs
8394619b 311 (list python-2 python2-pycurl python2-pygtk pciutils usbutils))
7c3cefde
DGC
312 (synopsis "Graphical client for the h-node hardware database
313project")
314 (description
315 "The h-node project (https://www.h-node.org) aims to build a database of
316hardware that works with fully free operating systems.
317h-client is a GTK+ graphical client that is able to retrieves information on
318the hardware inside the computer it's running on, and on peripherals connected
319to it, and help you submit that information to the h-node project along with
320whether the hardware works with a fully free operating system or not.")
321 (home-page "https://savannah.nongnu.org/projects/h-client/")
322 (license license:gpl3+))))
323
879a5cb7
JK
324(define-public headsetcontrol
325 (package
326 (name "headsetcontrol")
327 (version "2.6")
328 (source
329 (origin
330 (method git-fetch)
331 (uri (git-reference
332 (url "https://github.com/Sapd/HeadsetControl")
333 (commit version)))
334 (file-name (git-file-name name version))
335 (sha256
336 (base32 "0a7zimzi71416pmn6z0l1dn1c2x8p702hkd0k6da9rsznff85a88"))))
337 (build-system cmake-build-system)
338 (inputs
339 (list hidapi))
340 (home-page "https://github.com/Sapd/HeadsetControl")
341 (synopsis "Sidetone and Battery status for USB headsets")
342 (description
343 "Headsetcontrol is a tool to control certain aspects of USB-connected
344headsets. Currently, support is provided for adjusting sidetone, getting
345battery state, controlling LEDs, and setting the inactive time.")
346 (license license:gpl3+)))
347
fb856885
JK
348(define-public hueplusplus
349 (package
350 (name "hueplusplus")
351 (version "1.1.0")
352 (source
353 (origin
354 (method git-fetch)
355 (uri (git-reference
356 (url "https://github.com/enwi/hueplusplus")
357 (commit (string-append "v" version))))
358 (file-name (git-file-name name version))
359 (sha256
360 (base32 "1jy8m2a0h0kf0aw8jbniz069q9j7cx67b1zlv2vz1ymq921qk0pm"))
361 (patches
362 (search-patches "hueplusplus-mbedtls.patch"))))
363 (build-system cmake-build-system)
364 (arguments
365 `(#:tests? #f)) ;; Tests require Google's gtest and gmock
366 (inputs
367 (list mbedtls-apache))
368 (synopsis "C++ library to control Philips Hue lights")
369 (description "Hueplusplus is a library for controlling Philips Hue lights.
370Features:
371
372@itemize
373@item find bridges with SSDP or set an ip manually
374@item all common light functions (brightness, color, temperature)
375@item extended @code{alert()} functions, which alert in a specific
376color (good for notifications)
377@item supports sensors, rules, groups, scenes and schedules
378@item streaming with entertainment mode
379@item documented with doxygen
380@end itemize")
381 (home-page "https://github.com/enwi/hueplusplus")
382 (license license:lgpl3+)))
383
a8b70525
TGR
384(define-public i7z
385 (let ((revision "0")
386 (commit "1a41ff13db747e962456ddbb5ccb2b7fc43ca0cb"))
387 (package
388 (name "i7z")
389 (version (git-version "0.28" revision commit))
390 (source
391 (origin
392 (method git-fetch)
393 (uri (git-reference
394 (url "https://github.com/afontenot/i7z")
395 (commit commit)))
396 (file-name (git-file-name name version))
397 (sha256
398 (base32 "0jxm63a8y1mfl1sa4mzzfs3bgnym6achj1yc0jglmp05xal16lm1"))
a0fd9a35
TGR
399 (patches
400 (search-patches "i7z-gcc-10.patch"))
a8b70525
TGR
401 (modules '((guix build utils)))
402 (snippet
403 '(begin
404 (for-each delete-file-recursively
405 (list "src/GUI"
406 "src/perfmon-i7z"
407 "scripts"))))))
408 (build-system gnu-build-system)
409 (arguments
410 `(#:make-flags
411 (list (string-append "prefix=" (assoc-ref %outputs "out"))
412 (string-append "CC=" ,(cc-for-target)))
413 #:tests? #f ; no test suite
414 #:phases
415 (modify-phases %standard-phases
416 (delete 'configure)))) ; no configure script
417 (inputs
8394619b 418 (list ncurses))
a8b70525
TGR
419 (home-page "https://github.com/afontenot/i7z")
420 (synopsis "Thermal and C-state reporting on older Intel Core CPUs")
421 (description
422 "The @command{i7z} utility accurately measures the current frequency
423and temperature of older Intel Core (i3, i5, and i7) processors including the
424Nehalem, Sandy Bridge, and Ivy Bridge generations. Reliable support for newer
425CPUs is not guaranteed, as this package has not seen significant development
426since 2013.
427
428If your processor is supported, you'll get detailed reports on Turbo Boost and
429clock multipliers, core voltage, and time spent in different C-states. This
430information can be viewed in real time and/or logged to a file.")
2db86250 431 (supported-systems (list "x86_64-linux"))
a8b70525
TGR
432 (license license:gpl2))))
433
192cb790
LLB
434(define-public libsmbios
435 (package
436 (name "libsmbios")
437 (version "2.4.3")
438 (source
439 (origin
440 (method git-fetch)
441 (uri
442 (git-reference
443 (url (string-append "https://github.com/dell/" name))
444 (commit (string-append "v" version))))
445 (file-name (git-file-name name version))
446 (sha256
447 (base32 "0krwwydyvb9224r884y1mlmzyxhlfrcqw73vi1j8787rl0gl5a2i"))))
448 (build-system gnu-build-system)
449 (native-inputs
450 `(("autoconf" ,autoconf)
451 ("automake" ,automake)
452 ("gettext" ,gettext-minimal)
453 ("libtool" ,libtool)
454 ("pkg-config" ,pkg-config)
455 ("perl" ,perl)
456 ("python" ,python)))
457 (inputs
8394619b 458 (list libxml2))
192cb790
LLB
459 (arguments
460 `(#:phases
461 (modify-phases %standard-phases
462 (replace 'bootstrap
463 (lambda _ (invoke "autoreconf" "-vfi"))))))
464 (synopsis "Library for interacting with Dell SMBIOS tables")
465 (description
466 "libsmbios provides a library to interface with the SMBIOS tables. It
467also provides extensions for proprietary methods of interfacing with Dell
468specific SMBIOS tables.")
469 (home-page "https://github.com/dell/libsmbios")
470 (license
db74cc6a 471 (list license:osl2.1 license:gpl2+ license:bsd-3 license:boost1.0))))
192cb790 472
5eff4380
TGR
473;; Distinct from memtest86, which is obsolete.
474(define-public memtest86+
475 (package
476 (name "memtest86+")
477 ;; Update the description when/if UEFI support is released.
478 (version "5.01")
479 (source
480 (origin
481 (method url-fetch)
482 (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-"
483 version ".tar.gz"))
484 (sha256
485 (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l"))))
486 (build-system gnu-build-system)
487 (arguments
488 `(#:system "i686-linux" ; the result runs outside of any OS
489 #:tests? #f ; no way to test this
490 #:phases
491 (modify-phases %standard-phases
492 (delete 'configure) ; no configure script
493 (replace 'build
494 ;; The default 'make all' does wonderful things, like scp(1) a file to
495 ;; 192.168.0.12. Build the bootable images and nothing more.
496 (lambda _
497 (invoke "make"
498 "memtest" ; ELF executable
499 "memtest.bin"))) ; DOS/MBR boot sector
500 (replace 'install
501 (lambda* (#:key outputs #:allow-other-keys)
502 (let* ((out (assoc-ref outputs "out"))
503 (lib (string-append out "/lib/memtest86+"))
504 (doc (string-append out "/share/doc/memtest86+-" ,version)))
505 (for-each
506 (lambda (file)
507 (install-file file lib))
508 (list "memtest"
509 "memtest.bin"))
510 (for-each
511 (lambda (file)
512 (install-file file doc))
513 (list "FAQ"
fb541251
TGR
514 "README"))
515 #t))))))
5eff4380
TGR
516 (native-inputs
517 ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors.
8394619b 518 (list gcc-4.9))
5eff4380
TGR
519 (supported-systems (list "i686-linux" "x86_64-linux"))
520 (home-page "https://www.memtest.org/")
521 (synopsis "Thorough real-mode memory tester")
522 (description
523 "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It
524repeatedly writes different patterns to all memory locations, reads them back
525again, and verifies whether the result is the same as what was written. This
526can help debug even intermittent and non-deterministic errors.
527
528It runs independently of any operating system, at computer boot-up, so that it
529can scan as much of your RAM as possible for hardware defects.
530
531Memtest86+ cannot currently be used on computers booted with UEFI.")
532 (license license:gpl2)))
533
fb541251
TGR
534(define-public memtester
535 (package
536 (name "memtester")
6fee3239 537 (version "4.5.1")
fb541251
TGR
538 (source
539 (origin
540 (method url-fetch)
541 ;; Even the latest release is available under 'old-versions/'.
542 (uri (string-append "http://pyropus.ca/software/memtester/old-versions/"
543 "memtester-" version ".tar.gz"))
544 (sha256
6fee3239 545 (base32 "0issrasdihav8jgsqb49cfyj0v564z8k9lyg2jrq9h3n4lwc4pqw"))))
fb541251
TGR
546 (build-system gnu-build-system)
547 (arguments
548 `(#:make-flags
907b9dc8 549 (list ,(string-append "CC=" (cc-for-target)))
fb541251
TGR
550 #:phases
551 (modify-phases %standard-phases
552 (replace 'configure
553 ;; This is a home-brewed configuration system where the cc/ld command
554 ;; lines are stored in one-line files.
555 (lambda* (#:key outputs #:allow-other-keys)
556 (let* ((out (assoc-ref outputs "out")))
557 (substitute* (list "conf-cc" "conf-ld")
558 (("^cc") "gcc"))
559 (substitute* "Makefile"
560 (("(INSTALLPATH.*=).*" _ assignment)
561 (string-append assignment out)))
562 #t)))
563 (replace 'check
564 ;; There is no test suite. Test some RAM for a single iteration.
565 (lambda _
566 (invoke "./memtester" "64K" "1"))))))
567 (home-page "http://pyropus.ca/software/memtester/")
568 (synopsis "User-space memory subsystem tester")
569 (description
570 "Memtester stress-tests the memory subsystem of your operating system and
571computer. It repeatedly writes different patterns to all memory locations,
572reads them back again, and verifies whether the result is the same as what was
573written. This can help debug even intermittent and non-deterministic errors.
574
575Memtester runs entirely in user space. This means that you don't need to reboot
576to test your memory, but also that it's not possible to test all of the RAM
577installed in the system.
578
579It can also be told to test memory starting at a particular physical address.")
580 (license license:gpl2)))
581
6e8c75b8
TGR
582(define-public msr-tools
583 (package
584 (name "msr-tools")
585 (version "1.3")
586 (source
587 (origin
588 (method url-fetch)
589 (uri (string-append "https://01.org/sites/default/files/downloads/"
590 name "/" name "-" version ".zip"))
591 (sha256
592 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
593 (build-system gnu-build-system)
594 (arguments
595 `(#:make-flags
596 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
597 #:phases
598 (modify-phases %standard-phases
599 (delete 'configure) ; no configure script
600 (add-before 'install 'create-output-directory
601 (lambda* (#:key outputs #:allow-other-keys)
602 ;; 'make install' assumes that sbindir exists.
603 (let* ((out (assoc-ref outputs "out"))
604 (sbin (string-append out "/sbin")))
605 (mkdir-p sbin)
606 #t))))
607 #:tests? #f)) ; no test suite
608 (native-inputs
8394619b 609 (list unzip))
6e8c75b8
TGR
610 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
611 (supported-systems (list "i686-linux" "x86_64-linux"))
612 (home-page "https://01.org/msr-tools/")
613 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
614 (description
615 "The MSR Tools project provides console utilities to directly access the
616Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
617
618@itemize
619@item @command{cpuid}: show identification and feature information of any CPU
620@item @command{rdmsr}: read MSRs from any CPU or all CPUs
621@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
622@end itemize
623
624These tools can be used to query and modify certain low-level CPU parameters,
625such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
626
627MSR addresses differ (greatly) between processors, and any such modification can
628be dangerous and may void your CPU or system board's warranty.")
629 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+
0ba0ab81 630
0cd05b5e
VM
631(define-public openhmd
632 (package
633 (name "openhmd")
634 (version "0.3.0")
635 (source
636 (origin
637 (method git-fetch)
638 (uri (git-reference
639 (url "https://github.com/OpenHMD/OpenHMD")
640 (commit version)))
641 (file-name (git-file-name name version))
642 (sha256
643 (base32 "1hkpdl4zgycag5k8njvqpx01apxmm8m8pvhlsxgxpqiqy9a38ccg"))))
644 (build-system meson-build-system)
645 (arguments
646 `(#:tests? #f)) ; no test target although there is a test folder
647 (native-inputs
8394619b 648 (list pkg-config))
0cd05b5e 649 (inputs
8394619b 650 (list hidapi))
0cd05b5e
VM
651 (home-page "http://www.openhmd.net/")
652 (synopsis "API and drivers for immersive technology")
653 (description "OpenHMD aims to provide an API and drivers for immersive
654technology, such as head mounted displays with built in head tracking.")
655 (license license:boost1.0)))
656
b1cf1d44
JK
657(define-public openrgb
658 (package
659 (name "openrgb")
660 (version "0.7")
661 (source
662 (origin
663 (method git-fetch)
664 (uri (git-reference
665 (url "https://gitlab.com/CalcProgrammer1/OpenRGB")
666 (commit (string-append "release_" version))))
667 (file-name (git-file-name name version))
668 (sha256
669 (base32 "0xhfaz0b74nfnh7il2cz5c0338xlzay00g6hc2h3lsncarj8d5n7"))
670 (patches
671 (search-patches "openrgb-unbundle-hueplusplus.patch"))
672 (modules '((guix build utils)))
673 (snippet
674 '(begin
675 ;; Delete the bundled hueplusplus and json libraries.
676 (delete-file-recursively "dependencies/hueplusplus-1.0.0")
677 (delete-file-recursively "dependencies/json")))))
678 (build-system cmake-build-system)
679 (arguments
680 (list
681 #:tests? #f ; doesn't have tests
682 #:make-flags
683 #~(list (string-append "INSTALL_ROOT=" #$output ))
684 #:phases
685 #~(modify-phases %standard-phases
686 (add-after 'unpack 'unbundle
687 (lambda* (#:key inputs #:allow-other-keys)
688 (substitute* "OpenRGB.pro"
689 (("dependencies/hueplusplus-1.0.0/include/hueplusplus")
690 (string-append #$(this-package-input "hueplusplus")
691 "/include/hueplusplus"))
692 (("dependencies/json")
693 (string-append #$(this-package-input "json-modern-cxx")
694 "/include/nlohmann")))))
695 ;; Call qmake instead of configure to create a Makefile.
696 (replace 'configure
697 (lambda _ (invoke "qmake" "PREFIX=/" "OpenRGB.pro"))))))
698 (inputs
699 (list hidapi
700 hueplusplus
701 json-modern-cxx
702 libusb
703 mbedtls-apache
704 qtbase-5))
705 (native-inputs
706 (list pkg-config))
707 (synopsis "RGB lighting control")
708 (description
709 "OpenRGB is lighting control that doesn't depend on manufacturer software.
710ASUS, ASRock, Corsair, G.Skill, Gigabyte, HyperX, MSI, Razer, ThermalTake, and more
711supported.
712
713Features:
714
715@itemize
716@item Set colors and select effect modes for a wide variety of RGB hardware
717@item Save and load profiles
718@item Control lighting from third party software using the OpenRGB SDK
719@item Command line interface
720@item Connect multiple instances of OpenRGB to synchronize lighting across multiple PCs
721@item Can operate standalone or in a client/headless server configuration
722@item View device information
723@item No official/manufacturer software required
724@item Graphical view of device LEDs makes creating custom patterns easy
725@end itemize")
726 (home-page "https://openrgb.org/")
727 (license license:gpl2))) ; Included libccmmk is lgpl3+, CRC is bsd-3
728
0ba0ab81
TGR
729(define-public wavemon
730 (package
731 (name "wavemon")
5685946c 732 (version "0.9.4")
0ba0ab81
TGR
733 (source
734 (origin
735 (method git-fetch)
736 (uri (git-reference
b0e7b699 737 (url "https://github.com/uoaerg/wavemon")
0ba0ab81
TGR
738 (commit (string-append "v" version))))
739 (file-name (git-file-name name version))
740 (sha256
5685946c 741 (base32 "0s3yz15vzx90fxyb8bgryksn0cr2gpz9inbcx4qjrgs7zfbm4pgh"))))
0ba0ab81
TGR
742 (build-system gnu-build-system)
743 (arguments
744 `(#:make-flags
745 (list "CC=gcc"
746 ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to Guix's
747 ;; standard --docdir since it's only used as such.
748 (string-append "datadir=" (assoc-ref %outputs "out")
749 "/share/doc/" ,name "-" ,version))
750 #:tests? #f)) ; no tests
751 (native-inputs
8394619b 752 (list pkg-config))
0ba0ab81 753 (inputs
8394619b 754 (list libcap libnl ncurses))
0ba0ab81
TGR
755 (home-page "https://github.com/uoaerg/wavemon")
756 (synopsis "Wireless network device monitor")
757 (description
758 "Wavemon is a wireless device monitor with an interactive ncurses terminal
759interface. It can display and plot signal and noise levels in real time. It
760also reports packet statistics, device configuration, network parameters, and
761access points and other wireless clients of your wireless network hardware.
762
763Wavemon should work (with varying levels of detail and features) with any device
764supported by the Linux kernel.")
765 ;; Source file headers still say GPL2+, but the authorial intent
766 ;; (from COPYING and the F9 'about' screen) is clearly GPL3+.
767 (license license:gpl3+)))
22a98cda
JN
768
769(define-public rkdeveloptool
770 (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
771 (revision "0"))
772 (package
773 (name "rkdeveloptool")
774 (version (git-version "1.3" revision commit))
775 (source
776 (origin
777 (method git-fetch)
778 (uri (git-reference
b0e7b699 779 (url "https://github.com/rockchip-linux/rkdeveloptool")
22a98cda
JN
780 (commit commit)))
781 (file-name (git-file-name name version))
782 (sha256
783 (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
784 (build-system gnu-build-system)
785 (native-inputs
8394619b 786 (list autoconf automake pkg-config))
22a98cda 787 (inputs
8394619b 788 (list libusb))
22a98cda
JN
789 (home-page "https://github.com/rockchip-linux/rkdeveloptool")
790 (synopsis "Read from and write to RockChicp devices over USB")
791 (description
792 "Rkdeveloptool can read from and write to RockChip devices over USB, such
793as the Pinebook Pro.")
794 (license license:gpl2+))))
22df0a1f
BW
795
796(define-public libqb
797 (package
798 (name "libqb")
799 ;; NOTE: We are using a Release Candidate version (for 2.0) here because
800 ;; of the linker issues with the previous release.
801 (version "1.9.1")
802 (source (origin
803 (method url-fetch)
804 (uri (string-append
805 "https://github.com/ClusterLabs/libqb/releases/download/v"
806 version "/libqb-" version ".tar.xz"))
807 (sha256
808 (base32
809 "008vvw504kh40br5v2xkqavnp9vpmjvf768faqzv1d00fd53ingn"))))
810 (build-system gnu-build-system)
811 (native-inputs
e3196755 812 (list pkg-config libxml2))
22df0a1f
BW
813 (home-page "https://clusterlabs.github.io/libqb/")
814 (synopsis "Library providing high performance logging, tracing, ipc, and poll")
815 (description "Libqb is a library with the primary purpose of providing
816high-performance, reusable features for client-server architecture, such as
817logging, tracing, inter-process communication (IPC), and polling. Libqb is
818not intended to be an all-encompassing library, but instead provide focused
819APIs that are highly tuned for maximum performance for client-server
820applications.")
821 (license license:lgpl2.1)))
02ee43e4
BW
822
823(define-public usbguard
824 (package
825 (name "usbguard")
38ebe227 826 (version "0.7.8")
02ee43e4
BW
827 (source (origin
828 (method url-fetch)
829 (uri (string-append
830 "https://github.com/USBGuard/usbguard/releases/download/usbguard-"
831 version "/usbguard-" version ".tar.gz"))
832 (file-name (git-file-name name version))
833 (sha256
38ebe227 834 (base32 "1il5immqfxh2cj8wn1bfk7l42inflzgjf07yqprpz7r3lalbxc25"))))
02ee43e4
BW
835 (build-system gnu-build-system)
836 (arguments
837 `(#:phases
838 (modify-phases %standard-phases
f96ddb60
BW
839 (add-after 'unpack 'patch-build-scripts
840 (lambda* (#:key inputs #:allow-other-keys)
841 (substitute* "configure"
842 (("/usr/include/catch")
843 (string-append (assoc-ref inputs "catch") "/include")))
02ee43e4 844 ;; Do not create log directory.
f96ddb60 845 (substitute* "Makefile.in" ((".*/log/usbguard.*") ""))
02ee43e4 846 ;; Disable LDAP tests: they use 'sudo'.
f96ddb60
BW
847 (substitute* "src/Tests/Makefile.in"
848 (("\\$\\(am__append_2\\)") ""))
02ee43e4
BW
849 #t))
850 (add-after 'install 'delete-static-library
851 (lambda* (#:key outputs #:allow-other-keys)
852 ;; It can't be direclty disabled since it's needed for the tests.
853 (delete-file (string-append (assoc-ref outputs "out")
854 "/lib/libusbguard.a"))
855 #t))
856 (add-after 'install 'install-zsh-completion
857 (lambda* (#:key outputs #:allow-other-keys)
858 (let* ((out (assoc-ref outputs "out"))
859 (site-functions
860 (string-append out "/share/zsh/site-functions")))
861 (mkdir-p site-functions)
862 (copy-file "scripts/usbguard-zsh-completion"
863 (string-append site-functions "/_usbguard"))
864 #t))))
865 #:make-flags
866 (list (string-append "BASH_COMPLETION_DIR="
867 (assoc-ref %outputs "out")
868 "/etc/bash_completion.d"))
869 #:configure-flags
870 (list
871 "--localstatedir=/var"
02ee43e4
BW
872 "--enable-systemd=no"
873 "--with-ldap"
874 "--with-dbus"
875 "--with-polkit")))
876 (inputs
877 `(("audit" ,audit)
878 ("catch" ,catch-framework)
879 ("dbus-glib" ,dbus-glib)
880 ("ldap" ,openldap)
881 ("libcap-ng" ,libcap-ng)
882 ("libseccomp" ,libseccomp)
883 ("libsodium" ,libsodium)
febd19da 884 ("pegtl" ,pegtl)
02ee43e4
BW
885 ("polkit" ,polkit)
886 ("protobuf" ,protobuf)
887 ("libqb" ,libqb)))
888 (native-inputs
889 `(("asciidoc" ,asciidoc)
02ee43e4
BW
890 ("bash-completion" ,bash-completion)
891 ("gdbus-codegen" ,glib "bin")
892 ("umockdev" ,umockdev)
893 ("xmllint" ,libxml2)
894 ("xsltproc" ,libxslt)
895 ("pkg-config" ,pkg-config)))
896 (home-page "https://usbguard.github.io")
897 (synopsis "Helps to protect your computer against rogue USB devices (a.k.a. BadUSB)")
898 (description "USBGuard is a software framework for implementing USB device
899authorization policies (what kind of USB devices are authorized) as well as
900method of use policies (how a USB device may interact with the system).
901Simply put, it is a USB device whitelisting tool.")
902 (license license:gpl2)))
ec732a46
EP
903
904(define-public screentest
905 (package
906 (name "screentest")
907 (version "2.1")
908 (source
909 (origin
910 (method git-fetch)
911 (uri (git-reference
912 (url "https://github.com/TobiX/screentest")
913 (commit version)))
914 (file-name (git-file-name name version))
915 (sha256
916 (base32 "0gv3xj9sbk1wsyijfw9xjnvy8pg7j4arjnma2r2kfi18qy32wd30"))))
917 (build-system gnu-build-system)
918 (inputs
8394619b 919 (list glib gtk+-2))
ec732a46 920 (native-inputs
8394619b
LC
921 (list autoconf
922 intltool
923 libtool
924 `(,glib "bin")
925 automake
926 pkg-config))
ec732a46
EP
927 (synopsis "Simple screen testing tool")
928 (description "This is a program for testing the quality of CRT/LCD
929screens. It displays various patterns and allows you to estimate the quality
930of your CRT/LCD monitor.")
931 (home-page "https://github.com/TobiX/screentest")
932 (license license:gpl2)))
34861ac8
LLB
933
934(define-public tpm2-tss
935 (package
936 (name "tpm2-tss")
937 (version "3.0.3")
938 (source
939 (origin
940 (method url-fetch)
941 (uri (string-append "https://github.com/tpm2-software/tpm2-tss"
942 "/releases/download/" version "/tpm2-tss-" version
943 ".tar.gz"))
944 (sha256
945 (base32 "05xynpwq851fp8f5fy7ac0blvz8mr5m5cbqj3gslgbwv63kjnfbq"))))
946 (build-system gnu-build-system)
947 (native-inputs
8394619b 948 (list pkg-config))
34861ac8 949 (inputs
8394619b 950 (list curl json-c openssl))
34861ac8
LLB
951 (home-page "https://tpm2-software.github.io/")
952 (synopsis "OSS Implementation of the TCG TPM2 Software Stack (TSS2)")
953 (description
954 "This package provides the @acronym{TCG, Trusted Computing Group}
955@acronym{TSS2, TPM2 Software Stack}. The stack contains libtss2-fapi,
956libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm
957and libtss2-tcti-mssim.")
958 (license license:bsd-2)))
651765ec
ZZ
959
960(define-public libcpuid
961 ;; We need to remove blobs from the source, first we have to isolate the blob
962 ;; source in build system.
963 ;; See https://github.com/anrieff/libcpuid/pull/159.
964 (let ((commit "2e61160983f32ba840b2246d3c3850c44626ab0d")
965 (revision "1"))
966 (package
967 (name "libcpuid")
968 (version (git-version "0.5.1" revision commit))
969 (source
970 (origin
971 (method git-fetch)
972 (uri (git-reference
973 (url "https://github.com/anrieff/libcpuid")
974 (commit commit)))
975 (sha256
976 (base32 "1mphvkiqq6z33sq6i490fq27sbyylacwrf8bg7ccvpcjms208sww"))
977 (modules '((guix build utils)))
978 (snippet
979 ;; Now remove blobs.
980 #~(begin
981 (delete-file "libcpuid/msrdriver.c")
982 (delete-file-recursively "contrib/MSR Driver")))
983 (file-name (git-file-name name version))))
984 (build-system cmake-build-system)
985 (arguments
986 (list
987 #:configure-flags #~(list "-DLIBCPUID_TESTS=ON")
988 #:phases
989 #~(modify-phases %standard-phases
990 (add-after 'unpack 'absolutize
991 (lambda* (#:key inputs #:allow-other-keys)
992 ;; Linux specific
993 (when #$(target-linux?)
994 (substitute* "libcpuid/rdmsr.c"
995 (("modprobe") (which "modprobe")))))))))
996 (inputs
997 (if (target-linux?)
998 (list kmod)
999 '()))
1000 (native-inputs (list python-3)) ;required by tests
1001 (supported-systems
1002 (filter (lambda (t) (or (target-x86-64? t) (target-x86-32? t)))
1003 %supported-systems))
1004 (home-page "https://libcpuid.sourceforge.net/")
1005 (synopsis "Small library for x86 CPU detection and feature extraction")
1006 (description "Libcpuid is a small C library to get vendor, model, branding
1007string, code name and other information from x86 CPU. This library is not to be
1008confused with the @code{cpuid} command line utility from package @code{cpuid}.")
1009 (license license:bsd-2))))