Commit | Line | Data |
---|---|---|
aadd1d24 | 1 | ;;; GNU Guix --- Functional package management for GNU |
21724ed9 | 2 | ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
01782ad0 | 3 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> |
aadd1d24 TGR |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
8 | ;;; under the terms of the GNU General Public License as published by | |
9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
10 | ;;; your option) any later version. | |
11 | ;;; | |
12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU General Public License | |
18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | (define-module (gnu packages hardware) | |
22a98cda | 21 | #:use-module (gnu packages autotools) |
aadd1d24 | 22 | #:use-module (gnu packages compression) |
5eff4380 | 23 | #:use-module (gnu packages gcc) |
aadd1d24 TGR |
24 | #:use-module (gnu packages glib) |
25 | #:use-module (gnu packages libusb) | |
26 | #:use-module (gnu packages linux) | |
0ba0ab81 | 27 | #:use-module (gnu packages ncurses) |
aadd1d24 TGR |
28 | #:use-module (gnu packages pkg-config) |
29 | #:use-module (gnu packages xdisorg) | |
30 | #:use-module (gnu packages xorg) | |
31 | #:use-module (guix build-system gnu) | |
32 | #:use-module (guix download) | |
0ba0ab81 | 33 | #:use-module (guix git-download) |
aadd1d24 TGR |
34 | #:use-module ((guix licenses) #:prefix license:) |
35 | #:use-module (guix packages)) | |
36 | ||
37 | ;; This is a module for packages related to physical hardware that don't (yet) | |
38 | ;; have a more specific home like gps.scm, security-token.scm, &c. | |
39 | ||
40 | (define-public ddcutil | |
41 | (package | |
42 | (name "ddcutil") | |
21724ed9 | 43 | (version "0.9.8") |
aadd1d24 TGR |
44 | (source |
45 | (origin | |
46 | (method url-fetch) | |
47 | (uri (string-append "https://www.ddcutil.com/tarballs/" | |
ec756fa5 | 48 | "ddcutil-" version ".tar.gz")) |
aadd1d24 | 49 | (sha256 |
21724ed9 | 50 | (base32 "13ccxbqgyz4ah9jwbcylnfkgl8j3ida8xd00xkcq4xnfyyv5mg6v")))) |
aadd1d24 TGR |
51 | (build-system gnu-build-system) |
52 | (native-inputs | |
53 | `(("pkg-config" ,pkg-config))) | |
54 | (inputs | |
55 | `(("eudev" ,eudev) | |
56 | ("glib" ,glib) | |
57 | ("libdrm" ,libdrm) ; enhanced diagnostics | |
58 | ("libusb" ,libusb) ; support USB monitors | |
59 | ("libx11" ,libx11) ; enhanced diagnostics | |
60 | ("libxrandr" ,libxrandr) | |
61 | ("zlib" ,zlib))) | |
62 | (home-page "https://www.ddcutil.com/") | |
63 | (synopsis "Control external monitor settings") | |
64 | (description | |
65 | "ddcutil can query and modify most external monitors' settings, such as | |
66 | brightness, colour levels, and input sources. Generally speaking, any setting | |
67 | that can be changed by pressing buttons on the monitor can be modified by | |
68 | ddcutil. | |
69 | ||
70 | ddcutil communicates directly with monitors implementing the Monitor Control | |
71 | Command Set (@dfn{MCCS}). It usually does so through the the Display Data | |
72 | Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also | |
73 | communicate over USB as per the USB Monitor Control Class Specification. | |
74 | ||
75 | One particular use case is in colour profile management. Monitor calibration | |
76 | is relative to the monitor colour settings currently in effect, e.g. red gain. | |
77 | ddcutil allows colour-related settings to be saved at the time a monitor is | |
78 | calibrated, and restored when the calibration is applied.") | |
79 | (license (list license:bsd-3 ; FindDDCUtil.cmake | |
80 | license:gpl2+)))) ; everything else | |
6e8c75b8 | 81 | |
5eff4380 TGR |
82 | ;; Distinct from memtest86, which is obsolete. |
83 | (define-public memtest86+ | |
84 | (package | |
85 | (name "memtest86+") | |
86 | ;; Update the description when/if UEFI support is released. | |
87 | (version "5.01") | |
88 | (source | |
89 | (origin | |
90 | (method url-fetch) | |
91 | (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-" | |
92 | version ".tar.gz")) | |
93 | (sha256 | |
94 | (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l")))) | |
95 | (build-system gnu-build-system) | |
96 | (arguments | |
97 | `(#:system "i686-linux" ; the result runs outside of any OS | |
98 | #:tests? #f ; no way to test this | |
99 | #:phases | |
100 | (modify-phases %standard-phases | |
101 | (delete 'configure) ; no configure script | |
102 | (replace 'build | |
103 | ;; The default 'make all' does wonderful things, like scp(1) a file to | |
104 | ;; 192.168.0.12. Build the bootable images and nothing more. | |
105 | (lambda _ | |
106 | (invoke "make" | |
107 | "memtest" ; ELF executable | |
108 | "memtest.bin"))) ; DOS/MBR boot sector | |
109 | (replace 'install | |
110 | (lambda* (#:key outputs #:allow-other-keys) | |
111 | (let* ((out (assoc-ref outputs "out")) | |
112 | (lib (string-append out "/lib/memtest86+")) | |
113 | (doc (string-append out "/share/doc/memtest86+-" ,version))) | |
114 | (for-each | |
115 | (lambda (file) | |
116 | (install-file file lib)) | |
117 | (list "memtest" | |
118 | "memtest.bin")) | |
119 | (for-each | |
120 | (lambda (file) | |
121 | (install-file file doc)) | |
122 | (list "FAQ" | |
fb541251 TGR |
123 | "README")) |
124 | #t)))))) | |
5eff4380 TGR |
125 | (native-inputs |
126 | ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors. | |
127 | `(("gcc" ,gcc-4.9))) | |
128 | (supported-systems (list "i686-linux" "x86_64-linux")) | |
129 | (home-page "https://www.memtest.org/") | |
130 | (synopsis "Thorough real-mode memory tester") | |
131 | (description | |
132 | "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It | |
133 | repeatedly writes different patterns to all memory locations, reads them back | |
134 | again, and verifies whether the result is the same as what was written. This | |
135 | can help debug even intermittent and non-deterministic errors. | |
136 | ||
137 | It runs independently of any operating system, at computer boot-up, so that it | |
138 | can scan as much of your RAM as possible for hardware defects. | |
139 | ||
140 | Memtest86+ cannot currently be used on computers booted with UEFI.") | |
141 | (license license:gpl2))) | |
142 | ||
fb541251 TGR |
143 | (define-public memtester |
144 | (package | |
145 | (name "memtester") | |
146 | (version "4.3.0") | |
147 | (source | |
148 | (origin | |
149 | (method url-fetch) | |
150 | ;; Even the latest release is available under 'old-versions/'. | |
151 | (uri (string-append "http://pyropus.ca/software/memtester/old-versions/" | |
152 | "memtester-" version ".tar.gz")) | |
153 | (sha256 | |
154 | (base32 "127xymmyzb9r6dxqrwd69v7gf8csv8kv7fjvagbglf3wfgyy5pzr")))) | |
155 | (build-system gnu-build-system) | |
156 | (arguments | |
157 | `(#:make-flags | |
158 | (list "CC=gcc") | |
159 | #:phases | |
160 | (modify-phases %standard-phases | |
161 | (replace 'configure | |
162 | ;; This is a home-brewed configuration system where the cc/ld command | |
163 | ;; lines are stored in one-line files. | |
164 | (lambda* (#:key outputs #:allow-other-keys) | |
165 | (let* ((out (assoc-ref outputs "out"))) | |
166 | (substitute* (list "conf-cc" "conf-ld") | |
167 | (("^cc") "gcc")) | |
168 | (substitute* "Makefile" | |
169 | (("(INSTALLPATH.*=).*" _ assignment) | |
170 | (string-append assignment out))) | |
171 | #t))) | |
172 | (replace 'check | |
173 | ;; There is no test suite. Test some RAM for a single iteration. | |
174 | (lambda _ | |
175 | (invoke "./memtester" "64K" "1")))))) | |
176 | (home-page "http://pyropus.ca/software/memtester/") | |
177 | (synopsis "User-space memory subsystem tester") | |
178 | (description | |
179 | "Memtester stress-tests the memory subsystem of your operating system and | |
180 | computer. It repeatedly writes different patterns to all memory locations, | |
181 | reads them back again, and verifies whether the result is the same as what was | |
182 | written. This can help debug even intermittent and non-deterministic errors. | |
183 | ||
184 | Memtester runs entirely in user space. This means that you don't need to reboot | |
185 | to test your memory, but also that it's not possible to test all of the RAM | |
186 | installed in the system. | |
187 | ||
188 | It can also be told to test memory starting at a particular physical address.") | |
189 | (license license:gpl2))) | |
190 | ||
6e8c75b8 TGR |
191 | (define-public msr-tools |
192 | (package | |
193 | (name "msr-tools") | |
194 | (version "1.3") | |
195 | (source | |
196 | (origin | |
197 | (method url-fetch) | |
198 | (uri (string-append "https://01.org/sites/default/files/downloads/" | |
199 | name "/" name "-" version ".zip")) | |
200 | (sha256 | |
201 | (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr")))) | |
202 | (build-system gnu-build-system) | |
203 | (arguments | |
204 | `(#:make-flags | |
205 | (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin")) | |
206 | #:phases | |
207 | (modify-phases %standard-phases | |
208 | (delete 'configure) ; no configure script | |
209 | (add-before 'install 'create-output-directory | |
210 | (lambda* (#:key outputs #:allow-other-keys) | |
211 | ;; 'make install' assumes that sbindir exists. | |
212 | (let* ((out (assoc-ref outputs "out")) | |
213 | (sbin (string-append out "/sbin"))) | |
214 | (mkdir-p sbin) | |
215 | #t)))) | |
216 | #:tests? #f)) ; no test suite | |
217 | (native-inputs | |
218 | `(("unzip" ,unzip))) | |
219 | ;; These registers and the CPUID instruction only exist on (most) x86 chips. | |
220 | (supported-systems (list "i686-linux" "x86_64-linux")) | |
221 | (home-page "https://01.org/msr-tools/") | |
222 | (synopsis "Read and write Model-Specific Registers (@dfn{MSR})") | |
223 | (description | |
224 | "The MSR Tools project provides console utilities to directly access the | |
225 | Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors: | |
226 | ||
227 | @itemize | |
228 | @item @command{cpuid}: show identification and feature information of any CPU | |
229 | @item @command{rdmsr}: read MSRs from any CPU or all CPUs | |
230 | @item @command{wrmsr}: write to MSRs on any CPU or all CPUs | |
231 | @end itemize | |
232 | ||
233 | These tools can be used to query and modify certain low-level CPU parameters, | |
234 | such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits. | |
235 | ||
236 | MSR addresses differ (greatly) between processors, and any such modification can | |
237 | be dangerous and may void your CPU or system board's warranty.") | |
238 | (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+ | |
0ba0ab81 TGR |
239 | |
240 | (define-public wavemon | |
241 | (package | |
242 | (name "wavemon") | |
5976d0b0 | 243 | (version "0.9.1") |
0ba0ab81 TGR |
244 | (source |
245 | (origin | |
246 | (method git-fetch) | |
247 | (uri (git-reference | |
248 | (url "https://github.com/uoaerg/wavemon.git") | |
249 | (commit (string-append "v" version)))) | |
250 | (file-name (git-file-name name version)) | |
251 | (sha256 | |
5976d0b0 | 252 | (base32 "109ycwnjjqc2vpnd8b86njfifczlxglnyv4rh2qmbn2i5nw2wryg")))) |
0ba0ab81 TGR |
253 | (build-system gnu-build-system) |
254 | (arguments | |
255 | `(#:make-flags | |
256 | (list "CC=gcc" | |
257 | ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to Guix's | |
258 | ;; standard --docdir since it's only used as such. | |
259 | (string-append "datadir=" (assoc-ref %outputs "out") | |
260 | "/share/doc/" ,name "-" ,version)) | |
261 | #:tests? #f)) ; no tests | |
262 | (native-inputs | |
263 | `(("pkg-config" ,pkg-config))) | |
264 | (inputs | |
265 | `(("libcap" ,libcap) | |
266 | ("libnl" ,libnl) | |
267 | ("ncurses" ,ncurses))) | |
268 | (home-page "https://github.com/uoaerg/wavemon") | |
269 | (synopsis "Wireless network device monitor") | |
270 | (description | |
271 | "Wavemon is a wireless device monitor with an interactive ncurses terminal | |
272 | interface. It can display and plot signal and noise levels in real time. It | |
273 | also reports packet statistics, device configuration, network parameters, and | |
274 | access points and other wireless clients of your wireless network hardware. | |
275 | ||
276 | Wavemon should work (with varying levels of detail and features) with any device | |
277 | supported by the Linux kernel.") | |
278 | ;; Source file headers still say GPL2+, but the authorial intent | |
279 | ;; (from COPYING and the F9 'about' screen) is clearly GPL3+. | |
280 | (license license:gpl3+))) | |
22a98cda JN |
281 | |
282 | (define-public rkdeveloptool | |
283 | (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3") | |
284 | (revision "0")) | |
285 | (package | |
286 | (name "rkdeveloptool") | |
287 | (version (git-version "1.3" revision commit)) | |
288 | (source | |
289 | (origin | |
290 | (method git-fetch) | |
291 | (uri (git-reference | |
292 | (url "https://github.com/rockchip-linux/rkdeveloptool.git") | |
293 | (commit commit))) | |
294 | (file-name (git-file-name name version)) | |
295 | (sha256 | |
296 | (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga")))) | |
297 | (build-system gnu-build-system) | |
298 | (native-inputs | |
299 | `(("autoconf" ,autoconf) | |
300 | ("automake" ,automake) | |
301 | ("pkg-config" ,pkg-config))) | |
302 | (inputs | |
303 | `(("libusb" ,libusb))) | |
304 | (home-page "https://github.com/rockchip-linux/rkdeveloptool") | |
305 | (synopsis "Read from and write to RockChicp devices over USB") | |
306 | (description | |
307 | "Rkdeveloptool can read from and write to RockChip devices over USB, such | |
308 | as the Pinebook Pro.") | |
309 | (license license:gpl2+)))) |