gnu: Add wlgreet.
[jackhill/guix/guix.git] / gnu / packages / hardware.scm
CommitLineData
aadd1d24 1;;; GNU Guix --- Functional package management for GNU
7d9972df 2;;; Copyright © 2018–2022 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>
6ce8d9be 8;;; Copyright © 2021, 2022 Petr Hodina <phodina@protonmail.com>
7ba5ce94 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>
678c5bea 14;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
bc6490a8 15;;; Copyright © 2022 Marcel Kupiec <formbi@protonmail.com>
32f001ce 16;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
aadd1d24
TGR
17;;;
18;;; This file is part of GNU Guix.
19;;;
20;;; GNU Guix is free software; you can redistribute it and/or modify it
21;;; under the terms of the GNU General Public License as published by
22;;; the Free Software Foundation; either version 3 of the License, or (at
23;;; your option) any later version.
24;;;
25;;; GNU Guix is distributed in the hope that it will be useful, but
26;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28;;; GNU General Public License for more details.
29;;;
30;;; You should have received a copy of the GNU General Public License
31;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33(define-module (gnu packages hardware)
a0fd9a35 34 #:use-module (gnu packages)
02ee43e4 35 #:use-module (gnu packages admin)
22a98cda 36 #:use-module (gnu packages autotools)
3611f99a
RG
37 #:use-module (gnu packages avahi)
38 #:use-module (gnu packages base)
02ee43e4 39 #:use-module (gnu packages bash)
6ce8d9be 40 #:use-module (gnu packages bison)
aadd1d24 41 #:use-module (gnu packages compression)
02ee43e4 42 #:use-module (gnu packages check)
febd19da 43 #:use-module (gnu packages cpp)
02ee43e4 44 #:use-module (gnu packages crypto)
3611f99a 45 #:use-module (gnu packages cups)
34861ac8 46 #:use-module (gnu packages curl)
3611f99a
RG
47 #:use-module (gnu packages debian)
48 #:use-module (gnu packages disk)
02ee43e4 49 #:use-module (gnu packages documentation)
7ba5ce94 50 #:use-module (gnu packages flex)
3611f99a 51 #:use-module (gnu packages freedesktop)
5eff4380 52 #:use-module (gnu packages gcc)
192cb790 53 #:use-module (gnu packages gettext)
3611f99a 54 #:use-module (gnu packages gl)
aadd1d24 55 #:use-module (gnu packages glib)
3611f99a 56 #:use-module (gnu packages gnome)
ec732a46 57 #:use-module (gnu packages gtk)
3611f99a 58 #:use-module (gnu packages guile)
aadd1d24
TGR
59 #:use-module (gnu packages libusb)
60 #:use-module (gnu packages linux)
bc6490a8 61 #:use-module (gnu packages lxqt)
3611f99a 62 #:use-module (gnu packages package-management)
0ba0ab81 63 #:use-module (gnu packages ncurses)
3611f99a 64 #:use-module (gnu packages networking)
02ee43e4 65 #:use-module (gnu packages openldap)
7c3cefde 66 #:use-module (gnu packages pciutils)
192cb790 67 #:use-module (gnu packages perl)
aadd1d24 68 #:use-module (gnu packages pkg-config)
02ee43e4
BW
69 #:use-module (gnu packages polkit)
70 #:use-module (gnu packages protobuf)
bc6490a8 71 #:use-module (gnu packages pulseaudio)
192cb790 72 #:use-module (gnu packages python)
7c3cefde
DGC
73 #:use-module (gnu packages python-web)
74 #:use-module (gnu packages python-xyz)
9c172059 75 #:use-module (gnu packages qt)
3611f99a
RG
76 #:use-module (gnu packages scanner)
77 #:use-module (gnu packages security-token)
34861ac8 78 #:use-module (gnu packages tls)
3611f99a 79 #:use-module (gnu packages video)
7ba5ce94 80 #:use-module (gnu packages virtualization)
3611f99a 81 #:use-module (gnu packages vulkan)
34861ac8 82 #:use-module (gnu packages web)
aadd1d24 83 #:use-module (gnu packages xdisorg)
22df0a1f 84 #:use-module (gnu packages xml)
aadd1d24 85 #:use-module (gnu packages xorg)
9c172059 86 #:use-module (guix build-system cmake)
8d810c20 87 #:use-module (guix build-system glib-or-gtk)
aadd1d24 88 #:use-module (guix build-system gnu)
0cd05b5e 89 #:use-module (guix build-system meson)
3611f99a 90 #:use-module (guix build-system perl)
7c3cefde 91 #:use-module (guix build-system python)
aadd1d24 92 #:use-module (guix download)
b1cf1d44 93 #:use-module (guix gexp)
0ba0ab81 94 #:use-module (guix git-download)
7c3cefde 95 #:use-module (guix svn-download)
aadd1d24 96 #:use-module ((guix licenses) #:prefix license:)
907b9dc8 97 #:use-module (guix packages)
651765ec
ZZ
98 #:use-module (guix utils)
99 #:use-module (srfi srfi-1))
aadd1d24
TGR
100
101;; This is a module for packages related to physical hardware that don't (yet)
102;; have a more specific home like gps.scm, security-token.scm, &c.
103
6ce8d9be
PH
104(define-public envytools
105 (let ((commit "9014a51b1436461c7b3b005bdae72bf4912f4e72")
106 (revision "1"))
107 (package
108 (name "envytools")
109 (version (git-version "0.1" revision commit))
110 (home-page "https://github.com/envytools/envytools")
111 (source (origin
112 (method git-fetch)
113 (uri (git-reference
114 (url home-page)
115 (commit commit)))
116 (file-name (git-file-name name version))
117 (sha256
118 (base32
119 "1lqh73yxd5jgv7b770m37zimzhyn4f3053jybkixkhvm93zka8vd"))))
120 (build-system cmake-build-system)
121 (native-inputs (list bison flex pkg-config))
122 (inputs (list libxml2 python))
123 (synopsis "Reverse-engineering tools for Nvidia's proprietary GPU drivers")
124 (description
125 "This package provides tools for exploring Nvidia's proprietary GPU
126drivers, including an assembler and a disassembler for several GPU instruction
127sets, and tools to deal with register databases.")
128 (license license:expat))))
129
3611f99a
RG
130(define-public hw-probe
131 (package
132 (name "hw-probe")
133 (version "1.6.4")
134 (source
135 (origin
136 (method git-fetch)
137 (uri
138 (git-reference
139 (url "https://github.com/linuxhw/hw-probe")
140 (commit version)))
141 (file-name (git-file-name name version))
142 (sha256
143 (base32 "028wnhrbn10lfxwmcpzdbz67ygldimv7z1k1bm64ggclykvg5aim"))))
144 (build-system perl-build-system)
145 (arguments
146 (list
147 #:tests? #f ;no test suite
148 #:phases
149 #~(modify-phases %standard-phases
150 (add-after 'unpack 'patch-source
151 (lambda* (#:key inputs outputs #:allow-other-keys)
152 ;; Correct install prefix.
153 (substitute* "Makefile"
154 (("/usr") #$output))
155
156 (define preserve
157 ;; Either not available in Guix or better left untouched.
158 '("$HWInfoCmd" "$CurlCmd" "$NvidiaSmi_Path" ;perl variables
159 "vblank_mode=0" "DRI_PRIME=1" ;environment variables
160 "sha512" ;fall-back to sha512sum
161 ;; hp-probe comes from the full 'hplib' package, which would
162 ;; pull Qt and increase the size of the closure by 600 MiB.
163 "hp-probe"
164
165 ;; Android.
166 "apk" "getprop"
167
168 ;; BSD-related.
169 "atactl" "acpiconf"
170 "bsdhwmon" "camcontrol"
171 "devinfo" "diskinfo" "disklabel"
172 "freebsd-version" "ghostbsd-version"
173 "hwstat" "kldstat" "mfiutil" "modstat" "mport"
174 "ofwdump" "opnsense-version"
175 "pcictl" "pcidump" "pciconf" "pkg" "pkg_info" "pkgin"
176 "start-hello" "sysinfo" "usbconfig" "usbdevs"
177
178 ;; Package managers.
179 "eopkg" "pacman" "swupd"
180
181 ;; Not packaged in Guix (TODO).
182 "apm" ;apmd
183 "drm_info" ;drm_info
184 "megactl" ;megactl
185 "lspnp" ;pnputils
186 "lsb_release" ;lsb-release
187 "lsinitrd" ;dracut
188 "optirun" ;bumblebee
189 "usbctl" ;usbctl
190 "monitor-get-edid" ;monitor-edid
191 "journalctl" "systemctl" "systemd-analyze" ;systemd
192 "superiotool" ;superiotool
193 "x86info" ;x86info
194
195 ;; Other.
196 "arcconf" ;proprietary
197 "config" ;unknown origin (Linux-related)
198 "dkms" ;unknown origin (Linux-related)
199 "amdconfig" "fglrxinfo" ;proprietary/obsolete
200 "geom" ;unknown origin
201 "hciconfig" "hcitool" ;deprecated from bluez
202 "nm-tool")) ;replaced by nmcli in network-manager
203
204 (substitute* "hw-probe.pl"
205 (("(check|find|run)Cmd\\(\"([^\" ]+)" _ prefix command)
206 (string-append
207 prefix "Cmd(\""
208 (if (member command preserve)
209 command
210 (or (false-if-exception
211 (search-input-file
212 inputs (string-append "bin/" command)))
213 (search-input-file
214 inputs (string-append "sbin/" command))))))
215 (("(my \\$HWInfoCmd = \")hwinfo" _ head)
216 (string-append head (search-input-file inputs "sbin/hwinfo")))
217 (("(my \\$CurlCmd = \")curl" _ head)
218 (string-append head (search-input-file inputs "bin/curl")))
219 (("(\\$LsblkCmd = \")lsblk" _ head)
220 (string-append head (search-input-file inputs "bin/lsblk")))
221 (("(\\$SmartctlCmd = \")smartctl" _ head)
222 (string-append head (search-input-file inputs "sbin/smartctl")))
223 (("(my \\$FindmntCmd = \")findmnt" _ head)
224 (string-append head (search-input-file inputs "bin/findmnt")))
225 (("(\\$DDCUtilCmd = \")ddcutil" _ head)
226 (string-append head (search-input-file inputs "bin/ddcutil")))
227 (("(my \\$VaInfoCmd = \")vainfo" _ head)
228 (string-append head (search-input-file inputs "bin/vainfo")))
229 (("(\\$CheckHddCmd = \")hdparm" _ head)
230 (string-append head (search-input-file inputs "sbin/hdparm")))
231 (("(\\$USE_DIGEST_ALT = \")sha512sum" _ head)
232 (string-append head (search-input-file inputs "bin/sha512sum"))))))
233 (delete 'configure)
234 (add-after 'install 'wrap
235 (lambda* (#:key inputs outputs #:allow-other-keys)
236 (define hw-probe (search-input-file outputs "bin/hw-probe"))
237 ;; 'NeedProgs' core utilities are specially checked for
238 ;; availability. It's easier to wrap them in PATH than patching
239 ;; their references.
240 ;; TODO: package edid-decode and add "bin/edid-decode" below:
241 (define need-progs (list "sbin/dmidecode" "sbin/smartctl"
242 "sbin/lspci" "bin/lsusb"))
243 (wrap-script hw-probe
244 (list "PERL5LIB" 'prefix (list (getenv "PERL5LIB")))
245 (list "PATH" 'prefix
246 (map (lambda (command)
247 (dirname (search-input-file inputs command)))
248 need-progs))))))))
249 (inputs
250 (list acpi
251 acpica
252 alsa-utils
253 avahi
254 bash-minimal
255 coreutils
256 cpuid
257 cpupower
258 curl
259 ddcutil
260 dmidecode
261 dpkg
262 edid-decode
263 efibootmgr
264 efivar
265 ethtool
266 eudev
267 findutils
268 gpart
269 grep
270 guile-3.0 ;for wrap-script
271 hddtemp
272 hdparm
273 i2c-tools
274 inxi
275 iproute
276 iw
277 libva-utils
278 lm-sensors
279 mcelog
280 memtester
281 mesa-utils
282 modem-manager
283 module-init-tools
284 neofetch
285 net-tools
286 network-manager
287 numactl
288 nvme-cli
289 opensc
290 openssl
291 p7zip
292 pciutils
293 perl-data-dumper
294 perl-digest-sha
295 perl-libwww
296 procps
297 psmisc ;for pstree
298 rpm
299 sane-backends
300 smartmontools
301 sysstat
302 upower
303 usbutils
304 util-linux
305 wireless-tools
306 vdpauinfo
307 vulkan-tools
308 xdpyinfo
309 xinput
310 xrandr
311 xvinfo))
312 (propagated-inputs (list hwinfo))
313 (home-page "https://linux-hardware.org")
314 (synopsis "Hardware Probe")
315 (description "Hardware Probe is a tool to probe for hardware, check its
316operability and find drivers.")
317 (license (list license:lgpl2.1+ license:bsd-4)))) ;dual-licensed
318
7ba5ce94
RG
319(define-public hwinfo
320 (package
321 (name "hwinfo")
4f878006 322 (version "21.82")
7ba5ce94
RG
323 (home-page "https://github.com/openSUSE/hwinfo")
324 (source
325 (origin
326 (method git-fetch)
327 (uri
328 (git-reference
329 (url home-page)
330 (commit version)))
331 (file-name (git-file-name name version))
332 (sha256
4f878006 333 (base32 "1ih6vrgh64408cijywy9by2snynkw91p3h0ry5pzk3lyqsl0wnlh"))
7ba5ce94
RG
334 (modules
335 '((guix build utils)))
336 (snippet
337 `(begin
338 ;; Remove git2log program file.
339 (delete-file "git2log")
e1be3b94 340 ;; Remove variables that depend on git2log.
7ba5ce94
RG
341 (substitute* "Makefile"
342 (("GIT2LOG.*\\:=.*$") "")
343 (("GITDEPS.*\\:=.*$") "")
344 (("BRANCH.*\\:=.*$") ""))
345 ;; Create version file.
346 (call-with-output-file "VERSION"
347 (lambda (port)
258a27ee 348 (format port ,version)))))))
7ba5ce94 349 (build-system gnu-build-system)
81429d68 350 (outputs '("out" "lib" "doc"))
7ba5ce94
RG
351 (arguments
352 `(#:tests? #f ; no test-suite available
353 #:phases
354 (modify-phases %standard-phases
355 (add-after 'unpack 'patch
356 (lambda* (#:key outputs #:allow-other-keys)
357 (let* ((out (assoc-ref outputs "out"))
81429d68 358 (lib (assoc-ref outputs "lib"))
7ba5ce94 359 (doc (assoc-ref outputs "doc"))
81429d68
TGR
360 (incl-dir (string-append lib "/include"))
361 (lib-dir (string-append lib "/lib"))
7ba5ce94
RG
362 (sbin-dir (string-append out "/sbin"))
363 (share-dir (string-append out "/share"))
364 (doc-dir (string-append doc "/share/doc")))
365 ;; Generate HTML documentation in the output "doc".
366 (mkdir-p doc-dir)
367 (substitute* "doc/libhd.doxy"
368 (("OUTPUT_DIRECTORY.*=.*libhd")
369 (string-append "OUTPUT_DIRECTORY = " doc-dir "/libhd")))
370 ;; Correct values of the version and install directories.
371 (substitute* "Makefile"
372 (("VERSION.*\\:=.*$")
373 (string-append "VERSION := " ,version "\n"))
374 (("LIBDIR.*\\?=.*$")
375 (string-append "LIBDIR ?= " lib-dir "\n"))
376 (("/usr/include") incl-dir)
377 (("/(usr|var)/(lib|lib64)") lib-dir)
378 (("/usr/sbin") sbin-dir)
379 (("/usr/share") share-dir)
380 (("\\$\\(DESTDIR\\)/sbin ") ""))
81429d68 381 ;; Add the "lib" output to the run-path.
7ba5ce94
RG
382 (substitute* "Makefile.common"
383 (("-Lsrc")
384 (string-append "-Lsrc " "-Wl,-rpath=" lib-dir)))
385 ;; Correct program name of the lexical analyzer.
386 (substitute* "src/isdn/cdb/Makefile"
387 (("lex isdn_cdb.lex") "flex isdn_cdb.lex"))
81429d68 388 ;; Patch pkg-config file to point to the "lib" output.
7ba5ce94 389 (substitute* "hwinfo.pc.in"
81429d68 390 (("/usr") lib)))))
7ba5ce94
RG
391 (delete 'configure)
392 (replace 'build
393 (lambda _
394 (setenv "CC" ,(cc-for-target))
395 (invoke "make" "shared")
396 (invoke "make" "doc")))
397 (add-after 'install 'install-manpages
398 (lambda* (#:key outputs #:allow-other-keys)
399 (let* ((out (assoc-ref outputs "out"))
400 (man-dir (string-append out "/share/man"))
401 (man1-dir (string-append man-dir "/man1"))
402 (man8-dir (string-append man-dir "/man8")))
403 (for-each
404 (lambda (x) (install-file x man1-dir))
405 (find-files "doc" "\\.1$"))
406 (for-each
407 (lambda (y) (install-file y man8-dir))
408 (find-files "doc" "\\.8$"))))))))
409 (native-inputs
8394619b 410 (list doxygen flex perl pkg-config))
7ba5ce94
RG
411 (inputs
412 `(("libx86emu" ,libx86emu)
413 ("util-linux:lib" ,util-linux "lib")))
414 (synopsis "Hardware information tool")
415 (description "HwInfo is used to probe for the hardware present in the system.
416It can be used to generate a system overview log which can be later used for
417support.")
418 (license license:gpl2+)))
419
bc6490a8
F
420(define-public ckb-next
421 (let ((commit "967f44018a9d46efa7203fad38518e9381eba0f3")
422 (revision "0"))
423 (package
424 (name "ckb-next")
425 (version (git-version "0.4.4" revision commit))
426 (source (origin
427 (method git-fetch)
428 (uri (git-reference
429 (url "https://github.com/ckb-next/ckb-next")
430 (commit commit)))
431 (sha256
432 (base32
433 "0bfpah0zgmyhbi6payymr3p98nfnwqr2xqxgkyzvccz72z246316"))
434 (file-name (git-file-name name version))))
435 (build-system cmake-build-system)
436 (arguments
437 `(#:modules ((guix build cmake-build-system) (guix build qt-utils)
438 (guix build utils))
439 #:imported-modules (,@%cmake-build-system-modules
440 (guix build qt-utils))
441 #:tests? #f
442 #:phases
443 (modify-phases %standard-phases
444 (add-before 'build 'patch-lib-udev
445 (lambda* (#:key inputs outputs #:allow-other-keys)
446 (substitute* "src/daemon/cmake_install.cmake"
447 (("/lib/udev")
448 (string-append (assoc-ref outputs "out")
449 "/lib/udev")))))
450 (add-after 'install 'wrap-qt
451 (lambda* (#:key inputs outputs #:allow-other-keys)
452 (let ((out (assoc-ref outputs "out")))
453 (wrap-qt-program "ckb-next"
454 #:output out
455 #:inputs inputs)))))))
eef8e2ec 456 (native-inputs (list qttools-5 pkg-config))
bc6490a8
F
457 (inputs (list qtbase-5
458 zlib
459 libdbusmenu-qt
460 quazip
461 pulseaudio
462 libxcb
463 xcb-util-wm
464 qtx11extras
465 eudev
466 bash-minimal))
467 (home-page "https://github.com/ckb-next/ckb-next")
468 (synopsis "Driver for Corsair keyboards and mice")
469 (description
470 "ckb-next is a driver for Corsair keyboards and mice. It aims to bring
471the features of Corsair's proprietary software to Linux-based operating
472systems. It already supports much of the same functionality, including full
473RGB animations.")
474 (license license:gpl2))))
475
aadd1d24
TGR
476(define-public ddcutil
477 (package
478 (name "ddcutil")
7d9972df 479 (version "1.2.2")
aadd1d24
TGR
480 (source
481 (origin
482 (method url-fetch)
483 (uri (string-append "https://www.ddcutil.com/tarballs/"
ec756fa5 484 "ddcutil-" version ".tar.gz"))
aadd1d24 485 (sha256
7d9972df 486 (base32 "18fbd45h2r3r702dvmlmyrwgs3ymr4mhm4f12lgv9jqb5csalbw2"))))
aadd1d24
TGR
487 (build-system gnu-build-system)
488 (native-inputs
8394619b 489 (list pkg-config))
aadd1d24 490 (inputs
8394619b
LC
491 (list eudev
492 glib
b9f7d36d
EF
493 kmod
494 i2c-tools
8394619b
LC
495 libdrm ; enhanced diagnostics
496 libusb ; support USB monitors
497 libx11 ; enhanced diagnostics
498 libxrandr
499 zlib))
aadd1d24
TGR
500 (home-page "https://www.ddcutil.com/")
501 (synopsis "Control external monitor settings")
502 (description
503 "ddcutil can query and modify most external monitors' settings, such as
504brightness, colour levels, and input sources. Generally speaking, any setting
505that can be changed by pressing buttons on the monitor can be modified by
506ddcutil.
507
508ddcutil communicates directly with monitors implementing the Monitor Control
509Command Set (@dfn{MCCS}). It usually does so through the the Display Data
510Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
511communicate over USB as per the USB Monitor Control Class Specification.
512
513One particular use case is in colour profile management. Monitor calibration
514is relative to the monitor colour settings currently in effect, e.g. red gain.
515ddcutil allows colour-related settings to be saved at the time a monitor is
516calibrated, and restored when the calibration is applied.")
517 (license (list license:bsd-3 ; FindDDCUtil.cmake
518 license:gpl2+)))) ; everything else
6e8c75b8 519
9c172059
BW
520(define-public ddcui
521 (package
522 (name "ddcui")
23b4740d 523 (version "0.2.1")
9c172059
BW
524 (source
525 (origin
526 (method git-fetch)
527 (uri (git-reference
528 (url "https://github.com/rockowitz/ddcui")
529 (commit (string-append "v" version))))
530 (file-name (git-file-name name version))
531 (sha256
23b4740d 532 (base32 "0a9xfv80dpimx9wi9igjbbfydyfsgnbk6dv1plhjzyp2a9shdibb"))))
9c172059
BW
533 (build-system cmake-build-system)
534 (arguments
535 '(#:tests? #f)) ; No test suite
536 (native-inputs
eef8e2ec 537 (list pkg-config qttools-5))
9c172059 538 (inputs
8394619b 539 (list ddcutil glib qtbase-5))
9c172059
BW
540 (home-page "https://www.ddcutil.com/")
541 (synopsis "Graphical user interface for ddcutil")
542 (description "ddcui is a graphical user interface for ddcutil, implemented
543using Qt. It provide a dynamic way to inspect and configure external monitors
544through the Display Data Channel Command Interface (@dfn{DDC/CI}) protocol.")
545 (license (list license:gpl2+))))
546
8fe681b9
BW
547(define-public edid-decode
548 (let ((commit "74b64180d67bb009d8d9ea1b6f18ad41aaa16396") ; 2020-04-22
549 (revision "1"))
550 (package
551 (name "edid-decode")
552 (version (git-version "0.0.0" revision commit))
553 (source
554 (origin
555 (method git-fetch)
556 (file-name (git-file-name name version))
557 (uri (git-reference
558 (url "git://linuxtv.org/edid-decode.git")
559 (commit commit)))
560 (sha256
561 (base32 "0nirp5bza08zj5d8bjgcm0p869hdg3qg3mwa7999pjdrzmn7s2ah"))))
562 (build-system gnu-build-system)
563 (arguments
564 `(#:tests? #f ; No test suite
565 #:make-flags
566 (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
567 "bindir=/bin" "mandir=/share/man")
568 #:phases
569 (modify-phases %standard-phases
570 (add-after 'unpack 'fix-cross-compilation
571 (lambda* (#:key native-inputs target #:allow-other-keys)
572 (when target
573 (substitute* "Makefile"
574 (("\\$\\(CXX\\)")
575 (string-append target "-g++"))))
576 #t))
577 (delete 'configure))))
578 (home-page "https://git.linuxtv.org/edid-decode.git/")
579 (synopsis "Decode @dfn{EDID} data in human-readable format")
580 (description "edid-decode decodes @dfn{EDID} monitor description data in
581human-readable format and checks if it conforms to the standards.")
582 (license license:expat))))
583
32f001ce 584(define-public h-client
3dd32e76
MC
585 ;; The Python 3 port hasn't yet been integrated into the main branch
586 ;; (currently lives in the 'python3-port' branch).
587 (let ((commit "e6c78b16e034ccf78ae9cb4c29268c2f57a30bfc")
588 (revision "1"))
32f001ce
MC
589 (package
590 (name "h-client")
591 (version (git-version "0.0a0" revision commit))
592 (source
593 (origin
594 (method git-fetch)
595 (uri (git-reference
3dd32e76 596 (url "https://git.savannah.gnu.org/git/h-client.git")
32f001ce
MC
597 (commit commit)))
598 (file-name (git-file-name name version))
599 (sha256
3dd32e76 600 (base32 "0hm86d51kj5r3yxq4c23aa57cs8igz3wrkbjn20z4frx75rpf46m"))))
32f001ce 601 (build-system python-build-system)
8d810c20
MC
602 (arguments
603 (list
604 #:imported-modules `(,@%python-build-system-modules
605 ,@%glib-or-gtk-build-system-modules)
606 #:modules '(((guix build glib-or-gtk-build-system) #:prefix glib:)
607 (guix build python-build-system)
608 (guix build utils))
609 #:phases
610 #~(modify-phases %standard-phases
611 (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
612 (assoc-ref glib:%standard-phases
613 'generate-gdk-pixbuf-loaders-cache-file))
614 (add-after 'install 'glib-or-gtk-compile-schemas
615 (assoc-ref glib:%standard-phases 'glib-or-gtk-compile-schemas))
616 (add-after 'install 'glib-or-gtk-wrap
617 (assoc-ref glib:%standard-phases 'glib-or-gtk-wrap))
618 (add-after 'glib-or-gtk-wrap 'wrap-more
619 (lambda* (#:key inputs outputs #:allow-other-keys)
620 (wrap-script (search-input-file outputs "bin/h-client")
621 ;; Wrap GI_TYPELIB_PATH to avoid the error "ValueError:
622 ;; Namespace GdkPixbuf not available".
623 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))
624 `("PATH" = (,(dirname (search-input-file
625 inputs "sbin/lspci"))
626 ,(dirname (search-input-file
627 inputs "bin/lsusb"))))))))))
32f001ce
MC
628 (inputs
629 (list gdk-pixbuf
8d810c20
MC
630 gobject-introspection ;for GI_TYPELIB_PATH
631 guile-3.0
32f001ce
MC
632 gtk+
633 pciutils
634 python-pycurl
635 python-pygobject
636 usbutils))
637 (synopsis "Graphical client for the h-node hardware database project")
638 (description
639 "The h-node project (https://www.h-node.org) aims to build a database of
640hardware that works with fully free operating systems. h-client is a GTK+
641graphical client that is able to retrieves information on the hardware inside
642the computer it's running on, and on peripherals connected to it, and helps
643you submit that information to the h-node project along with whether the
644hardware works with a fully free operating system or not.")
645 (home-page "https://savannah.nongnu.org/projects/h-source/")
646 (license license:gpl3+))))
647
879a5cb7
JK
648(define-public headsetcontrol
649 (package
650 (name "headsetcontrol")
651 (version "2.6")
652 (source
653 (origin
654 (method git-fetch)
655 (uri (git-reference
656 (url "https://github.com/Sapd/HeadsetControl")
657 (commit version)))
658 (file-name (git-file-name name version))
659 (sha256
660 (base32 "0a7zimzi71416pmn6z0l1dn1c2x8p702hkd0k6da9rsznff85a88"))))
661 (build-system cmake-build-system)
662 (inputs
663 (list hidapi))
664 (home-page "https://github.com/Sapd/HeadsetControl")
665 (synopsis "Sidetone and Battery status for USB headsets")
666 (description
667 "Headsetcontrol is a tool to control certain aspects of USB-connected
668headsets. Currently, support is provided for adjusting sidetone, getting
669battery state, controlling LEDs, and setting the inactive time.")
670 (license license:gpl3+)))
671
fb856885
JK
672(define-public hueplusplus
673 (package
674 (name "hueplusplus")
675 (version "1.1.0")
676 (source
677 (origin
678 (method git-fetch)
679 (uri (git-reference
680 (url "https://github.com/enwi/hueplusplus")
681 (commit (string-append "v" version))))
682 (file-name (git-file-name name version))
683 (sha256
684 (base32 "1jy8m2a0h0kf0aw8jbniz069q9j7cx67b1zlv2vz1ymq921qk0pm"))
685 (patches
686 (search-patches "hueplusplus-mbedtls.patch"))))
687 (build-system cmake-build-system)
688 (arguments
689 `(#:tests? #f)) ;; Tests require Google's gtest and gmock
690 (inputs
691 (list mbedtls-apache))
692 (synopsis "C++ library to control Philips Hue lights")
693 (description "Hueplusplus is a library for controlling Philips Hue lights.
694Features:
695
696@itemize
697@item find bridges with SSDP or set an ip manually
698@item all common light functions (brightness, color, temperature)
699@item extended @code{alert()} functions, which alert in a specific
700color (good for notifications)
701@item supports sensors, rules, groups, scenes and schedules
702@item streaming with entertainment mode
703@item documented with doxygen
704@end itemize")
705 (home-page "https://github.com/enwi/hueplusplus")
706 (license license:lgpl3+)))
707
a8b70525
TGR
708(define-public i7z
709 (let ((revision "0")
710 (commit "1a41ff13db747e962456ddbb5ccb2b7fc43ca0cb"))
711 (package
712 (name "i7z")
713 (version (git-version "0.28" revision commit))
714 (source
715 (origin
716 (method git-fetch)
717 (uri (git-reference
718 (url "https://github.com/afontenot/i7z")
719 (commit commit)))
720 (file-name (git-file-name name version))
721 (sha256
722 (base32 "0jxm63a8y1mfl1sa4mzzfs3bgnym6achj1yc0jglmp05xal16lm1"))
a0fd9a35
TGR
723 (patches
724 (search-patches "i7z-gcc-10.patch"))
a8b70525
TGR
725 (modules '((guix build utils)))
726 (snippet
727 '(begin
728 (for-each delete-file-recursively
729 (list "src/GUI"
730 "src/perfmon-i7z"
731 "scripts"))))))
732 (build-system gnu-build-system)
733 (arguments
734 `(#:make-flags
735 (list (string-append "prefix=" (assoc-ref %outputs "out"))
736 (string-append "CC=" ,(cc-for-target)))
737 #:tests? #f ; no test suite
738 #:phases
739 (modify-phases %standard-phases
740 (delete 'configure)))) ; no configure script
741 (inputs
8394619b 742 (list ncurses))
a8b70525
TGR
743 (home-page "https://github.com/afontenot/i7z")
744 (synopsis "Thermal and C-state reporting on older Intel Core CPUs")
745 (description
746 "The @command{i7z} utility accurately measures the current frequency
747and temperature of older Intel Core (i3, i5, and i7) processors including the
748Nehalem, Sandy Bridge, and Ivy Bridge generations. Reliable support for newer
749CPUs is not guaranteed, as this package has not seen significant development
750since 2013.
751
752If your processor is supported, you'll get detailed reports on Turbo Boost and
753clock multipliers, core voltage, and time spent in different C-states. This
754information can be viewed in real time and/or logged to a file.")
2db86250 755 (supported-systems (list "x86_64-linux"))
a8b70525
TGR
756 (license license:gpl2))))
757
192cb790
LLB
758(define-public libsmbios
759 (package
760 (name "libsmbios")
761 (version "2.4.3")
762 (source
763 (origin
764 (method git-fetch)
765 (uri
766 (git-reference
767 (url (string-append "https://github.com/dell/" name))
768 (commit (string-append "v" version))))
769 (file-name (git-file-name name version))
770 (sha256
771 (base32 "0krwwydyvb9224r884y1mlmzyxhlfrcqw73vi1j8787rl0gl5a2i"))))
772 (build-system gnu-build-system)
773 (native-inputs
774 `(("autoconf" ,autoconf)
775 ("automake" ,automake)
776 ("gettext" ,gettext-minimal)
777 ("libtool" ,libtool)
778 ("pkg-config" ,pkg-config)
779 ("perl" ,perl)
780 ("python" ,python)))
781 (inputs
8394619b 782 (list libxml2))
192cb790
LLB
783 (arguments
784 `(#:phases
785 (modify-phases %standard-phases
786 (replace 'bootstrap
787 (lambda _ (invoke "autoreconf" "-vfi"))))))
788 (synopsis "Library for interacting with Dell SMBIOS tables")
789 (description
790 "libsmbios provides a library to interface with the SMBIOS tables. It
791also provides extensions for proprietary methods of interfacing with Dell
792specific SMBIOS tables.")
793 (home-page "https://github.com/dell/libsmbios")
794 (license
db74cc6a 795 (list license:osl2.1 license:gpl2+ license:bsd-3 license:boost1.0))))
192cb790 796
5eff4380
TGR
797;; Distinct from memtest86, which is obsolete.
798(define-public memtest86+
799 (package
800 (name "memtest86+")
801 ;; Update the description when/if UEFI support is released.
802 (version "5.01")
803 (source
804 (origin
805 (method url-fetch)
806 (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-"
807 version ".tar.gz"))
808 (sha256
809 (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l"))))
810 (build-system gnu-build-system)
811 (arguments
812 `(#:system "i686-linux" ; the result runs outside of any OS
813 #:tests? #f ; no way to test this
814 #:phases
815 (modify-phases %standard-phases
816 (delete 'configure) ; no configure script
817 (replace 'build
818 ;; The default 'make all' does wonderful things, like scp(1) a file to
819 ;; 192.168.0.12. Build the bootable images and nothing more.
820 (lambda _
821 (invoke "make"
822 "memtest" ; ELF executable
823 "memtest.bin"))) ; DOS/MBR boot sector
824 (replace 'install
825 (lambda* (#:key outputs #:allow-other-keys)
826 (let* ((out (assoc-ref outputs "out"))
827 (lib (string-append out "/lib/memtest86+"))
828 (doc (string-append out "/share/doc/memtest86+-" ,version)))
829 (for-each
830 (lambda (file)
831 (install-file file lib))
832 (list "memtest"
833 "memtest.bin"))
834 (for-each
835 (lambda (file)
836 (install-file file doc))
837 (list "FAQ"
fb541251
TGR
838 "README"))
839 #t))))))
5eff4380
TGR
840 (native-inputs
841 ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors.
8394619b 842 (list gcc-4.9))
5eff4380
TGR
843 (supported-systems (list "i686-linux" "x86_64-linux"))
844 (home-page "https://www.memtest.org/")
845 (synopsis "Thorough real-mode memory tester")
846 (description
847 "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It
848repeatedly writes different patterns to all memory locations, reads them back
849again, and verifies whether the result is the same as what was written. This
850can help debug even intermittent and non-deterministic errors.
851
852It runs independently of any operating system, at computer boot-up, so that it
853can scan as much of your RAM as possible for hardware defects.
854
855Memtest86+ cannot currently be used on computers booted with UEFI.")
856 (license license:gpl2)))
857
fb541251
TGR
858(define-public memtester
859 (package
860 (name "memtester")
6fee3239 861 (version "4.5.1")
fb541251
TGR
862 (source
863 (origin
864 (method url-fetch)
865 ;; Even the latest release is available under 'old-versions/'.
866 (uri (string-append "http://pyropus.ca/software/memtester/old-versions/"
867 "memtester-" version ".tar.gz"))
868 (sha256
6fee3239 869 (base32 "0issrasdihav8jgsqb49cfyj0v564z8k9lyg2jrq9h3n4lwc4pqw"))))
fb541251
TGR
870 (build-system gnu-build-system)
871 (arguments
872 `(#:make-flags
907b9dc8 873 (list ,(string-append "CC=" (cc-for-target)))
fb541251
TGR
874 #:phases
875 (modify-phases %standard-phases
876 (replace 'configure
877 ;; This is a home-brewed configuration system where the cc/ld command
878 ;; lines are stored in one-line files.
879 (lambda* (#:key outputs #:allow-other-keys)
880 (let* ((out (assoc-ref outputs "out")))
881 (substitute* (list "conf-cc" "conf-ld")
882 (("^cc") "gcc"))
883 (substitute* "Makefile"
884 (("(INSTALLPATH.*=).*" _ assignment)
885 (string-append assignment out)))
886 #t)))
887 (replace 'check
888 ;; There is no test suite. Test some RAM for a single iteration.
889 (lambda _
890 (invoke "./memtester" "64K" "1"))))))
891 (home-page "http://pyropus.ca/software/memtester/")
892 (synopsis "User-space memory subsystem tester")
893 (description
894 "Memtester stress-tests the memory subsystem of your operating system and
895computer. It repeatedly writes different patterns to all memory locations,
896reads them back again, and verifies whether the result is the same as what was
897written. This can help debug even intermittent and non-deterministic errors.
898
899Memtester runs entirely in user space. This means that you don't need to reboot
900to test your memory, but also that it's not possible to test all of the RAM
901installed in the system.
902
903It can also be told to test memory starting at a particular physical address.")
904 (license license:gpl2)))
905
6e8c75b8
TGR
906(define-public msr-tools
907 (package
908 (name "msr-tools")
909 (version "1.3")
910 (source
911 (origin
912 (method url-fetch)
913 (uri (string-append "https://01.org/sites/default/files/downloads/"
914 name "/" name "-" version ".zip"))
915 (sha256
916 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
917 (build-system gnu-build-system)
918 (arguments
919 `(#:make-flags
920 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
921 #:phases
922 (modify-phases %standard-phases
923 (delete 'configure) ; no configure script
924 (add-before 'install 'create-output-directory
925 (lambda* (#:key outputs #:allow-other-keys)
926 ;; 'make install' assumes that sbindir exists.
927 (let* ((out (assoc-ref outputs "out"))
928 (sbin (string-append out "/sbin")))
929 (mkdir-p sbin)
930 #t))))
931 #:tests? #f)) ; no test suite
932 (native-inputs
8394619b 933 (list unzip))
6e8c75b8
TGR
934 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
935 (supported-systems (list "i686-linux" "x86_64-linux"))
936 (home-page "https://01.org/msr-tools/")
937 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
938 (description
939 "The MSR Tools project provides console utilities to directly access the
940Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
941
942@itemize
943@item @command{cpuid}: show identification and feature information of any CPU
944@item @command{rdmsr}: read MSRs from any CPU or all CPUs
945@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
946@end itemize
947
948These tools can be used to query and modify certain low-level CPU parameters,
949such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
950
951MSR addresses differ (greatly) between processors, and any such modification can
952be dangerous and may void your CPU or system board's warranty.")
953 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+
0ba0ab81 954
0cd05b5e
VM
955(define-public openhmd
956 (package
957 (name "openhmd")
958 (version "0.3.0")
959 (source
960 (origin
961 (method git-fetch)
962 (uri (git-reference
963 (url "https://github.com/OpenHMD/OpenHMD")
964 (commit version)))
965 (file-name (git-file-name name version))
966 (sha256
967 (base32 "1hkpdl4zgycag5k8njvqpx01apxmm8m8pvhlsxgxpqiqy9a38ccg"))))
968 (build-system meson-build-system)
969 (arguments
970 `(#:tests? #f)) ; no test target although there is a test folder
971 (native-inputs
8394619b 972 (list pkg-config))
0cd05b5e 973 (inputs
8394619b 974 (list hidapi))
0cd05b5e
VM
975 (home-page "http://www.openhmd.net/")
976 (synopsis "API and drivers for immersive technology")
977 (description "OpenHMD aims to provide an API and drivers for immersive
978technology, such as head mounted displays with built in head tracking.")
979 (license license:boost1.0)))
980
b1cf1d44
JK
981(define-public openrgb
982 (package
983 (name "openrgb")
984 (version "0.7")
985 (source
986 (origin
987 (method git-fetch)
988 (uri (git-reference
989 (url "https://gitlab.com/CalcProgrammer1/OpenRGB")
990 (commit (string-append "release_" version))))
991 (file-name (git-file-name name version))
992 (sha256
993 (base32 "0xhfaz0b74nfnh7il2cz5c0338xlzay00g6hc2h3lsncarj8d5n7"))
994 (patches
995 (search-patches "openrgb-unbundle-hueplusplus.patch"))
996 (modules '((guix build utils)))
997 (snippet
998 '(begin
999 ;; Delete the bundled hueplusplus and json libraries.
1000 (delete-file-recursively "dependencies/hueplusplus-1.0.0")
1001 (delete-file-recursively "dependencies/json")))))
1002 (build-system cmake-build-system)
1003 (arguments
1004 (list
1005 #:tests? #f ; doesn't have tests
1006 #:make-flags
1007 #~(list (string-append "INSTALL_ROOT=" #$output ))
1008 #:phases
1009 #~(modify-phases %standard-phases
1010 (add-after 'unpack 'unbundle
1011 (lambda* (#:key inputs #:allow-other-keys)
1012 (substitute* "OpenRGB.pro"
1013 (("dependencies/hueplusplus-1.0.0/include/hueplusplus")
1014 (string-append #$(this-package-input "hueplusplus")
1015 "/include/hueplusplus"))
1016 (("dependencies/json")
1017 (string-append #$(this-package-input "json-modern-cxx")
1018 "/include/nlohmann")))))
1019 ;; Call qmake instead of configure to create a Makefile.
1020 (replace 'configure
1021 (lambda _ (invoke "qmake" "PREFIX=/" "OpenRGB.pro"))))))
1022 (inputs
1023 (list hidapi
1024 hueplusplus
1025 json-modern-cxx
1026 libusb
1027 mbedtls-apache
1028 qtbase-5))
1029 (native-inputs
1030 (list pkg-config))
1031 (synopsis "RGB lighting control")
1032 (description
1033 "OpenRGB is lighting control that doesn't depend on manufacturer software.
1034ASUS, ASRock, Corsair, G.Skill, Gigabyte, HyperX, MSI, Razer, ThermalTake, and more
1035supported.
1036
1037Features:
1038
1039@itemize
1040@item Set colors and select effect modes for a wide variety of RGB hardware
1041@item Save and load profiles
1042@item Control lighting from third party software using the OpenRGB SDK
1043@item Command line interface
1044@item Connect multiple instances of OpenRGB to synchronize lighting across multiple PCs
1045@item Can operate standalone or in a client/headless server configuration
1046@item View device information
1047@item No official/manufacturer software required
1048@item Graphical view of device LEDs makes creating custom patterns easy
1049@end itemize")
1050 (home-page "https://openrgb.org/")
1051 (license license:gpl2))) ; Included libccmmk is lgpl3+, CRC is bsd-3
1052
0ba0ab81
TGR
1053(define-public wavemon
1054 (package
1055 (name "wavemon")
5685946c 1056 (version "0.9.4")
0ba0ab81
TGR
1057 (source
1058 (origin
1059 (method git-fetch)
1060 (uri (git-reference
b0e7b699 1061 (url "https://github.com/uoaerg/wavemon")
0ba0ab81
TGR
1062 (commit (string-append "v" version))))
1063 (file-name (git-file-name name version))
1064 (sha256
5685946c 1065 (base32 "0s3yz15vzx90fxyb8bgryksn0cr2gpz9inbcx4qjrgs7zfbm4pgh"))))
0ba0ab81
TGR
1066 (build-system gnu-build-system)
1067 (arguments
1068 `(#:make-flags
1069 (list "CC=gcc"
1070 ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to Guix's
1071 ;; standard --docdir since it's only used as such.
1072 (string-append "datadir=" (assoc-ref %outputs "out")
1073 "/share/doc/" ,name "-" ,version))
1074 #:tests? #f)) ; no tests
1075 (native-inputs
8394619b 1076 (list pkg-config))
0ba0ab81 1077 (inputs
8394619b 1078 (list libcap libnl ncurses))
0ba0ab81
TGR
1079 (home-page "https://github.com/uoaerg/wavemon")
1080 (synopsis "Wireless network device monitor")
1081 (description
1082 "Wavemon is a wireless device monitor with an interactive ncurses terminal
1083interface. It can display and plot signal and noise levels in real time. It
1084also reports packet statistics, device configuration, network parameters, and
1085access points and other wireless clients of your wireless network hardware.
1086
1087Wavemon should work (with varying levels of detail and features) with any device
1088supported by the Linux kernel.")
1089 ;; Source file headers still say GPL2+, but the authorial intent
1090 ;; (from COPYING and the F9 'about' screen) is clearly GPL3+.
1091 (license license:gpl3+)))
22a98cda
JN
1092
1093(define-public rkdeveloptool
1094 (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
1095 (revision "0"))
1096 (package
1097 (name "rkdeveloptool")
1098 (version (git-version "1.3" revision commit))
1099 (source
1100 (origin
1101 (method git-fetch)
1102 (uri (git-reference
b0e7b699 1103 (url "https://github.com/rockchip-linux/rkdeveloptool")
22a98cda
JN
1104 (commit commit)))
1105 (file-name (git-file-name name version))
1106 (sha256
1107 (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
1108 (build-system gnu-build-system)
1109 (native-inputs
8394619b 1110 (list autoconf automake pkg-config))
22a98cda 1111 (inputs
8394619b 1112 (list libusb))
22a98cda
JN
1113 (home-page "https://github.com/rockchip-linux/rkdeveloptool")
1114 (synopsis "Read from and write to RockChicp devices over USB")
1115 (description
1116 "Rkdeveloptool can read from and write to RockChip devices over USB, such
1117as the Pinebook Pro.")
1118 (license license:gpl2+))))
22df0a1f
BW
1119
1120(define-public libqb
1121 (package
1122 (name "libqb")
1123 ;; NOTE: We are using a Release Candidate version (for 2.0) here because
1124 ;; of the linker issues with the previous release.
1125 (version "1.9.1")
1126 (source (origin
1127 (method url-fetch)
1128 (uri (string-append
1129 "https://github.com/ClusterLabs/libqb/releases/download/v"
1130 version "/libqb-" version ".tar.xz"))
1131 (sha256
1132 (base32
1133 "008vvw504kh40br5v2xkqavnp9vpmjvf768faqzv1d00fd53ingn"))))
1134 (build-system gnu-build-system)
1135 (native-inputs
e3196755 1136 (list pkg-config libxml2))
22df0a1f
BW
1137 (home-page "https://clusterlabs.github.io/libqb/")
1138 (synopsis "Library providing high performance logging, tracing, ipc, and poll")
1139 (description "Libqb is a library with the primary purpose of providing
1140high-performance, reusable features for client-server architecture, such as
1141logging, tracing, inter-process communication (IPC), and polling. Libqb is
1142not intended to be an all-encompassing library, but instead provide focused
1143APIs that are highly tuned for maximum performance for client-server
1144applications.")
1145 (license license:lgpl2.1)))
02ee43e4
BW
1146
1147(define-public usbguard
1148 (package
1149 (name "usbguard")
ca4ab89d 1150 (version "1.1.1")
02ee43e4 1151 (source (origin
678c5bea
MB
1152 (method git-fetch)
1153 (uri (git-reference
1154 (url "https://github.com/USBGuard/usbguard")
1155 (commit (string-append "usbguard-" version))))
02ee43e4
BW
1156 (file-name (git-file-name name version))
1157 (sha256
ca4ab89d 1158 (base32 "0lpyhkz5nr0c9mq57mgcvam5c8qfqqwjc4xd46n2ldqc9vhfsask"))))
02ee43e4
BW
1159 (build-system gnu-build-system)
1160 (arguments
9b176a05
G
1161 (list
1162 #:phases
1163 #~(modify-phases %standard-phases
1164 (add-after 'unpack 'patch-bootstrap-script
1165 (lambda _
1166 ;; Don't attempt to fetch git submodules.
1167 (substitute* "autogen.sh"
1168 (("^git submodule.*")
1169 ""))))
1170 (add-after 'bootstrap 'patch-build-scripts
1171 (lambda* (#:key inputs #:allow-other-keys)
1172 (substitute* "configure"
1173 (("/usr/include/catch")
1174 (dirname (search-input-file inputs "include/catch.hpp"))))
1175 ;; Do not create log directory.
1176 (substitute* "Makefile.in" ((".*/log/usbguard.*") ""))
1177 ;; Disable LDAP tests: they use 'sudo'.
1178 (substitute* "src/Tests/Makefile.in"
1179 (("\\$\\(am__append_2\\)") ""))))
1180 (add-after 'install 'delete-static-library
1181 (lambda args
1182 ;; It can't be directly disabled since it's needed for the tests.
1183 (delete-file (string-append #$output
1184 "/lib/libusbguard.a"))))
1185 (add-after 'install 'install-zsh-completion
1186 (lambda args
1187 (let ((site-functions
1188 (string-append #$output "/share/zsh/site-functions")))
1189 (mkdir-p site-functions)
1190 (copy-file "scripts/usbguard-zsh-completion"
1191 (string-append site-functions "/_usbguard"))))))
1192 #:make-flags
1193 #~(list (string-append "BASH_COMPLETION_DIR="
1194 #$output
1195 "/etc/bash_completion.d"))
1196 #:configure-flags
1197 #~(list
1198 "--localstatedir=/var"
1199 "--enable-systemd=no"
1200 "--with-ldap"
1201 "--with-dbus"
1202 "--with-polkit")))
02ee43e4 1203 (inputs
0945e43b
MB
1204 (list audit
1205 catch-framework
1206 dbus-glib
1207 openldap
1208 libcap-ng
1209 libseccomp
1210 libsodium
1211 pegtl
1212 polkit
1213 protobuf
1214 libqb))
02ee43e4 1215 (native-inputs
0945e43b
MB
1216 (list asciidoc
1217 autoconf
1218 automake
1219 libtool
1220 bash-completion
1221 `(,glib "bin")
1222 umockdev
1223 libxml2
1224 libxslt
1225 pkg-config))
02ee43e4
BW
1226 (home-page "https://usbguard.github.io")
1227 (synopsis "Helps to protect your computer against rogue USB devices (a.k.a. BadUSB)")
1228 (description "USBGuard is a software framework for implementing USB device
1229authorization policies (what kind of USB devices are authorized) as well as
1230method of use policies (how a USB device may interact with the system).
1231Simply put, it is a USB device whitelisting tool.")
1232 (license license:gpl2)))
ec732a46
EP
1233
1234(define-public screentest
1235 (package
1236 (name "screentest")
1237 (version "2.1")
1238 (source
1239 (origin
1240 (method git-fetch)
1241 (uri (git-reference
1242 (url "https://github.com/TobiX/screentest")
1243 (commit version)))
1244 (file-name (git-file-name name version))
1245 (sha256
1246 (base32 "0gv3xj9sbk1wsyijfw9xjnvy8pg7j4arjnma2r2kfi18qy32wd30"))))
1247 (build-system gnu-build-system)
1248 (inputs
8394619b 1249 (list glib gtk+-2))
ec732a46 1250 (native-inputs
8394619b
LC
1251 (list autoconf
1252 intltool
1253 libtool
1254 `(,glib "bin")
1255 automake
1256 pkg-config))
ec732a46
EP
1257 (synopsis "Simple screen testing tool")
1258 (description "This is a program for testing the quality of CRT/LCD
1259screens. It displays various patterns and allows you to estimate the quality
1260of your CRT/LCD monitor.")
1261 (home-page "https://github.com/TobiX/screentest")
1262 (license license:gpl2)))
34861ac8
LLB
1263
1264(define-public tpm2-tss
1265 (package
1266 (name "tpm2-tss")
1267 (version "3.0.3")
1268 (source
1269 (origin
1270 (method url-fetch)
1271 (uri (string-append "https://github.com/tpm2-software/tpm2-tss"
1272 "/releases/download/" version "/tpm2-tss-" version
1273 ".tar.gz"))
1274 (sha256
1275 (base32 "05xynpwq851fp8f5fy7ac0blvz8mr5m5cbqj3gslgbwv63kjnfbq"))))
1276 (build-system gnu-build-system)
1277 (native-inputs
8394619b 1278 (list pkg-config))
34861ac8 1279 (inputs
8394619b 1280 (list curl json-c openssl))
34861ac8
LLB
1281 (home-page "https://tpm2-software.github.io/")
1282 (synopsis "OSS Implementation of the TCG TPM2 Software Stack (TSS2)")
1283 (description
1284 "This package provides the @acronym{TCG, Trusted Computing Group}
1285@acronym{TSS2, TPM2 Software Stack}. The stack contains libtss2-fapi,
1286libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm
1287and libtss2-tcti-mssim.")
1288 (license license:bsd-2)))
651765ec
ZZ
1289
1290(define-public libcpuid
1291 ;; We need to remove blobs from the source, first we have to isolate the blob
1292 ;; source in build system.
1293 ;; See https://github.com/anrieff/libcpuid/pull/159.
1294 (let ((commit "2e61160983f32ba840b2246d3c3850c44626ab0d")
1295 (revision "1"))
1296 (package
1297 (name "libcpuid")
1298 (version (git-version "0.5.1" revision commit))
1299 (source
1300 (origin
1301 (method git-fetch)
1302 (uri (git-reference
1303 (url "https://github.com/anrieff/libcpuid")
1304 (commit commit)))
1305 (sha256
1306 (base32 "1mphvkiqq6z33sq6i490fq27sbyylacwrf8bg7ccvpcjms208sww"))
1307 (modules '((guix build utils)))
1308 (snippet
1309 ;; Now remove blobs.
1310 #~(begin
1311 (delete-file "libcpuid/msrdriver.c")
1312 (delete-file-recursively "contrib/MSR Driver")))
1313 (file-name (git-file-name name version))))
1314 (build-system cmake-build-system)
1315 (arguments
1316 (list
1317 #:configure-flags #~(list "-DLIBCPUID_TESTS=ON")
1318 #:phases
1319 #~(modify-phases %standard-phases
1320 (add-after 'unpack 'absolutize
1321 (lambda* (#:key inputs #:allow-other-keys)
1322 ;; Linux specific
1323 (when #$(target-linux?)
1324 (substitute* "libcpuid/rdmsr.c"
1325 (("modprobe") (which "modprobe")))))))))
1326 (inputs
1327 (if (target-linux?)
1328 (list kmod)
1329 '()))
1330 (native-inputs (list python-3)) ;required by tests
1331 (supported-systems
1332 (filter (lambda (t) (or (target-x86-64? t) (target-x86-32? t)))
1333 %supported-systems))
1334 (home-page "https://libcpuid.sourceforge.net/")
1335 (synopsis "Small library for x86 CPU detection and feature extraction")
1336 (description "Libcpuid is a small C library to get vendor, model, branding
1337string, code name and other information from x86 CPU. This library is not to be
1338confused with the @code{cpuid} command line utility from package @code{cpuid}.")
1339 (license license:bsd-2))))