projects/guix·blob java-team · refs

1926 lines · 74.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <[email protected]>
3;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <[email protected]>
4;;; Copyright © 2020 Brice Waegeneire <[email protected]>
5;;; Copyright © 2021, 2023-2025 Evgeny Pisemsky <[email protected]>
6;;; Copyright © 2021 Léo Le Bouter <[email protected]>
7;;; Copyright © 2021 Denis Carikli <[email protected]>
8;;; Copyright © 2021, 2022 Petr Hodina <[email protected]>
9;;; Copyright © 2021 Raghav Gururajan <[email protected]>
10;;; Copyright © 2021 Vinicius Monego <[email protected]>
11;;; Copyright © 2021, 2022 John Kehayias <[email protected]>
12;;; Copyright © 2022 Zhu Zihao <[email protected]>
13;;; Copyright © 2022 Maxime Devos <[email protected]>
14;;; Copyright © 2022 Marius Bakke <[email protected]>
15;;; Copyright © 2022 Marcel Kupiec <[email protected]>
16;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
17;;; Copyright © 2022, 2025 Efraim Flashner <[email protected]>
18;;; Copyright © 2023 Spencer Skylar Chan <[email protected]>
19;;; Copyright © 2023 Foundation Devices, Inc. <[email protected]>
20;;; Copyright © 2024 Giacomo Leidi <[email protected]>
21;;; Copyright © 2024 Zheng Junjie <[email protected]>
22;;; Copyright © 2024 Jakob Kirsch <[email protected]>
23;;; Copyright © 2025 Eric Bavier <[email protected]>
24;;; Copyright © 2025 Arun Isaac <[email protected]>
25;;; Copyright © 2025 James Smith <[email protected]>
26;;; Copyright © 2026 Daniel Littlewood <[email protected]>
27;;; Copyright © 2026 Artyom V. Poptsov <[email protected]>
28;;; Copyright © 2026 Thiago Negri <[email protected]>
29;;;
30;;; This file is part of GNU Guix.
31;;;
32;;; GNU Guix is free software; you can redistribute it and/or modify it
33;;; under the terms of the GNU General Public License as published by
34;;; the Free Software Foundation; either version 3 of the License, or (at
35;;; your option) any later version.
36;;;
37;;; GNU Guix is distributed in the hope that it will be useful, but
38;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40;;; GNU General Public License for more details.
41;;;
42;;; You should have received a copy of the GNU General Public License
43;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44
45(define-module (gnu packages hardware)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages admin)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages bash)
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages bootloaders)
53 #:use-module (gnu packages cdrom)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages cmake)
57 #:use-module (gnu packages cpp)
58 #:use-module (gnu packages crypto)
59 #:use-module (gnu packages cups)
60 #:use-module (gnu packages curl)
61 #:use-module (gnu packages debian)
62 #:use-module (gnu packages disk)
63 #:use-module (gnu packages dns)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages compiler-tools)
66 #:use-module (gnu packages freedesktop)
67 #:use-module (gnu packages gcc)
68 #:use-module (gnu packages gettext)
69 #:use-module (gnu packages gl)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages golang-xyz)
73 #:use-module (gnu packages gtk)
74 #:use-module (gnu packages guile)
75 #:use-module (gnu packages haskell-xyz)
76 #:use-module (gnu packages high-availability)
77 #:use-module (gnu packages image-processing)
78 #:use-module (gnu packages libusb)
79 #:use-module (gnu packages linux)
80 #:use-module (gnu packages lua)
81 #:use-module (gnu packages lxqt)
82 #:use-module (gnu packages man)
83 #:use-module (gnu packages mes)
84 #:use-module (gnu packages messaging)
85 #:use-module (gnu packages mtools)
86 #:use-module (gnu packages package-management)
87 #:use-module (gnu packages ncurses)
88 #:use-module (gnu packages networking)
89 #:use-module (gnu packages openldap)
90 #:use-module (gnu packages onc-rpc)
91 #:use-module (gnu packages pciutils)
92 #:use-module (gnu packages perl)
93 #:use-module (gnu packages pkg-config)
94 #:use-module (gnu packages polkit)
95 #:use-module (gnu packages protobuf)
96 #:use-module (gnu packages pulseaudio)
97 #:use-module (gnu packages python)
98 #:use-module (gnu packages python-build)
99 #:use-module (gnu packages python-crypto)
100 #:use-module (gnu packages python-web)
101 #:use-module (gnu packages python-xyz)
102 #:use-module (gnu packages qt)
103 #:use-module (gnu packages scanner)
104 #:use-module (gnu packages sdl)
105 #:use-module (gnu packages security-token)
106 #:use-module (gnu packages readline)
107 #:use-module (gnu packages tls)
108 #:use-module (gnu packages video)
109 #:use-module (gnu packages virtualization)
110 #:use-module (gnu packages vulkan)
111 #:use-module (gnu packages web)
112 #:use-module (gnu packages xdisorg)
113 #:use-module (gnu packages xml)
114 #:use-module (gnu packages xorg)
115 #:use-module (guix build-system cmake)
116 #:use-module (guix build-system glib-or-gtk)
117 #:use-module (guix build-system gnu)
118 #:use-module (guix build-system go)
119 #:use-module (guix build-system guile)
120 #:use-module (guix build-system meson)
121 #:use-module (guix build-system perl)
122 #:use-module (guix build-system pyproject)
123 #:use-module (guix build-system qt)
124 #:use-module (guix download)
125 #:use-module (guix gexp)
126 #:use-module (guix git-download)
127 #:use-module (guix svn-download)
128 #:use-module ((guix licenses) #:prefix license:)
129 #:use-module (guix packages)
130 #:use-module (guix utils)
131 #:use-module (srfi srfi-1))
132
133;; This is a module for packages related to physical hardware that don't (yet)
134;; have a more specific home like gps.scm, security-token.scm, &c.
135
136(define-public envytools
137 (let ((commit "9014a51b1436461c7b3b005bdae72bf4912f4e72")
138 (revision "1"))
139 (package
140 (name "envytools")
141 (version (git-version "0.1" revision commit))
142 (home-page "https://github.com/envytools/envytools")
143 (source (origin
144 (method git-fetch)
145 (uri (git-reference
146 (url home-page)
147 (commit commit)))
148 (file-name (git-file-name name version))
149 (sha256
150 (base32
151 "1lqh73yxd5jgv7b770m37zimzhyn4f3053jybkixkhvm93zka8vd"))))
152 (build-system cmake-build-system)
153 (native-inputs (list bison flex pkg-config))
154 (inputs (list libxml2 python))
155 (synopsis "Reverse-engineering tools for Nvidia's proprietary GPU drivers")
156 (description
157 "This package provides tools for exploring Nvidia's proprietary GPU
158drivers, including an assembler and a disassembler for several GPU instruction
159sets, and tools to deal with register databases.")
160 (license license:expat))))
161
162(define-public brillo
163 (package
164 (name "brillo")
165 (version "1.4.13")
166 (source (origin
167 (method git-fetch)
168 (uri (git-reference
169 (url "https://gitlab.com/cameronnemo/brillo")
170 (commit (string-append "v" version))))
171 (sha256
172 (base32
173 "0qq2c2l9wyrh2kz1adicmizymln1878hynnixhyck7j5f4rk45gq"))
174 (file-name (git-file-name name version))))
175 (build-system gnu-build-system)
176 (arguments
177 (list
178 #:make-flags #~(list (string-append "CC="
179 #$(cc-for-target))
180 (string-append "AADIR=" #$output "/etc/apparmor.d")
181 (string-append "PREFIX=" #$output))
182 #:phases
183 #~(modify-phases %standard-phases
184 (add-after 'unpack 'patch-udev-rules
185 (lambda _
186 (substitute* "contrib/udev.in"
187 (("/bin/chgrp")
188 (string-append #$coreutils
189 "/bin/chgrp"))
190 (("/bin/chmod")
191 (string-append #$coreutils
192 "/bin/chmod")))))
193 (delete 'configure)
194 ;; Tests must be run on real hardware.
195 (delete 'check)
196 (add-after 'install 'install-udev-polkit
197 (lambda* (#:key make-flags #:allow-other-keys)
198 (map (lambda (target)
199 (apply invoke "make" target make-flags))
200 '("install.udev" "install.polkit")))))))
201 (native-inputs (list go-md2man))
202 (supported-systems
203 (lset-difference string=? %supported-systems %hurd-systems))
204 (home-page "https://gitlab.com/cameronnemo/brillo")
205 (synopsis "Controls the brightness of backlight and LED devices on Linux")
206 (description
207 "Brillo is a command line tool to control the brightness of backlight and
208LED devices on Linux.
209
210Notable features include:
211
212@itemize
213
214@item Automatic best controller detection
215@item Smooth transitions and natural brightness adjustments
216@item Ability to save and restore brightness across boots
217@item Directly using sysfs to set brightness without relying on X
218@item Unprivileged access with no new setuid binaries
219@item Containment with AppArmor
220
221@end itemize")
222 (license (list license:bsd-0 license:gpl3+))))
223
224(define-public deskflow
225 (let ((commit "ef96c2c36228f853e266b9f6d80076ac8683ff02")
226 (revision "0"))
227 (package
228 (name "deskflow")
229 (version (git-version "1.26.0" revision commit))
230 (source
231 (origin
232 (method git-fetch)
233 (uri (git-reference
234 (url "https://github.com/deskflow/deskflow")
235 (commit commit)))
236 (file-name (git-file-name name version))
237 (sha256
238 (base32 "05sijkk74dq9hr7j8q2wms7zdf05p15x4627nvhqdazxwdv0r03l"))))
239 (build-system cmake-build-system)
240 (arguments
241 (list
242 #:configure-flags
243 #~(list "-DCMAKE_SKIP_RPATH=ON")
244 #:phases
245 #~(modify-phases %standard-phases
246 (add-after 'unpack 'patch-files
247 (lambda _
248 (substitute* "deploy/linux/deploy.cmake"
249 (("message.FATAL_ERROR.*os-release.*")
250 "set(RELEASE_FILE_CONTENTS \"\")\n"))
251 (substitute* "src/lib/deskflow/unix/AppUtilUnix.cpp"
252 (("/usr/share/X11/xkb/rules/evdev.xml")
253 (string-append #$(this-package-input "xkeyboard-config")
254 "/share/X11/xkb/rules/evdev.xml")))))
255 (replace 'check
256 (lambda* (#:key tests? #:allow-other-keys)
257 (when tests?
258 (setenv "QT_QPA_PLATFORM" "offscreen")
259 ;; From the project GitHub actions: "Integration tests are
260 ;; flakey by nature, make them optional". See:
261 ;; <.github/workflows/continuous-integration.yml>.
262 (invoke "./bin/legacytests"))))
263 (add-after 'install 'wrap-executable
264 (lambda _
265 (let ((qtbase #$(this-package-input "qtbase")))
266 (wrap-program (string-append #$output "/bin/deskflow")
267 `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" =
268 (,(string-append qtbase "/lib/qt6/plugins/platforms"))))))))))
269 (native-inputs
270 (list doxygen
271 googletest
272 sysprof
273 vulkan-headers
274 coreutils
275 help2man
276 pkg-config))
277 (inputs
278 (list bash-minimal
279 cli11
280 gdk-pixbuf
281 libei
282 libportal
283 libx11
284 libxi
285 libxinerama
286 libxkbcommon
287 libxkbfile
288 libxrandr
289 libxtst
290 libsm
291 libice
292 openssl
293 pugixml
294 python
295 qtbase
296 qtsvg
297 qttranslations
298 qttools
299 qtwayland
300 tomlplusplus
301 wayland
302 wayland-protocols
303 xkeyboard-config))
304 (home-page "https://deskflow.org/")
305 (synopsis "Share a single keyboard and mouse between multiple computers")
306 (description
307 "Deskflow is a keyboard and mouse sharing app. Use the keyboard,
308mouse,or trackpad of one computer to control nearby computers, and work
309seamlessly between them. It's like a software KVM (but without the video).
310TLS encryption is enabled by default. It supports Wayland clipboard
311sharing.")
312 (license license:gpl2))))
313
314(define-public hd-idle
315 (package
316 (name "hd-idle")
317 (version "1.22")
318 (source
319 (origin
320 (method git-fetch)
321 (uri
322 (git-reference
323 (url "https://github.com/adelolmo/hd-idle")
324 (commit (string-append "v" version))))
325 (file-name (git-file-name name version))
326 (sha256
327 (base32 "12nckzp00b3y91igp8jzlf6as353la6ar8gp6b646kn9gi2hrla3"))
328 (snippet
329 #~(begin
330 (use-modules (guix build utils))
331 (delete-file-recursively "vendor")))))
332 (build-system go-build-system)
333 (arguments
334 (list #:import-path "github.com/adelolmo/hd-idle"
335 #:install-source? #f))
336 (inputs
337 (list go-github-com-benmcclelland-sgio))
338 (home-page "https://github.com/adelolmo/hd-idle")
339 (synopsis "Spin down idle hard disks")
340 (description "@command{hd-idle} is a utility program for spinning down
341external disks after a period of idle time. Since most USB hard drives do not
342support setting the idle timer via @command{hdparm}, hd-idle can be used as a
343workaround.")
344 (license license:gpl3+)))
345
346(define-public hw-probe
347 (package
348 (name "hw-probe")
349 (version "1.6.5")
350 (source
351 (origin
352 (method git-fetch)
353 (uri
354 (git-reference
355 (url "https://github.com/linuxhw/hw-probe")
356 (commit version)))
357 (file-name (git-file-name name version))
358 (sha256
359 (base32 "1sbp0scdi54zwgvb1s3ki3cw8xnxaxzm5cicq2nn3a2b6n1d4ljs"))))
360 (build-system perl-build-system)
361 (arguments
362 (list
363 #:tests? #f ;no test suite
364 #:phases
365 #~(modify-phases %standard-phases
366 (add-after 'unpack 'patch-source
367 (lambda* (#:key inputs outputs #:allow-other-keys)
368 ;; Correct install prefix.
369 (substitute* "Makefile"
370 (("/usr") #$output))
371
372 (define preserve
373 ;; Either not available in Guix or better left untouched.
374 '("$HWInfoCmd" "$CurlCmd" "$NvidiaSmi_Path" ;perl variables
375 "vblank_mode=0" "DRI_PRIME=1" ;environment variables
376 "sha512" ;fall-back to sha512sum
377 ;; hp-probe comes from the full 'hplib' package, which would
378 ;; pull Qt and increase the size of the closure by 600 MiB.
379 "hp-probe"
380
381 ;; Android.
382 "apk" "getprop"
383
384 ;; BSD-related.
385 "atactl" "acpiconf"
386 "bsdhwmon" "camcontrol"
387 "devinfo" "diskinfo" "disklabel"
388 "freebsd-version" "ghostbsd-version"
389 "hwstat" "kldstat" "mfiutil" "modstat" "mport"
390 "ofwdump" "opnsense-version"
391 "pcictl" "pcidump" "pciconf" "pkg" "pkg_info" "pkgin"
392 "start-hello" "sysinfo" "usbconfig" "usbdevs"
393
394 ;; Package managers.
395 "eopkg" "pacman" "swupd"
396
397 ;; Not packaged in Guix (TODO).
398 "apm" ;apmd
399 "drm_info" ;drm_info
400 "megactl" ;megactl
401 "lspnp" ;pnputils
402 "lsb_release" ;lsb-release
403 "lsinitrd" ;dracut
404 "optirun" ;bumblebee
405 "usbctl" ;usbctl
406 "monitor-get-edid" ;monitor-edid
407 "journalctl" "systemctl" "systemd-analyze" ;systemd
408 "superiotool" ;superiotool
409 "x86info" ;x86info
410
411 ;; Other.
412 "arcconf" ;proprietary
413 "config" ;unknown origin (Linux-related)
414 "dkms" ;unknown origin (Linux-related)
415 "amdconfig" "fglrxinfo" ;proprietary/obsolete
416 "geom" ;unknown origin
417 "hciconfig" "hcitool" ;deprecated from bluez
418 "nm-tool")) ;replaced by nmcli in network-manager
419
420 (substitute* "hw-probe.pl"
421 (("(check|find|run)Cmd\\(\"([^\" ]+)" _ prefix command)
422 (string-append
423 prefix "Cmd(\""
424 (if (member command preserve)
425 command
426 (or (false-if-exception
427 (search-input-file
428 inputs (string-append "bin/" command)))
429 (search-input-file
430 inputs (string-append "sbin/" command))))))
431 (("(my \\$HWInfoCmd = \")hwinfo" _ head)
432 (string-append head (search-input-file inputs "sbin/hwinfo")))
433 (("(my \\$CurlCmd = \")curl" _ head)
434 (string-append head (search-input-file inputs "bin/curl")))
435 (("(\\$LsblkCmd = \")lsblk" _ head)
436 (string-append head (search-input-file inputs "bin/lsblk")))
437 (("(\\$SmartctlCmd = \")smartctl" _ head)
438 (string-append head (search-input-file inputs "sbin/smartctl")))
439 (("(my \\$FindmntCmd = \")findmnt" _ head)
440 (string-append head (search-input-file inputs "bin/findmnt")))
441 (("(\\$DDCUtilCmd = \")ddcutil" _ head)
442 (string-append head (search-input-file inputs "bin/ddcutil")))
443 (("(my \\$VaInfoCmd = \")vainfo" _ head)
444 (string-append head (search-input-file inputs "bin/vainfo")))
445 (("(\\$CheckHddCmd = \")hdparm" _ head)
446 (string-append head (search-input-file inputs "sbin/hdparm")))
447 (("(\\$USE_DIGEST_ALT = \")sha512sum" _ head)
448 (string-append head (search-input-file inputs "bin/sha512sum"))))))
449 (delete 'configure)
450 (add-after 'install 'wrap
451 (lambda* (#:key inputs outputs #:allow-other-keys)
452 (define hw-probe (search-input-file outputs "bin/hw-probe"))
453 ;; 'NeedProgs' core utilities are specially checked for
454 ;; availability. It's easier to wrap them in PATH than patching
455 ;; their references.
456 (define need-progs (list "sbin/dmidecode" "sbin/smartctl"
457 "bin/lspci" "bin/lsusb" "bin/edid-decode"))
458 (wrap-script hw-probe
459 (list "PERL5LIB" 'prefix (list (getenv "PERL5LIB")))
460 (list "PATH" 'prefix
461 (map (lambda (command)
462 (dirname (search-input-file inputs command)))
463 need-progs))))))))
464 (inputs
465 (list acpi
466 acpica
467 alsa-utils
468 avahi
469 bash-minimal
470 coreutils
471 cpuid
472 cpupower
473 curl
474 ddcutil
475 dmidecode
476 dpkg
477 edac-utils
478 edid-decode
479 efibootmgr
480 efivar
481 ethtool
482 eudev
483 findutils
484 gpart
485 grep
486 guile-3.0 ;for wrap-script
487 hddtemp
488 hdparm
489 i2c-tools
490 inxi
491 iproute
492 iw
493 libva-utils
494 lm-sensors
495 mcelog
496 memtester
497 mesa-utils
498 modem-manager
499 module-init-tools
500 neofetch
501 net-tools
502 network-manager
503 numactl
504 nvme-cli
505 opensc
506 openssl
507 p7zip
508 pciutils
509 perl-data-dumper
510 perl-digest-sha
511 perl-libwww
512 procps
513 psmisc ;for pstree
514 rpm
515 sane
516 smartmontools
517 sysstat
518 upower
519 usbutils
520 util-linux
521 wireless-tools
522 vdpauinfo
523 vulkan-tools
524 xdpyinfo
525 xinput
526 xrandr
527 xvinfo))
528 (propagated-inputs (list hwinfo))
529 (home-page "https://linux-hardware.org")
530 (synopsis "Hardware Probe")
531 (description "Hardware Probe is a tool to probe for hardware, check its
532operability and find drivers.")
533 (license (list license:lgpl2.1+ license:bsd-4)))) ;dual-licensed
534
535(define-public hwinfo
536 (package
537 (name "hwinfo")
538 (version "23.2")
539 (home-page "https://github.com/openSUSE/hwinfo")
540 (source
541 (origin
542 (method git-fetch)
543 (uri
544 (git-reference
545 (url home-page)
546 (commit version)))
547 (file-name (git-file-name name version))
548 (sha256
549 (base32 "0d9nhhi64d3i9x1bh3ksj0h5z2p4pwa0z88bc0jra9s39nf6q230"))
550 (modules
551 '((guix build utils)))
552 (snippet
553 #~(begin
554 ;; Remove git2log program file.
555 (delete-file "git2log")
556 ;; Remove variables that depend on git2log.
557 (substitute* "Makefile"
558 (("GIT2LOG.*\\:=.*$") "")
559 (("GITDEPS.*\\:=.*$") "")
560 (("BRANCH.*\\:=.*$") ""))
561 ;; Create version file.
562 (call-with-output-file "VERSION"
563 (lambda (port) (format port #$version)))))))
564 (build-system gnu-build-system)
565 (outputs '("out" "lib" "doc"))
566 (arguments
567 (list
568 #:tests? #f ; no test-suite available
569 #:make-flags
570 #~(list (string-append "CC=" #$(cc-for-target))
571 (string-append "LIBDIR=" #$output:lib "/lib")
572 (string-append "VERSION=" #$version))
573 #:phases
574 #~(modify-phases %standard-phases
575 (add-after 'unpack 'patch
576 (lambda _
577 (let ((include (string-append #$output:lib "/include"))
578 (lib (string-append #$output:lib "/lib"))
579 (sbin (string-append #$output "/sbin"))
580 (share (string-append #$output "/share"))
581 (doc (string-append #$output:doc "/share/doc")))
582 ;; Generate HTML documentation in the "doc" output.
583 (mkdir-p doc)
584 (substitute* "doc/libhd.doxy"
585 (("OUTPUT_DIRECTORY.*=.*libhd")
586 (string-append "OUTPUT_DIRECTORY = " doc "/libhd")))
587 ;; Correct values of the version and install directories.
588 (substitute* "Makefile"
589 (("/usr/include") include)
590 (("/(usr|var)/(lib|lib64)") lib)
591 (("/usr/sbin") sbin)
592 (("/usr/share") share)
593 (("\\$\\(DESTDIR\\)/sbin ") ""))
594 ;; Add the "lib" output to the run-path.
595 (substitute* "Makefile.common"
596 (("-Lsrc")
597 (string-append "-Lsrc " "-Wl,-rpath=" lib)))
598 ;; Correct program name of the lexical analyzer.
599 (substitute* "src/isdn/cdb/Makefile"
600 (("lex isdn_cdb.lex") "flex isdn_cdb.lex"))
601 ;; Patch pkg-config file to point to the "lib" output.
602 (substitute* "hwinfo.pc.in"
603 (("/usr") #$output:lib)))))
604 (delete 'configure)
605 (replace 'build
606 (lambda* (#:key make-flags #:allow-other-keys)
607 (apply invoke "make" "shared" make-flags)
608 (apply invoke "make" "doc" make-flags)))
609 (add-after 'install 'install-man-pages
610 (lambda _
611 (for-each
612 (lambda (file)
613 (install-file file (string-append #$output "/share/man/man"
614 (string-take-right file 1))))
615 (find-files "doc" "\\.[0-9]$")))))))
616 (native-inputs
617 (list doxygen flex perl pkg-config))
618 (inputs
619 (list libx86emu `(,util-linux "lib")))
620 (synopsis "Hardware information tool")
621 (description "HwInfo is used to probe for the hardware present in the system.
622It can be used to generate a system overview log which can be later used for
623support.")
624 (license license:gpl2+)))
625
626(define-public ckb-next
627 (package
628 (name "ckb-next")
629 (version "0.6.2")
630 (source (origin
631 (method git-fetch)
632 (uri (git-reference
633 (url "https://github.com/ckb-next/ckb-next")
634 (commit (string-append "v" version))))
635 (sha256
636 (base32
637 "1mdmimxifzajyv7n75zrnkn1fi0v46vbas028da2mncy8yjla3cl"))
638 (file-name (git-file-name name version))))
639 (build-system qt-build-system)
640 (arguments
641 (list
642 #:qtbase qtbase
643 #:tests? #f
644 #:configure-flags #~(list "-DPREFER_QT6=ON")
645 #:phases
646 #~(modify-phases %standard-phases
647 (add-before 'build 'patch-lib-udev
648 (lambda _
649 (substitute* "src/daemon/cmake_install.cmake"
650 (("/lib/udev") (string-append #$output "/lib/udev"))))))))
651 (native-inputs (list pkg-config qttools))
652 (inputs (list bash-minimal
653 eudev
654 libdbusmenu-qt
655 libxcb
656 pulseaudio
657 qt5compat
658 qtx11extras
659 quazip
660 xcb-util-wm
661 zlib))
662 (home-page "https://github.com/ckb-next/ckb-next")
663 (synopsis "Driver for Corsair keyboards and mice")
664 (description
665 "ckb-next is a driver for Corsair keyboards and mice. It aims to bring
666the features of Corsair's proprietary software to Linux-based operating
667systems. It already supports much of the same functionality, including full
668RGB animations.")
669 (license license:gpl2)))
670
671(define-public ddcutil
672 (package
673 (name "ddcutil")
674 (version "2.2.5")
675 (source
676 (origin
677 (method git-fetch)
678 (uri (git-reference
679 (url "https://github.com/rockowitz/ddcutil")
680 (commit (string-append "v" version))))
681 (file-name (git-file-name name version))
682 (sha256
683 (base32 "0mmzfa0g726dmqrmyyysnzxrhdkd93ay4dzzv0kqkvgdcqizh5z8"))))
684 (build-system gnu-build-system)
685 (native-inputs
686 (list autoconf automake libtool pkg-config))
687 (inputs
688 (list eudev
689 glib
690 jansson
691 kmod
692 i2c-tools
693 libdrm ;enhanced diagnostics
694 libusb ;support USB monitors
695 libx11 ;enhanced diagnostics
696 libxrandr
697 zlib))
698 (home-page "https://www.ddcutil.com/")
699 (synopsis "Control external monitor settings")
700 (description
701 "ddcutil can query and modify most external monitors' settings, such as
702brightness, colour levels, and input sources. Generally speaking, any setting
703that can be changed by pressing buttons on the monitor can be modified by
704ddcutil.
705
706ddcutil communicates directly with monitors implementing the Monitor Control
707Command Set (@dfn{MCCS}). It usually does so through the the Display Data
708Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
709communicate over USB as per the USB Monitor Control Class Specification.
710
711One particular use case is in colour profile management. Monitor calibration
712is relative to the monitor colour settings currently in effect, e.g. red gain.
713ddcutil allows colour-related settings to be saved at the time a monitor is
714calibrated, and restored when the calibration is applied.
715
716This package includes udev rules that can be used by adding this package to
717the @code{rules} field of the @code{udev-configuration} record. It gives
718read/write access to i2c devices to users in the @samp{i2c} group.")
719 (license (list license:bsd-3 ; FindDDCUtil.cmake
720 license:gpl2+)))) ; everything else
721
722(define-public ddcui
723 (package
724 (name "ddcui")
725 (version "0.6.0")
726 (source
727 (origin
728 (method git-fetch)
729 (uri (git-reference
730 (url "https://github.com/rockowitz/ddcui")
731 (commit (string-append "v" version))))
732 (file-name (git-file-name name version))
733 (sha256
734 (base32 "13gqgswkkqbn1x97ayiwj4ds2rbdnw564c2rhpi89zymhc1azj19"))))
735 (build-system qt-build-system)
736 (arguments
737 (list #:tests? #f)) ; No test suite
738 (native-inputs
739 (list pkg-config qttools-5))
740 (inputs
741 (list ddcutil glib qtbase-5 qtwayland-5))
742 (home-page "https://www.ddcutil.com/")
743 (synopsis "Graphical user interface for ddcutil")
744 (description "ddcui is a graphical user interface for ddcutil, implemented
745using Qt. It provide a dynamic way to inspect and configure external monitors
746through the Display Data Channel Command Interface (@dfn{DDC/CI}) protocol.")
747 (license (list license:gpl2+))))
748
749(define-public edid-decode
750 (let ((commit "3d635499e4aca3319f0796ba787213c981c5a770") ; 2024-04-02
751 (revision "1"))
752 (package
753 (name "edid-decode")
754 (version (git-version "0.0.0" revision commit))
755 (source
756 (origin
757 (method git-fetch)
758 (file-name (git-file-name name version))
759 (uri (git-reference
760 (url "git://linuxtv.org/edid-decode.git")
761 (commit commit)))
762 (sha256
763 (base32 "18s2pwm45mzgm0rfw3wf0m349p6381i6iwbylxypizqcsvgwxb3f"))))
764 (build-system gnu-build-system)
765 (arguments
766 `(#:tests? #f ; No test suite
767 #:make-flags
768 (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
769 "bindir=/bin" "mandir=/share/man")
770 #:phases
771 (modify-phases %standard-phases
772 (add-after 'unpack 'fix-cross-compilation
773 (lambda* (#:key native-inputs target #:allow-other-keys)
774 (when target
775 (substitute* "Makefile"
776 (("\\$\\(CXX\\)")
777 (string-append target "-g++"))))
778 #t))
779 (delete 'configure))))
780 (home-page "https://git.linuxtv.org/edid-decode.git/")
781 (synopsis "Decode @dfn{EDID} data in human-readable format")
782 (description "edid-decode decodes @dfn{EDID} monitor description data in
783human-readable format and checks if it conforms to the standards.")
784 (license license:expat))))
785
786(define-public h-client
787 (let ((commit "e6c78b16e034ccf78ae9cb4c29268c2f57a30bfc")
788 (revision "1"))
789 (package
790 (name "h-client")
791 (version (git-version "0.0a0" revision commit))
792 (source
793 (origin
794 (method git-fetch)
795 (uri (git-reference
796 (url "https://git.savannah.gnu.org/git/h-client.git/")
797 (commit commit)))
798 (file-name (git-file-name name version))
799 (sha256
800 (base32 "0hm86d51kj5r3yxq4c23aa57cs8igz3wrkbjn20z4frx75rpf46m"))))
801 (build-system pyproject-build-system)
802 (arguments
803 (list
804 #:test-backend #~'unittest
805 #:imported-modules
806 (append %pyproject-build-system-modules
807 %glib-or-gtk-build-system-modules)
808 #:modules '(((guix build glib-or-gtk-build-system) #:prefix glib:)
809 (guix build pyproject-build-system)
810 (guix build utils))
811 #:phases
812 #~(modify-phases %standard-phases
813 (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
814 (assoc-ref glib:%standard-phases
815 'generate-gdk-pixbuf-loaders-cache-file))
816 (add-after 'install 'glib-or-gtk-compile-schemas
817 (assoc-ref glib:%standard-phases 'glib-or-gtk-compile-schemas))
818 (add-after 'wrap 'glib-or-gtk-wrap
819 (assoc-ref glib:%standard-phases 'glib-or-gtk-wrap))
820 (add-after 'glib-or-gtk-wrap 'wrap-more
821 (lambda* (#:key inputs outputs #:allow-other-keys)
822 (wrap-script (search-input-file outputs "bin/h-client")
823 ;; Wrap GI_TYPELIB_PATH to avoid the error "ValueError:
824 ;; Namespace GdkPixbuf not available".
825 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))
826 `("PATH" = (,(dirname (search-input-file
827 inputs "bin/lspci"))
828 ,(dirname (search-input-file
829 inputs "bin/lsusb"))))))))))
830 (native-inputs (list python-setuptools))
831 (inputs
832 (list gdk-pixbuf
833 gobject-introspection ;for GI_TYPELIB_PATH
834 guile-3.0
835 gtk+
836 pciutils
837 python-pycurl
838 python-pygobject
839 usbutils))
840 (synopsis "Graphical client for the h-node hardware database project")
841 (description
842 "The h-node project (https://www.h-node.org) aims to build a database of
843hardware that works with fully free operating systems. h-client is a GTK+
844graphical client that is able to retrieves information on the hardware inside
845the computer it's running on, and on peripherals connected to it, and helps
846you submit that information to the h-node project along with whether the
847hardware works with a fully free operating system or not.")
848 (home-page "https://savannah.nongnu.org/projects/h-source/")
849 (license license:gpl3+))))
850
851(define-public headsetcontrol
852 (package
853 (name "headsetcontrol")
854 (version "3.1.0")
855 (source
856 (origin
857 (method git-fetch)
858 (uri (git-reference
859 (url "https://github.com/Sapd/HeadsetControl")
860 (commit version)))
861 (file-name (git-file-name name version))
862 (sha256
863 (base32 "1i251r2kpac2qac8a3c6iqbzkhlh6mzi4hl62mjknc8cbmhjmdgl"))))
864 (build-system cmake-build-system)
865 (arguments
866 (list
867 #:generator "Ninja"))
868 (inputs
869 (list hidapi))
870 (home-page "https://github.com/Sapd/HeadsetControl")
871 (synopsis "Sidetone and Battery status for USB headsets")
872 (description
873 "Headsetcontrol is a tool to control certain aspects of USB-connected
874headsets. Currently, support is provided for adjusting sidetone, getting
875battery state, controlling LEDs, and setting the inactive time.")
876 (license license:gpl3+)))
877
878(define-public hueplusplus
879 (package
880 (name "hueplusplus")
881 (version "1.1.0")
882 (source
883 (origin
884 (method git-fetch)
885 (uri (git-reference
886 (url "https://github.com/enwi/hueplusplus")
887 (commit (string-append "v" version))))
888 (file-name (git-file-name name version))
889 (sha256
890 (base32 "1jy8m2a0h0kf0aw8jbniz069q9j7cx67b1zlv2vz1ymq921qk0pm"))
891 (patches
892 (search-patches "hueplusplus-mbedtls.patch"))))
893 (build-system cmake-build-system)
894 (arguments
895 `(#:tests? #f)) ;; Tests require Google's gtest and gmock
896 (inputs
897 (list mbedtls-lts))
898 (synopsis "C++ library to control Philips Hue lights")
899 (description "Hueplusplus is a library for controlling Philips Hue lights.
900Features:
901
902@itemize
903@item find bridges with SSDP or set an ip manually
904@item all common light functions (brightness, color, temperature)
905@item extended @code{alert()} functions, which alert in a specific
906color (good for notifications)
907@item supports sensors, rules, groups, scenes and schedules
908@item streaming with entertainment mode
909@item documented with doxygen
910@end itemize")
911 (home-page "https://github.com/enwi/hueplusplus")
912 (license license:lgpl3+)))
913
914(define-public utmp-cli
915 (package
916 (name "utmp-cli")
917 (version "1.063")
918 (source (origin
919 (method git-fetch)
920 (uri (git-reference
921 (url "https://github.com/usbtemp/utmp-cli")
922 (commit version)))
923 (file-name (git-file-name name version))
924 (sha256
925 (base32
926 "07j827nin4wm4hh8ljsj1dj3harb3dxan05ck8n68c443qqakz4a"))))
927 (build-system gnu-build-system)
928 (arguments
929 (list #:tests? #f
930 #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
931 #:phases
932 #~(modify-phases %standard-phases
933 (delete 'configure)
934 (replace 'install
935 (lambda* (#:key outputs #:allow-other-keys)
936 (install-file "utmp-cli"
937 (string-append (assoc-ref outputs "out")
938 "/bin")))))))
939 (home-page "https://github.com/usbtemp/utmp-cli")
940 (synopsis "Read temperature from USB thermometer")
941 (description "Read temperature from usbtemp.com USB thermometer and
942DS9097E compatible 1-wire adapter with one DS18B20 digital probe attached
943through command line interface.")
944 (license license:expat)))
945
946(define-public i7z
947 (let ((revision "0")
948 (commit "1a41ff13db747e962456ddbb5ccb2b7fc43ca0cb"))
949 (package
950 (name "i7z")
951 (version (git-version "0.28" revision commit))
952 (source
953 (origin
954 (method git-fetch)
955 (uri (git-reference
956 (url "https://github.com/afontenot/i7z")
957 (commit commit)))
958 (file-name (git-file-name name version))
959 (sha256
960 (base32 "0jxm63a8y1mfl1sa4mzzfs3bgnym6achj1yc0jglmp05xal16lm1"))
961 (patches
962 (search-patches "i7z-gcc-10.patch"))
963 (modules '((guix build utils)))
964 (snippet
965 '(begin
966 (for-each delete-file-recursively
967 (list "src/GUI"
968 "src/perfmon-i7z"
969 "scripts"))))))
970 (build-system gnu-build-system)
971 (arguments
972 `(#:make-flags
973 (list (string-append "prefix=" (assoc-ref %outputs "out"))
974 (string-append "CC=" ,(cc-for-target)))
975 #:tests? #f ; no test suite
976 #:phases
977 (modify-phases %standard-phases
978 (delete 'configure)))) ; no configure script
979 (inputs
980 (list ncurses))
981 (home-page "https://github.com/afontenot/i7z")
982 (synopsis "Thermal and C-state reporting on older Intel Core CPUs")
983 (description
984 "The @command{i7z} utility accurately measures the current frequency
985and temperature of older Intel Core (i3, i5, and i7) processors including the
986Nehalem, Sandy Bridge, and Ivy Bridge generations. Reliable support for newer
987CPUs is not guaranteed, as this package has not seen significant development
988since 2013.
989
990If your processor is supported, you'll get detailed reports on Turbo Boost and
991clock multipliers, core voltage, and time spent in different C-states. This
992information can be viewed in real time and/or logged to a file.")
993 (supported-systems (list "x86_64-linux"))
994 (license license:gpl2))))
995
996(define-public input-leap
997 (package
998 (name "input-leap")
999 (version "3.0.3")
1000 (source
1001 (origin
1002 (method git-fetch)
1003 (uri (git-reference
1004 (url "https://github.com/input-leap/input-leap")
1005 (commit (string-append "v" version))))
1006 (file-name (git-file-name name version))
1007 (sha256
1008 (base32 "0ngvq1ah6w644qq7v5vg4x7r4sh0s41fyds0g0jkjgycv4las0k4"))))
1009 (build-system qt-build-system)
1010 (arguments
1011 (list
1012 #:qtbase qtbase
1013 #:configure-flags
1014 #~(list "-DINPUTLEAP_USE_EXTERNAL_GTEST=True")))
1015 (native-inputs (list googletest pkg-config qttools))
1016 (inputs (list avahi
1017 libice
1018 libsm
1019 libxi
1020 libxinerama
1021 libxrandr
1022 libxtst
1023 openssl))
1024 (home-page "https://github.com/input-leap/input-leap")
1025 (synopsis "Mimics a @acronym{KVM, Keyboard Video and Mouse} switch")
1026 (description
1027 "Input Leap is software that mimics the functionality of a KVM switch,
1028which historically would allow you to use a single keyboard and mouse to control
1029multiple computers by physically turning a dial on the box to switch the machine
1030you're controlling at any given moment. Input Leap does this in software,
1031allowing you to tell it which machine to control by moving your mouse to the
1032edge of the screen, or by using a keypress to switch focus to a different
1033system.")
1034 (license license:gpl2)))
1035
1036(define-public libsmbios
1037 (package
1038 (name "libsmbios")
1039 (version "2.4.3")
1040 (source
1041 (origin
1042 (method git-fetch)
1043 (uri (git-reference
1044 (url "https://github.com/dell/libsmbios")
1045 (commit (string-append "v" version))))
1046 (file-name (git-file-name name version))
1047 (sha256
1048 (base32 "0krwwydyvb9224r884y1mlmzyxhlfrcqw73vi1j8787rl0gl5a2i"))))
1049 (build-system gnu-build-system)
1050 (native-inputs
1051 (list autoconf
1052 automake
1053 gettext-minimal
1054 libtool
1055 pkg-config
1056 perl
1057 python))
1058 (inputs
1059 (list libxml2))
1060 (arguments
1061 `(#:phases
1062 (modify-phases %standard-phases
1063 (replace 'bootstrap
1064 (lambda _ (invoke "autoreconf" "-vfi"))))))
1065 (synopsis "Library for interacting with Dell SMBIOS tables")
1066 (description
1067 "libsmbios provides a library to interface with the SMBIOS tables. It
1068also provides extensions for proprietary methods of interfacing with Dell
1069specific SMBIOS tables.")
1070 (home-page "https://github.com/dell/libsmbios")
1071 (supported-systems (list "i686-linux" "x86_64-linux"))
1072 (license
1073 (list license:osl2.1 license:gpl2+ license:bsd-3 license:boost1.0))))
1074
1075(define-public liquidctl
1076 (package
1077 (name "liquidctl")
1078 (version "1.16.0")
1079 (source (origin
1080 (method git-fetch)
1081 (uri (git-reference
1082 (url "https://github.com/liquidctl/liquidctl")
1083 (commit (string-append "v" version))))
1084 (file-name (git-file-name name version))
1085 (sha256
1086 (base32
1087 "0i5865wrpkz2cbzs28ngn7qgwiifjb89h0c2qhymg3vhqhywpprl"))))
1088 (build-system pyproject-build-system)
1089 (arguments
1090 (list #:phases
1091 #~(modify-phases %standard-phases
1092 (add-before 'build 'set-runtime-dir
1093 (lambda _
1094 (setenv "XDG_RUNTIME_DIR" "/tmp"))))))
1095 (native-inputs
1096 (list python-pytest
1097 python-setuptools))
1098 (propagated-inputs
1099 (list python-colorlog
1100 python-crcmod
1101 python-docopt
1102 python-hidapi
1103 python-pillow
1104 python-pyusb
1105 python-smbus))
1106 (home-page "https://github.com/liquidctl/liquidctl")
1107 (synopsis "Drivers and tools for liquid cooling equipment")
1108 (description "Liquidctl is a package with tools, drivers and a Python
1109library to work with liquid cooling equipment such as @acronym{AIO, All-In-One}
1110coolers, fan controllers and other devices.")
1111 (license license:gpl3+)))
1112
1113;; Distinct from memtest86, which is obsolete.
1114(define-public memtest86+
1115 (package
1116 (name "memtest86+")
1117 (version "7.20")
1118 (source
1119 (origin
1120 (method git-fetch)
1121 (uri (git-reference
1122 (url "https://github.com/memtest86plus/memtest86plus")
1123 (commit (string-append "v" version))))
1124 (file-name (git-file-name name version))
1125 (sha256
1126 (base32 "0ifly0jbq4xy81mc6k621a8rr0ipjzn7783v2b535s1s55xrz7i5"))
1127 (patches
1128 (search-patches "memtest86+-build-reproducibly.patch"))))
1129 (build-system gnu-build-system)
1130 (arguments
1131 (list
1132 #:tests? #f ; no way to test this
1133 #:phases
1134 #~(modify-phases %standard-phases
1135 (add-after 'unpack 'patch-broken-Makefiles
1136 (lambda _
1137 (substitute* (list "build32/Makefile"
1138 "build64/Makefile")
1139 (("/sbin/(mkdosfs)" _ command)
1140 command))))
1141 (delete 'configure) ; no configure script
1142 (add-before 'build 'enter-build-directory
1143 (lambda _
1144 (chdir #$(if (target-x86-32?)
1145 "build32"
1146 "build64"))))
1147 (replace 'build
1148 (lambda* (#:key inputs make-flags #:allow-other-keys)
1149 (apply invoke
1150 "make" "all" "grub-iso" ; more options than memtest.iso
1151 (string-append "GRUB_FONT_DIR="
1152 (search-input-directory inputs
1153 "share/grub"))
1154 (string-append "GRUB_LIB_DIR="
1155 (search-input-directory inputs
1156 "lib/grub"))
1157 make-flags)))
1158 (replace 'install
1159 (lambda* (#:key outputs #:allow-other-keys)
1160 (let* ((out (assoc-ref outputs "out"))
1161 (lib (string-append out "/lib/memtest86+"))
1162 (doc (string-append out "/share/doc/memtest86+-"
1163 #$version)))
1164 (for-each
1165 (lambda (file)
1166 (install-file file lib))
1167 (list "grub-memtest.iso"
1168 "memtest.bin"
1169 "memtest.efi"))
1170 (chdir "..")
1171 (install-file "README.md" doc)))))))
1172 (native-inputs
1173 (list dosfstools grub-hybrid mtools xorriso))
1174 (supported-systems (list "i686-linux" "x86_64-linux"))
1175 (home-page "https://www.memtest.org/")
1176 (synopsis "Thorough real-mode memory tester")
1177 (description
1178 "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It
1179repeatedly writes different patterns to all memory locations, reads them back
1180again, and verifies whether the result is the same as what was written. This
1181can help debug even intermittent and non-deterministic errors.
1182
1183It runs independently of any operating system, at computer boot-up, so that it
1184can scan as much of your RAM as possible for hardware defects.")
1185 (license license:gpl2)))
1186
1187(define-public memtester
1188 (package
1189 (name "memtester")
1190 (version "4.6.0")
1191 (source
1192 (origin
1193 (method url-fetch)
1194 ;; Even the latest release is available under 'old-versions/'.
1195 (uri (list
1196 (string-append "https://pyropus.ca/software/memtester/old-versions/"
1197 "memtester-" version ".tar.gz")
1198 ;; XXX ‘pyropus.ca’ redirects to ‘pyropus.ca.’. Valid, but wreaks
1199 ;; havoc with Guile's Web stack & TLS verification.
1200 ;; Remove this random mirror when that changes.
1201 (string-append "https://ftp.dimensiondata.com/mirrors/"
1202 "ftp.gentoo.org/distfiles/3e/"
1203 "memtester-" version ".tar.gz")))
1204 (sha256
1205 (base32 "0bmv7n7gj02pda8mwif08xk63xc20r65q1pr099fz30cx2vlxzn9"))))
1206 (build-system gnu-build-system)
1207 (arguments
1208 `(#:make-flags
1209 (list ,(string-append "CC=" (cc-for-target)))
1210 #:phases
1211 (modify-phases %standard-phases
1212 (replace 'configure
1213 ;; This is a home-brewed configuration system where the cc/ld command
1214 ;; lines are stored in one-line files.
1215 (lambda* (#:key outputs #:allow-other-keys)
1216 (let* ((out (assoc-ref outputs "out")))
1217 (substitute* (list "conf-cc" "conf-ld")
1218 (("^cc") "gcc"))
1219 (substitute* "Makefile"
1220 (("(INSTALLPATH.*=).*" _ assignment)
1221 (string-append assignment out)))
1222 #t)))
1223 (replace 'check
1224 ;; There is no test suite. Test some RAM for a single iteration.
1225 (lambda _
1226 (invoke "./memtester" "64K" "1"))))))
1227 (home-page "http://pyropus.ca/software/memtester/")
1228 (synopsis "User-space memory subsystem tester")
1229 (description
1230 "Memtester stress-tests the memory subsystem of your operating system and
1231computer. It repeatedly writes different patterns to all memory locations,
1232reads them back again, and verifies whether the result is the same as what was
1233written. This can help debug even intermittent and non-deterministic errors.
1234
1235Memtester runs entirely in user space. This means that you don't need to reboot
1236to test your memory, but also that it's not possible to test all of the RAM
1237installed in the system.
1238
1239It can also be told to test memory starting at a particular physical address.")
1240 (license license:gpl2)))
1241
1242(define-public msr-tools
1243 (package
1244 (name "msr-tools")
1245 (version "1.3")
1246 (source
1247 (origin
1248 (method url-fetch)
1249 (uri (string-append "https://01.org/sites/default/files/downloads/"
1250 name "/" name "-" version ".zip"))
1251 (sha256
1252 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
1253 (build-system gnu-build-system)
1254 (arguments
1255 `(#:make-flags
1256 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
1257 #:phases
1258 (modify-phases %standard-phases
1259 (delete 'configure) ; no configure script
1260 (add-before 'install 'create-output-directory
1261 (lambda* (#:key outputs #:allow-other-keys)
1262 ;; 'make install' assumes that sbindir exists.
1263 (let* ((out (assoc-ref outputs "out"))
1264 (sbin (string-append out "/sbin")))
1265 (mkdir-p sbin)
1266 #t))))
1267 #:tests? #f)) ; no test suite
1268 (native-inputs
1269 (list unzip))
1270 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
1271 (supported-systems (list "i686-linux" "x86_64-linux"))
1272 (home-page "https://01.org/msr-tools/")
1273 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
1274 (description
1275 "The MSR Tools project provides console utilities to directly access the
1276Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
1277
1278@itemize
1279@item @command{cpuid}: show identification and feature information of any CPU
1280@item @command{rdmsr}: read MSRs from any CPU or all CPUs
1281@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
1282@end itemize
1283
1284These tools can be used to query and modify certain low-level CPU parameters,
1285such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
1286
1287MSR addresses differ (greatly) between processors, and any such modification can
1288be dangerous and may void your CPU or system board's warranty.")
1289 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+
1290
1291(define-public openhmd
1292 (let* ((commit ; Track rift-kalman-filter branch
1293 "04f5276bfc679968ceea62e4d1df6cbe6376941c")
1294 (revision "0")
1295 (version "0.3.0"))
1296 (package
1297 (name "openhmd")
1298 (version (git-version version revision commit))
1299 (source
1300 (origin
1301 (method git-fetch)
1302 (uri (git-reference
1303 ;; Latest official release was in 2019, and development has
1304 ;; largely moved to Monado. However, the Oculus Rift CV1
1305 ;; requires an unofficial fork of OpenHMD to (mostly) work on
1306 ;; Linux, even with Monado.
1307 (url "https://github.com/thaytan/OpenHMD")
1308 (commit commit)))
1309 (file-name (git-file-name name version))
1310 (sha256
1311 (base32 "1bbqwf3682nf14jb76c7qv6h5qxpr1fjj7f308ndivdqss10kzq2"))))
1312 (build-system meson-build-system)
1313 (arguments
1314 (list #:tests? #f)) ; no test target although there is a test folder
1315 (native-inputs (list pkg-config))
1316 (inputs (list glew hidapi libusb opencv))
1317 (home-page "http://www.openhmd.net/")
1318 (synopsis "API and drivers for immersive technology")
1319 (description "OpenHMD aims to provide an API and drivers for immersive
1320technology, such as head mounted displays with built in head tracking.")
1321 (license license:boost1.0))))
1322
1323(define-public openrgb
1324 (package
1325 (name "openrgb")
1326 (version "0.9")
1327 (source
1328 (origin
1329 (method git-fetch)
1330 (uri (git-reference
1331 (url "https://gitlab.com/CalcProgrammer1/OpenRGB")
1332 (commit (string-append "release_" version))))
1333 (file-name (git-file-name name version))
1334 (sha256
1335 (base32 "0rdh87w4j47dr0vakva94fhcbdc67d9aad0p3najg9zf8zhf64jw"))
1336 (patches
1337 (search-patches "openrgb-unbundle-hueplusplus.patch"))
1338 (modules '((guix build utils)))
1339 (snippet
1340 '(begin
1341 ;; Delete many of the bundled libraries.
1342 (for-each delete-file-recursively
1343 (list "dependencies/hidapi-win"
1344 "dependencies/hueplusplus-1.0.0"
1345 "dependencies/json"
1346 "dependencies/libusb-1.0.22"
1347 "dependencies/macUSPCIO"
1348 "dependencies/mbedtls-2.24.0"
1349 "dependencies/NVFC"
1350 "dependencies/openrazer-win32"
1351 "dependencies/winring0"
1352 ;; Some bundled appimages
1353 "scripts/tools"))))))
1354 (build-system qt-build-system)
1355 (arguments
1356 (list
1357 #:tests? #f ; doesn't have tests
1358 #:make-flags
1359 #~(list (string-append "INSTALL_ROOT=" #$output ))
1360 #:modules '((guix build qt-build-system)
1361 ((guix build gnu-build-system) #:prefix gnu:)
1362 (guix build utils))
1363 #:phases
1364 #~(modify-phases %standard-phases
1365 (add-after 'unpack 'unbundle
1366 (lambda* (#:key inputs #:allow-other-keys)
1367 (substitute* "OpenRGB.pro"
1368 (("dependencies/hueplusplus-1.0.0/include/hueplusplus")
1369 (string-append #$(this-package-input "hueplusplus")
1370 "/include/hueplusplus"))
1371 (("dependencies/json")
1372 (string-append #$(this-package-input "nlohmann-json")
1373 "/include/nlohmann")))))
1374 (add-after 'unpack 'patch-chmod
1375 (lambda* (#:key inputs #:allow-other-keys)
1376 (substitute* "scripts/build-udev-rules.sh"
1377 (("/bin/chmod") (string-append (assoc-ref inputs "coreutils")
1378 "/bin/chmod")))))
1379 ;; Call qmake instead of configure to create a Makefile.
1380 (replace 'configure
1381 (lambda _ (invoke "qmake" "PREFIX=/" "OpenRGB.pro")))
1382 (replace 'build (assoc-ref gnu:%standard-phases 'build))
1383 (replace 'install (assoc-ref gnu:%standard-phases 'install)))))
1384 (inputs
1385 (list coreutils
1386 hidapi
1387 hueplusplus
1388 nlohmann-json
1389 libusb
1390 mbedtls-lts
1391 qtbase-5
1392 qtwayland-5))
1393 (native-inputs
1394 (list pkg-config
1395 qttools-5))
1396 (synopsis "RGB lighting control")
1397 (description
1398 "OpenRGB is lighting control that doesn't depend on manufacturer software.
1399ASUS, ASRock, Corsair, G.Skill, Gigabyte, HyperX, MSI, Razer, ThermalTake, and more
1400supported.
1401
1402Features:
1403
1404@itemize
1405@item Set colors and select effect modes for a wide variety of RGB hardware
1406@item Save and load profiles
1407@item Control lighting from third party software using the OpenRGB SDK
1408@item Command line interface
1409@item Connect multiple instances of OpenRGB to synchronize lighting across multiple PCs
1410@item Can operate standalone or in a client/headless server configuration
1411@item View device information
1412@item No official/manufacturer software required
1413@item Graphical view of device LEDs makes creating custom patterns easy
1414@end itemize")
1415 (home-page "https://openrgb.org/")
1416 (license license:gpl2))) ; Included libccmmk is lgpl3+, CRC is bsd-3
1417
1418(define-public wavemon
1419 (package
1420 (name "wavemon")
1421 (version "0.9.7")
1422 (source
1423 (origin
1424 (method git-fetch)
1425 (uri (git-reference
1426 (url "https://github.com/uoaerg/wavemon")
1427 (commit (string-append "v" version))))
1428 (file-name (git-file-name name version))
1429 (sha256
1430 (base32 "0f2x433jqf2469ybdziq50ggqbk3s4mi2i8s997b9lbcvj3nbdrw"))))
1431 (build-system gnu-build-system)
1432 (arguments
1433 (list #:make-flags
1434 #~(list (string-append "CC=" #$(cc-for-target))
1435 ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to
1436 ;; Guix's standard --docdir since it's only used as such.
1437 (string-append "datadir=" (assoc-ref %outputs "out")
1438 "/share/doc/" #$name "-" #$version))
1439 #:tests? #f)) ; no tests
1440 (native-inputs
1441 (list pkg-config))
1442 (inputs
1443 (list libcap libnl ncurses))
1444 (home-page "https://github.com/uoaerg/wavemon")
1445 (synopsis "Wireless network device monitor")
1446 (description
1447 "Wavemon is a wireless device monitor with an interactive ncurses terminal
1448interface. It can display and plot signal and noise levels in real time. It
1449also reports packet statistics, device configuration, network parameters, and
1450access points and other wireless clients of your wireless network hardware.
1451
1452Wavemon should work (with varying levels of detail and features) with any device
1453supported by the Linux kernel.")
1454 ;; Source file headers still say GPL2+, but the authorial intent
1455 ;; (from COPYING and the F9 'about' screen) is clearly GPL3+.
1456 (license license:gpl3+)))
1457
1458(define-public rkdeveloptool
1459 (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
1460 (revision "0"))
1461 (package
1462 (name "rkdeveloptool")
1463 (version (git-version "1.3" revision commit))
1464 (source
1465 (origin
1466 (method git-fetch)
1467 (uri (git-reference
1468 (url "https://github.com/rockchip-linux/rkdeveloptool")
1469 (commit commit)))
1470 (file-name (git-file-name name version))
1471 (sha256
1472 (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))
1473 (snippet
1474 #~(begin
1475 ;; https://github.com/rockchip-linux/rkdeveloptool/pull/57
1476 (use-modules (guix build utils))
1477 (substitute* "main.cpp"
1478 (("snprintf\\(buffer, sizeof\\(buffer\\), \"\\%s\", chip)")
1479 "memccpy(buffer, chip, '\\0', sizeof(buffer))"))))))
1480 (build-system gnu-build-system)
1481 (native-inputs
1482 (list autoconf automake pkg-config))
1483 (inputs
1484 (list libusb))
1485 (home-page "https://github.com/rockchip-linux/rkdeveloptool")
1486 (synopsis "Read from and write to RockChicp devices over USB")
1487 (description
1488 "Rkdeveloptool can read from and write to RockChip devices over USB, such
1489as the Pinebook Pro.")
1490 (license license:gpl2+))))
1491
1492(define-public usbguard
1493 (package
1494 (name "usbguard")
1495 (version "1.1.4")
1496 (source (origin
1497 (method git-fetch)
1498 (uri (git-reference
1499 (url "https://github.com/USBGuard/usbguard")
1500 (commit (string-append "usbguard-" version))))
1501 (file-name (git-file-name name version))
1502 (sha256
1503 (base32 "1a38vmnjkwdxk85zq7mbbl41f0aiz9y1kinvwp17pp6xyn1qz2z0"))))
1504 (build-system gnu-build-system)
1505 (arguments
1506 (list
1507 #:tests? #f ;XXX: sudo: command not found
1508 #:phases
1509 #~(modify-phases %standard-phases
1510 (add-after 'unpack 'patch-bootstrap-script
1511 (lambda _
1512 ;; Don't attempt to fetch git submodules.
1513 (substitute* "autogen.sh"
1514 (("^git submodule.*")
1515 ""))))
1516 (add-after 'bootstrap 'patch-build-scripts
1517 (lambda* (#:key inputs #:allow-other-keys)
1518 (substitute* "configure"
1519 (("/usr/include/catch")
1520 (dirname (search-input-file inputs "include/catch.hpp"))))
1521 ;; Do not create log directory.
1522 (substitute* "Makefile.in" ((".*/log/usbguard.*") ""))
1523 ;; Disable LDAP tests: they use 'sudo'.
1524 (substitute* "src/Tests/Makefile.in"
1525 (("\\$\\(am__append_2\\)") ""))))
1526 (add-after 'install 'delete-static-library
1527 (lambda args
1528 ;; It can't be directly disabled since it's needed for the tests.
1529 (delete-file (string-append #$output
1530 "/lib/libusbguard.a"))))
1531 (add-after 'install 'install-zsh-completion
1532 (lambda args
1533 (let ((site-functions
1534 (string-append #$output "/share/zsh/site-functions")))
1535 (mkdir-p site-functions)
1536 (copy-file "scripts/usbguard-zsh-completion"
1537 (string-append site-functions "/_usbguard"))))))
1538 #:make-flags
1539 #~(list (string-append "BASH_COMPLETION_DIR="
1540 #$output
1541 "/etc/bash_completion.d"))
1542 #:configure-flags
1543 #~(list
1544 "--localstatedir=/var"
1545 "--enable-systemd=no"
1546 "--with-ldap"
1547 "--with-dbus"
1548 "--with-polkit")))
1549 (inputs
1550 (list audit
1551 catch-framework
1552 dbus-glib
1553 openldap
1554 libcap-ng
1555 libseccomp
1556 libsodium
1557 pegtl
1558 polkit
1559 protobuf
1560 libqb))
1561 (native-inputs
1562 (list asciidoc
1563 autoconf
1564 automake
1565 libtool
1566 bash-completion
1567 `(,glib "bin")
1568 umockdev
1569 libxml2
1570 libxslt
1571 pkg-config))
1572 (home-page "https://usbguard.github.io")
1573 (synopsis "Helps to protect your computer against rogue USB devices (a.k.a. BadUSB)")
1574 (description "USBGuard is a software framework for implementing USB device
1575authorization policies (what kind of USB devices are authorized) as well as
1576method of use policies (how a USB device may interact with the system).
1577Simply put, it is a USB device whitelisting tool.")
1578 (license license:gpl2)))
1579
1580(define-public screentest
1581 (package
1582 (name "screentest")
1583 (version "3.0")
1584 (source
1585 (origin
1586 (method git-fetch)
1587 (uri (git-reference
1588 (url "https://github.com/TobiX/screentest")
1589 (commit version)))
1590 (file-name (git-file-name name version))
1591 (sha256
1592 (base32 "00422jbl8l10iw82m9m8sikaa9fwlnj7mgzvmnnazyq383aa1dkm"))))
1593 (build-system meson-build-system)
1594 (inputs (list glib gtk+))
1595 (native-inputs (list gettext-minimal pkg-config))
1596 (synopsis "Simple screen testing tool")
1597 (description
1598 "This is a program for testing the quality of CRT/LCD
1599screens. It displays various patterns and allows you to estimate the quality
1600of your CRT/LCD monitor.")
1601 (home-page "https://github.com/TobiX/screentest")
1602 (license license:gpl2)))
1603
1604(define-public tpm2-tss
1605 (package
1606 (name "tpm2-tss")
1607 (version "3.0.3")
1608 (source
1609 (origin
1610 (method url-fetch)
1611 (uri (string-append "https://github.com/tpm2-software/tpm2-tss"
1612 "/releases/download/" version "/tpm2-tss-" version
1613 ".tar.gz"))
1614 (sha256
1615 (base32 "05xynpwq851fp8f5fy7ac0blvz8mr5m5cbqj3gslgbwv63kjnfbq"))))
1616 (build-system gnu-build-system)
1617 (native-inputs
1618 (list pkg-config))
1619 (inputs
1620 (list curl json-c openssl))
1621 (home-page "https://tpm2-software.github.io/")
1622 (synopsis "OSS Implementation of the TCG TPM2 Software Stack (TSS2)")
1623 (description
1624 "This package provides the @acronym{TCG, Trusted Computing Group}
1625@acronym{TSS2, TPM2 Software Stack}. The stack contains libtss2-fapi,
1626libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm
1627and libtss2-tcti-mssim.")
1628 (license license:bsd-2)))
1629
1630(define-public tpm2-tools
1631 (package
1632 (name "tpm2-tools")
1633 (version "5.7")
1634 (source
1635 (origin
1636 (method url-fetch)
1637 (uri (string-append "https://github.com/tpm2-software/tpm2-tools/"
1638 "releases/download/" version "/"
1639 "tpm2-tools-" version ".tar.gz"))
1640 (sha256
1641 (base32 "0flqf32w7nx2z26m6cf16483pm0k4bi55rbw5x7ny9bra1mx641q"))))
1642 (build-system gnu-build-system)
1643 (native-inputs
1644 (list autoconf
1645 automake
1646 curl
1647 libtool
1648 gettext-minimal
1649 openssl
1650 pandoc
1651 pkg-config
1652 tpm2-tss))
1653 (home-page "https://github.com/tpm2-software/tpm2-tools")
1654 (synopsis "Tools for the Trusted Platform Module (TPM 2.0)")
1655 (description
1656 "This package provides user tools for the Trusted Computing Group's (TCG)
1657TPM2 Software Stack (TSS). These programs help with common tasks such as key
1658management, attestation, encryption, and signing.")
1659 (license license:bsd-3)))
1660
1661(define-public libcpuid
1662 (package
1663 (name "libcpuid")
1664 (version "0.8.0")
1665 (source
1666 (origin
1667 (method git-fetch)
1668 (uri (git-reference
1669 (url "https://github.com/anrieff/libcpuid")
1670 (commit (string-append "v" version))))
1671 (sha256
1672 (base32 "09brfdvv9289cqyq9cd32c8qqyv8cixj06ld8yb8ifi7d4j0zzlv"))
1673 (modules '((guix build utils)))
1674 (snippet
1675 ;; Now remove blobs.
1676 #~(begin
1677 (delete-file "libcpuid/msrdriver.c")
1678 (delete-file-recursively "drivers/x86")))
1679 (file-name (git-file-name name version))))
1680 (build-system cmake-build-system)
1681 (arguments
1682 (list
1683 #:configure-flags #~(list "-DLIBCPUID_ENABLE_TESTS=ON")
1684 #:modules '((guix build cmake-build-system)
1685 ((guix build gnu-build-system) #:prefix gnu:)
1686 (guix build utils))
1687 #:phases
1688 #~(modify-phases %standard-phases
1689 (add-after 'unpack 'absolutize
1690 (lambda* (#:key inputs #:allow-other-keys)
1691 ;; Linux specific
1692 (when #$(target-linux?)
1693 (substitute* '("libcpuid/rdmsr.c"
1694 "libcpuid/rdcpuid.c")
1695 (("modprobe")
1696 (search-input-file inputs "/bin/modprobe"))))
1697 ;; TODO: Build kernel module.
1698 (when (and #$(target-linux?)
1699 #$(target-arm?))
1700 (substitute* "drivers/arm/linux/CMakeLists.txt"
1701 (("/usr/src/") (string-append #$output "/src/"))))))
1702 (replace 'check
1703 (lambda* (#:rest args)
1704 (apply (assoc-ref gnu:%standard-phases 'check)
1705 #:test-target "test" args))))))
1706 (inputs
1707 (append
1708 (if (target-linux?)
1709 (list kmod)
1710 '())
1711 (if (and (target-arm?)
1712 (target-linux?))
1713 (list linux-libre-headers)
1714 '())
1715 '()))
1716 (native-inputs (list python-3)) ;required by tests
1717 (supported-systems
1718 (filter (lambda (t) (or (target-x86-64? t) (target-x86-32? t)
1719 (target-aarch64? t) (target-arm32? t)))
1720 %supported-systems))
1721 (home-page "https://libcpuid.sourceforge.net/")
1722 (synopsis "Small library for x86 CPU detection and feature extraction")
1723 (description "Libcpuid is a small C library to get vendor, model, branding
1724string, code name and other information from x86 CPU. This library is not to be
1725confused with the @code{cpuid} command line utility from package @code{cpuid}.")
1726 (license license:bsd-2)))
1727
1728(define-public liblxi
1729 (package
1730 (name "liblxi")
1731 (version "1.20")
1732 (source
1733 (origin
1734 (method git-fetch)
1735 (uri (git-reference
1736 (url "https://github.com/lxi-tools/liblxi")
1737 (commit (string-append "v" version))))
1738 (file-name (git-file-name name version))
1739 (sha256
1740 (base32 "1cc95ggs64jqq9lk5c8fm4nk6fdnv1x7lr3k4znamj0vv6w22bcd"))))
1741 (build-system meson-build-system)
1742 (native-inputs
1743 (list cmake-minimal pkg-config))
1744 (inputs
1745 (list avahi libtirpc libxml2))
1746 (home-page "https://lxi-tools.github.io/")
1747 (synopsis "@acronym{LXI, LAN eXtensions for Instrumentation} library")
1748 (description
1749 "This library offers a simple API for communicating with instruments
1750compatible with the @acronym{LXI, LAN eXtensions for Instrumentation} standard
1751that defines communication protocols for instrumentation and data acquisition
1752systems using Ethernet. Applications can use liblxi to discover instruments on
1753your network, send SCPI commands, and receive responses.")
1754 (license license:bsd-3)))
1755
1756(define-public lxi-tools
1757 (package
1758 (name "lxi-tools")
1759 (version "2.8")
1760 (source
1761 (origin
1762 (method git-fetch)
1763 (uri (git-reference
1764 (url "https://github.com/lxi-tools/lxi-tools")
1765 (commit (string-append "v" version))))
1766 (file-name (git-file-name name version))
1767 (sha256
1768 (base32
1769 "0xkg1hipixzg5ssfy1k6w0yjsr9qbkv1bhx2xw2pqk9plaj9jrcn"))))
1770 (build-system meson-build-system)
1771 (arguments
1772 (list
1773 #:glib-or-gtk? #true
1774 #:phases
1775 #~(modify-phases %standard-phases
1776 (add-after 'unpack 'skip-gtk-update-icon-cache
1777 (lambda _
1778 (substitute* "build-aux/meson/postinstall.py"
1779 (("gtk4-update-icon-cache") (which "true"))
1780 (("update-desktop-database") (which "true"))))))))
1781 (native-inputs
1782 (list bash-completion
1783 cmake-minimal
1784 (list glib "bin")
1785 pkg-config
1786 python
1787 readline))
1788 (inputs
1789 (list glib
1790 gtk
1791 gtksourceview
1792 json-glib
1793 libadwaita
1794 liblxi
1795 lua))
1796 (home-page "https://lxi-tools.github.io/")
1797 (synopsis "LAN eXtensions for Instrumentation tools")
1798 (description
1799 "This package provides tools for LAN eXtensions for Instrumentation based
1800on the LXI Consortium standard which defines the communication protocols for
1801modern instrumentation and data acquision systems using Ethernet.")
1802 (license license:bsd-3)))
1803
1804(define-public usbrelay
1805 (package
1806 (name "usbrelay")
1807 (version "1.2.1")
1808 (source (origin
1809 (method git-fetch)
1810 (uri (git-reference
1811 (url "https://github.com/darrylb123/usbrelay")
1812 (commit version)))
1813 (file-name (git-file-name name version))
1814 (sha256
1815 (base32
1816 "1xw2fqx4drmkvv587vkz3aicp6pw1mzxr8bjz8wad9j4c0r24cgn"))))
1817 (build-system gnu-build-system)
1818 (arguments
1819 (list
1820 #:phases #~(modify-phases %standard-phases
1821 ;; No configure script.
1822 (delete 'configure)
1823 (add-after 'install 'install-manpage
1824 (lambda _
1825 (install-file "usbrelay.1"
1826 (string-append #$output "/share/man/man1"))))
1827 (add-after 'install-manpage 'install-udev-rules
1828 (lambda _
1829 (install-file "50-usbrelay.rules"
1830 (string-append #$output "/lib/udev/rules.d")))))
1831 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
1832 (string-append "PREFIX=" #$output)
1833 (string-append "LDFLAGS=-Wl,-rpath="
1834 (string-append #$output "/lib"))
1835 "LDCONFIG=true"
1836 (string-append "USBMAJOR=" #$version)
1837 (string-append "USBLIBVER=" #$version)
1838 (string-append "VERSION=" #$version))
1839 ;; No test suite.
1840 #:tests? #f))
1841 (inputs (list hidapi))
1842 (home-page "https://github.com/darrylb123/usbrelay")
1843 (synopsis "Control USB relay modules")
1844 (description
1845 "This is a Linux driver based on hidapi for a variety of inexpensive
1846HID compatible USB relay modules available with different number of
1847output relays.")
1848 (license license:gpl2+)))
1849
1850(define-public python-usbrelay
1851 (package
1852 (inherit usbrelay)
1853 (name "python-usbrelay")
1854 (build-system pyproject-build-system)
1855 (native-inputs
1856 (list python-setuptools))
1857 (inputs
1858 (list usbrelay))
1859 (propagated-inputs
1860 (list python-paho-mqtt))
1861 (arguments
1862 (list
1863 #:phases
1864 #~(modify-phases %standard-phases
1865 (add-after 'unpack 'install-daemon
1866 (lambda _
1867 (install-file "usbrelayd.8"
1868 (string-append #$output "/share/man/man8"))
1869 (install-file "usbrelayd"
1870 (string-append #$output "/sbin"))
1871 (chmod (string-append #$output "/sbin/usbrelayd") #o555)))
1872 (add-after 'install-daemon 'chdir
1873 (lambda _
1874 (chdir "usbrelay_py")))
1875 (replace 'check
1876 (lambda* (#:key tests? #:allow-other-keys)
1877 (when tests?
1878 (invoke "python" "tests/usbrelay_test.py")))))))
1879 (synopsis "Python library to control USB relay modules")
1880 (description
1881 "This is the Python extension to @code{usbrelay}, a Linux driver based on
1882hidapi for a variety of inexpensive HID compatible USB relay modules. This
1883package also includes @code{usbrelayd}.")))
1884
1885(define-public guile-usbrelay
1886 (package
1887 (name "guile-usbrelay")
1888 (version "0.1.1")
1889 (home-page "https://codeberg.org/pisemsky/guile-usbrelay")
1890 (source
1891 (origin
1892 (method git-fetch)
1893 (uri (git-reference
1894 (url home-page)
1895 (commit version)))
1896 (file-name (git-file-name name version))
1897 (sha256
1898 (base32 "1nghzsash3z398p2bp2vw0a1rzaclq9a6iqxbm7ffyzbldcca81l"))))
1899 (build-system guile-build-system)
1900 (arguments
1901 (list
1902 #:source-directory "modules"
1903 #:phases
1904 #~(modify-phases %standard-phases
1905 (add-before 'build 'compile-ffi
1906 (lambda _
1907 (setenv "GUILE_AUTO_COMPILE" "0")
1908 (invoke "guild" "compile-ffi" "--no-exec"
1909 "modules/usbrelay/ffi/hidapi.ffi")))
1910 (add-after 'build 'install-udev-rules
1911 (lambda _
1912 (let ((rules (string-append #$output "/lib/udev/rules.d")))
1913 (mkdir-p rules)
1914 (call-with-output-file (string-append rules "/50-usbrelay.rules")
1915 (lambda (port)
1916 (display (string-append
1917 "ATTRS{idVendor}==\"16c0\", ATTRS{idProduct}==\"05df\", "
1918 "MODE=\"0660\", GROUP=\"usbrelay\"\n") port)))))))))
1919 (native-inputs (list gcc guile-3.0 nyacc pkg-config))
1920 (inputs (list hidapi))
1921 (propagated-inputs (list nyacc))
1922 (synopsis "Control USB HID relays from Guile")
1923 (description
1924 "This package provides a Guile Scheme API to control USB HID relay modules
1925produced by dcttech.")
1926 (license license:lgpl3+)))