projects/guix·blob javascript-team · refs

909 lines · 35.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Mark H Weaver <[email protected]>
3;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <[email protected]>
4;;; Copyright © 2016 Hartmut Goebel <[email protected]>
5;;; Copyright © 2016, 2021 Ludovic Courtès <[email protected]>
6;;; Copyright © 2016, 2019 Efraim Flashner <[email protected]>
7;;; Copyright © 2017 Jonathan Brielmaier <[email protected]>
8;;; Copyright © 2017 Julien Lepiller <[email protected]>
9;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2021 Ricardo Wurmus <[email protected]>
11;;; Copyright © 2021 Martin Becze <[email protected]>
12;;; Copyright © 2021 Mathieu Othacehe <[email protected]>
13;;; Copyright © 2022 Peter Polidoro <[email protected]>
14;;; Copyright © 2018, 2022 Danny Milosavljevic <[email protected]>
15;;; Copyright © 2023 B. Wilson <[email protected]>
16;;; Copyright © 2023 Maxim Cournoyer <[email protected]>
17;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
18;;; Copyright © 2024, 2025 Cayetano Santos <[email protected]>
19;;; Copyright © 2025 Joaquín Aguirrezabalaga <[email protected]>
20;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
21;;; Copyright © 2025 Ian Eure <[email protected]>
22;;; Copyright © 2023 Thomas Albers Raviola <[email protected]>
23;;; Copyright © 2021 Vincent Legoll <[email protected]>
24;;; Copyright © 2025 Ashish SHUKLA <[email protected]>
25;;; Copyright © 2026 Cayetano Santos <[email protected]>
26;;; Copyright © 2026 Clément Lassieur <[email protected]>
27;;;
28;;; This file is part of GNU Guix.
29;;;
30;;; GNU Guix is free software; you can redistribute it and/or modify it
31;;; under the terms of the GNU General Public License as published by
32;;; the Free Software Foundation; either version 3 of the License, or (at
33;;; your option) any later version.
34;;;
35;;; GNU Guix is distributed in the hope that it will be useful, but
36;;; WITHOUT ANY WARRANTY; without even the implied warranty of
37;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38;;; GNU General Public License for more details.
39;;;
40;;; You should have received a copy of the GNU General Public License
41;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
42
43(define-module (gnu packages flashing-tools)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix build-system cargo)
46 #:use-module (guix build-system cmake)
47 #:use-module (guix build-system copy)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system go)
50 #:use-module (guix build-system meson)
51 #:use-module (guix build-system pyproject)
52 #:use-module (guix build-system qt)
53 #:use-module (guix download)
54 #:use-module (guix gexp)
55 #:use-module (guix git-download)
56 #:use-module (guix packages)
57 #:use-module (guix utils)
58 #:use-module (gnu packages)
59 #:use-module (gnu packages admin)
60 #:use-module (gnu packages autotools)
61 #:use-module (gnu packages base)
62 #:use-module (gnu packages bash)
63 #:use-module (gnu packages bison)
64 #:use-module (gnu packages boost)
65 #:use-module (gnu packages bootloaders)
66 #:use-module (gnu packages cdrom)
67 #:use-module (gnu packages check)
68 #:use-module (gnu packages compression)
69 #:use-module (gnu packages cpio)
70 #:use-module (gnu packages disk)
71 #:use-module (gnu packages documentation)
72 #:use-module (gnu packages electronics)
73 #:use-module (gnu packages elf)
74 #:use-module (gnu packages embedded)
75 #:use-module (gnu packages compiler-tools)
76 #:use-module (gnu packages ghostscript)
77 #:use-module (gnu packages gnupg)
78 #:use-module (gnu packages golang-xyz)
79 #:use-module (gnu packages graphviz)
80 #:use-module (gnu packages groff)
81 #:use-module (gnu packages libftdi)
82 #:use-module (gnu packages libusb)
83 #:use-module (gnu packages linux)
84 #:use-module (gnu packages mtools)
85 #:use-module (gnu packages pciutils)
86 #:use-module (gnu packages perl)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages python-build)
90 #:use-module (gnu packages qt)
91 #:use-module (gnu packages readline)
92 #:use-module (gnu packages swig)
93 #:use-module (gnu packages textutils)
94 #:use-module (gnu packages tls)
95 #:use-module (gnu packages virtualization)
96 #:use-module (gnu packages xml)
97 #:use-module (srfi srfi-26))
98
99(define-public flashrom
100 (package
101 (name "flashrom")
102 (version "1.8.0")
103 (source
104 (origin
105 (method url-fetch)
106 (uri (string-append
107 "https://download.flashrom.org/releases/flashrom-v"
108 version ".tar.xz"))
109 (sha256
110 (base32
111 "18kmd7b3j1j24220fpiaz606krryqipybl6cnp9hq9awfihrqk35"))))
112 (build-system meson-build-system)
113 (arguments
114 (list
115 #:configure-flags #~'("-Dprogrammer=all")
116 #:phases
117 #~(modify-phases %standard-phases
118 (add-after 'unpack 'fix-path
119 (lambda* (#:key inputs #:allow-other-keys)
120 (substitute* "dmi.c"
121 (("(dmidecode)( 2>/dev/null)" _ command suffix)
122 (string-append
123 (search-input-file
124 inputs (in-vicinity "sbin" command))
125 suffix))))))))
126 (native-inputs
127 (list cmocka pkg-config))
128 (inputs
129 (list bash-minimal dmidecode pciutils libusb libftdi libjaylink))
130 (home-page "https://flashrom.org/")
131 (synopsis "Identify, read, write, erase, and verify ROM/flash chips")
132 (description
133 "flashrom is a utility for identifying, reading, writing,
134verifying and erasing flash chips. It is designed to flash
135BIOS/EFI/coreboot/firmware/optionROM images on mainboards,
136network/graphics/storage controller cards, and various other
137programmer devices.")
138 (license license:gpl2)))
139
140(define-public 0xffff
141 (package
142 (name "0xffff")
143 (version "0.10")
144 (source
145 (origin
146 (method git-fetch)
147 (uri (git-reference
148 (url "https://github.com/pali/0xffff")
149 (commit version)))
150 (file-name (git-file-name name version))
151 (sha256
152 (base32 "1nqbrr64kjr0h3h6gzhrj1vd106nni4y9mhjdr8mh2x9lcgn4fj5"))))
153 (build-system gnu-build-system)
154 (inputs
155 ;; Building with libusb-compat will succeed but the result will be broken.
156 ;; See <https://github.com/pali/0xFFFF/issues/3>.
157 (list libusb-0.1))
158 (arguments
159 (list
160 #:phases #~(modify-phases %standard-phases
161 (delete 'configure)) ;no configure
162 #:make-flags #~(list (string-append "CC="
163 #$(cc-for-target)) "HOST_CC=gcc"
164 "BUILD_DATE=GNU Guix"
165 (string-append "PREFIX=" %output))
166 #:tests? #f)) ;no 'check' target
167 (home-page "https://github.com/pali/0xFFFF")
168 (synopsis "Flash FIASCO images on Maemo devices")
169 (description
170 "The Open Free Fiasco Firmware Flasher (0xFFFF) is a flashing tool
171for FIASCO images. It supports generating, unpacking, editing and
172flashing of FIASCO images for Maemo devices. Use it with care. It can
173brick your device.")
174 (license license:gpl3+)))
175
176(define-public avrdude
177 (package
178 (name "avrdude")
179 (version "8.1")
180 (source
181 (origin
182 (method git-fetch)
183 (uri (git-reference
184 (url "https://github.com/avrdudes/avrdude/")
185 (commit (string-append "v" version))))
186 (file-name (git-file-name name version))
187 (sha256
188 (base32 "1jfz0z8i5vib181f854zwxd8avw5fy59lh3d78igqxwm08sv8nlb"))))
189 (build-system cmake-build-system)
190 (arguments
191 (list #:tests? #f)) ;no tests
192 (inputs
193 (list libelf libusb-compat libftdi libserialport readline))
194 (native-inputs
195 (list bison flex python-wrapper))
196 (home-page "https://www.nongnu.org/avrdude/")
197 (synopsis "AVR downloader and uploader")
198 (description
199 "@code{AVRDUDE} is a utility to download/upload/manipulate the ROM and
200EEPROM contents of AVR microcontrollers using the @acronym{ISP, in-system
201programming} technique.")
202 (license license:gpl2+)))
203
204(define-public dfu-programmer
205 (package
206 (name "dfu-programmer")
207 (version "1.1.0")
208 (source
209 (origin
210 (method git-fetch)
211 (uri (git-reference
212 (url "https://github.com/dfu-programmer/dfu-programmer")
213 (commit (string-append "v" version))))
214 (file-name (git-file-name name version))
215 (sha256
216 (base32
217 "1y9ayl97qdy36bmlcf5vrg85jn72pgx7blgxd1albk79r87q2632"))))
218 (build-system gnu-build-system)
219 (native-inputs
220 (list autoconf automake pkg-config))
221 (inputs
222 (list libusb))
223 (home-page "https://dfu-programmer.github.io/")
224 (synopsis "Device firmware update programmer for Atmel chips")
225 (description
226 "Dfu-programmer is a multi-platform command-line programmer for
227Atmel (8051, AVR, XMEGA & AVR32) chips with a USB bootloader supporting
228ISP.")
229 (license license:gpl2+)))
230
231(define-public dfu-util
232 (package
233 (name "dfu-util")
234 (version "0.11")
235 (source (origin
236 (method url-fetch)
237 (uri (string-append
238 "http://dfu-util.sourceforge.net/releases/dfu-util-"
239 version ".tar.gz"))
240 (sha256
241 (base32
242 "17piiyp08pccqmbhnswv957lkypmmm92kps79hypxvw23ai3pddl"))))
243 (build-system gnu-build-system)
244 (inputs
245 (list libusb))
246 (native-inputs
247 (list pkg-config))
248 (synopsis "Host side of the USB Device Firmware Upgrade (DFU) protocol")
249 (description
250 "The DFU (Universal Serial Bus Device Firmware Upgrade) protocol is
251intended to download and upload firmware to devices connected over USB. It
252ranges from small devices like micro-controller boards up to mobile phones.
253With dfu-util you are able to download firmware to your device or upload
254firmware from it.")
255 (home-page "https://dfu-util.sourceforge.net/")
256 (license license:gpl2+)))
257
258(define-public genimage
259 (package
260 (name "genimage")
261 (version "19")
262 (source
263 (origin
264 (method git-fetch)
265 (uri (git-reference
266 (url "https://github.com/pengutronix/genimage")
267 (commit (string-append "v" version))))
268 (file-name (git-file-name name version))
269 (sha256
270 (base32
271 "1n2d4sziq190saa71ms15h0fbk171kqig1jc6kw35pqs4288pnc5"))))
272 (build-system gnu-build-system)
273 (arguments
274 `(#:modules
275 ((ice-9 match)
276 ,@%default-gnu-imported-modules)
277 #:phases
278 (modify-phases %standard-phases
279 (add-after 'unpack 'guixify
280 (lambda* (#:key inputs #:allow-other-keys)
281 (map (match-lambda
282 ((input directory regexp)
283 (substitute* "config.c"
284 (((format #f "\\.def = \"(~a)\"" regexp) _ command)
285 (string-append ".def = \"" (assoc-ref inputs input)
286 "/" directory "/" command "\"")))))
287 '(("btrfs-progs" "bin" "mkfs.btrfs")
288 ("cpio" "bin" "cpio")
289 ("coreutils" "bin" "dd")
290 ("e2fsprogs" "sbin" "debugfs|e2fsck|mke2fs|tune2fs")
291 ("genext2fs" "bin" "genext2fs")
292 ("cdrkit-libre" "bin" "genisoimage")
293 ("mtools" "bin" "mcopy|mmd")
294 ;; mkcramfs is obsolete.
295 ("dosfstools" "sbin" "mkdosfs")
296 ("mtd-utils" "sbin" "mkfs.(jffs2|ubifs)|ubinize")
297 ("f2fs-tools" "sbin" "(mkfs|sload).f2fs")
298 ("squashfs-tools" "bin" "mksquashfs")
299 ("qemu-minimal" "bin" "qemu-img")
300 ;; rauc and fiptool are unsupported.
301 ("tar" "bin" "tar")
302 ("u-boot-tools" "bin" "mkimage")))
303 (substitute* "util.c"
304 (("\"/bin/sh\"")
305 (string-append "\"" (assoc-ref inputs "bash") "/bin/sh\"")))))
306 (add-before 'check 'fix-failing-tests
307 (lambda _
308 ;; We don't have /etc/passwd so uid 0 is not known as "root".
309 ;; Thus patch it out.
310 (substitute* '("test/ext2test.2.dump"
311 "test/ext3test.2.dump"
312 "test/ext4test.2.dump"
313 "test/ext2test-percent.2.dump"
314 "test/mke2fs.2.dump"
315 "test/mke2fs.3.dump")
316 (("root") "unknown"))))
317 (add-before 'check 'setenv-check
318 (lambda _
319 ;; Our container doesn't provide access to /etc/mtab
320 (setenv "EXT2FS_NO_MTAB_OK" "1")
321 ;; Make test reproducible
322 (setenv "GENIMAGE_MKFJFFS2" "mkfs.jffs2 -U")
323 (setenv "GENIMAGE_MKE2FS" "mke2fs -E no_copy_xattrs")))
324 (replace 'check
325 (lambda _
326 (invoke "make" "TEST_LOG_COMPILER=" "check"))))))
327 (native-inputs
328 (list autoconf
329 automake
330 ;;; Note: cramfs is obsolete.
331 dtc ; for the tests
332 pkg-config
333 util-linux)) ; for the tests
334 (inputs
335 (list bash
336 btrfs-progs
337 cdrkit-libre
338 cpio
339 ;; Note: invoked by final executable.
340 coreutils
341 dosfstools
342 e2fsprogs
343 f2fs-tools
344 genext2fs
345 libconfuse
346 mtd-utils
347 mtools
348 qemu-minimal
349 squashfs-tools
350 tar
351 u-boot-tools))
352 (synopsis "Create Flash images according to specification")
353 (description "@command{genimage} creates Flash images according to a
354specification file.")
355 (home-page "https://github.com/pengutronix/genimage")
356 (license license:gpl2)))
357
358(define-public teensy-loader-cli
359 (package
360 (name "teensy-loader-cli")
361 (version "2.3")
362 (source
363 (origin
364 (method git-fetch)
365 (uri (git-reference
366 (url "https://github.com/PaulStoffregen/teensy_loader_cli")
367 (commit version)))
368 (sha256
369 (base32 "0kqjmbmns3ansmrs6pbpsqk0g4d82hxknpng6lp7375zccsq52im"))
370 (file-name (git-file-name name version))
371 (modules '((guix build utils)))
372 (snippet
373 `(begin
374 ;; Remove example flash files and teensy rebooter flash binaries.
375 (for-each delete-file (find-files "." "\\.(elf|hex)$"))))
376 (patches (search-patches "teensy-loader-cli-help.patch"))))
377 (build-system gnu-build-system)
378 (arguments
379 (list
380 #:tests? #f ;; Makefile has no test target
381 #:make-flags
382 #~(list (string-append "CC=" #$(cc-for-target))
383 (string-append "PREFIX=" #$output))
384 #:phases
385 #~(modify-phases %standard-phases
386 (delete 'configure)
387 (replace 'install
388 (lambda _
389 (install-file "teensy_loader_cli"
390 (string-append #$output "/bin")))))))
391 (inputs
392 (list libusb-compat)) ;only compatible with libusb 0.1
393 (synopsis "Command line firmware uploader for Teensy development boards")
394 (description
395 "The Teensy loader program communicates with your Teensy board when the
396HalfKay bootloader is running, so you can upload new programs and run them.
397
398You need to add the udev rules to make the Teensy update available for
399non-root users.")
400 (home-page "https://www.pjrc.com/teensy/loader_cli.html")
401 (license license:gpl3+)))
402
403(define-public teensy-udev-rules
404 (package
405 (name "teensy-udev-rules")
406 (version "20230913") ;no version whatsoever -- use the current date
407 (source (origin
408 (method url-fetch)
409 (uri "https://www.pjrc.com/teensy/00-teensy.rules")
410 (sha256
411 (base32
412 "1yxczxvwi0s31g7lfa4v13yvvpv6gcsfs7r9mv6y4w9jc1inpx8p"))))
413 (build-system copy-build-system)
414 (arguments
415 (let ((rules-file "lib/udev/rules.d/70-teensy.rules"))
416 (list
417 #:install-plan
418 #~(list `(,#$source #$rules-file))
419 #:phases
420 #~(modify-phases %standard-phases
421 (add-after 'install 'patch-paths
422 (lambda* (#:key inputs #:allow-other-keys)
423 (substitute* (string-append #$output "/" #$rules-file)
424 (("/bin/stty")
425 (search-input-file inputs "bin/stty")))))))))
426 (inputs (list coreutils-minimal))
427 (home-page "https://www.pjrc.com/teensy/loader_cli.html")
428 (synopsis "udev rules for the Teensy family of micro-controllers")
429 (description "This package provides a udev rules file that allows
430unprivileged users communication with the Teensy family of micro-controllers.
431ModemManager (part of NetworkManager) can interfere with USB Serial devices,
432which includes the Teensy. In case of problems, see the @file{.rules} file
433for possible workarounds.")
434 ;; FIXME: The file lacks an explicit license, so the license of
435 ;; teensy-cli-loader is *assumed* to hold (see:
436 ;; https://github.com/PaulStoffregen/teensy_loader_cli/issues/84).
437 (license license:gpl3+)
438 (supported-systems (filter (cut string-suffix? "-linux" <>)
439 %supported-systems))))
440
441(define-public rkflashtool
442 (let ((commit "6022dd724e8247ff7a0825b0eda6a07c446aacdd")
443 (revision "2"))
444 (package
445 (name "rkflashtool")
446 (version (git-version "5.2" revision commit))
447 (source
448 (origin
449 (method git-fetch)
450 (uri (git-reference
451 (url "https://github.com/linux-rockchip/rkflashtool")
452 (commit commit)))
453 (file-name (git-file-name name version))
454 (sha256
455 (base32
456 "0s4zir2s0c3igplj42lq7bq0f0416nf9hrprbxzm87c9mvsdhyvv"))))
457 (build-system gnu-build-system)
458 (arguments
459 (list
460 #:phases
461 #~(modify-phases %standard-phases
462 (delete 'configure)) ; no configure
463 #:make-flags
464 #~(list (string-append "PREFIX=" #$output))
465 #:tests? #f)) ; no tests
466 (native-inputs
467 (list pkg-config))
468 (inputs
469 (list libusb))
470 (home-page "https://github.com/linux-rockchip/rkflashtool")
471 (synopsis "Tools for flashing Rockchip devices")
472 (description "Allows flashing of Rockchip based embedded linux devices.
473The list of currently supported devices is: RK2818, RK2918, RK2928, RK3026,
474RK3036, RK3066, RK312X, RK3168, RK3188, RK3288, RK3368.")
475 (license license:bsd-2))))
476
477(define-public heimdall
478 (package
479 (name "heimdall")
480 (version "2.2.2")
481 (source (origin
482 (method git-fetch)
483 (uri (git-reference
484 (url "https://git.sr.ht/~grimler/Heimdall")
485 (commit (string-append "v" version))))
486 (file-name (git-file-name name version))
487 (sha256
488 (base32
489 "0112hnj6a9gk8ax2mhq7vdi4ky6nzr3mrspz3c28nakck00s3bc1"))))
490 (build-system qt-build-system)
491 (arguments
492 (list
493 #:build-type "Release"
494 #:qtbase qtbase
495 #:tests? #f ; no tests
496 #:phases
497 #~(modify-phases %standard-phases
498 (add-after 'unpack 'patch-invocations
499 (lambda _
500 (substitute* '("heimdall-frontend/source/aboutform.cpp"
501 "heimdall-frontend/source/mainwindow.cpp")
502 (("start[(]\"heimdall\"")
503 (string-append "start(\"" #$output "/bin/heimdall\"")))))
504 (replace 'install
505 (lambda _
506 (install-file "bin/heimdall"
507 (string-append #$output "/bin"))
508 (install-file "bin/heimdall-frontend"
509 (string-append #$output "/bin"))
510 (install-file "libpit/libpit.a"
511 (string-append #$output "/lib")))))))
512 (inputs
513 (list libusb qtwayland zlib))
514 (native-inputs (list pkg-config))
515 (home-page "https://glassechidna.com.au/heimdall/")
516 (synopsis "Flash firmware onto Samsung mobile devices")
517 (description "@command{heimdall} is a tool suite used to flash firmware (aka
518ROMs) onto Samsung mobile devices. Heimdall connects to a mobile device over
519USB and interacts with low-level software running on the device, known as Loke.
520Loke and Heimdall communicate via the custom Samsung-developed protocol typically
521referred to as the \"Odin 3 protocol\".")
522 (license license:expat)))
523
524(define-public me-cleaner
525 (package
526 (name "me-cleaner")
527 (version "1.2")
528 (source
529 (origin
530 (method git-fetch)
531 (uri (git-reference
532 (url "https://github.com/corna/me_cleaner")
533 (commit (string-append "v" version))))
534 (sha256
535 (base32 "1bdj2clm13ir441vn7sv860xsc5gh71ja5lc2wn0gggnff0adxj4"))
536 (file-name (git-file-name name version))))
537 (build-system pyproject-build-system)
538 (arguments
539 (list
540 #:tests? #f ; No tests.
541 #:phases
542 #~(modify-phases %standard-phases
543 (add-after 'install 'install-documentation
544 (lambda _
545 (install-file "man/me_cleaner.1"
546 (string-append #$output "/share/man/man1")))))))
547 (native-inputs (list python-setuptools))
548 (home-page "https://github.com/corna/me_cleaner")
549 (synopsis "Intel ME cleaner")
550 (description
551 "This package provides tools for disabling Intel ME as far as possible
552(it only edits ME firmware image files).")
553 (license license:gpl3+)
554
555 ;; This is an Intel thing.
556 (supported-systems '("x86_64-linux" "i686-linux"))))
557
558(define-public minipro
559 ;; When built from a Git repo, minipro expects GIT_DATE to be set to the
560 ;; value of `git show -s --format=%ci'. When updating the package, run this
561 ;; in a checkout and put the value here.
562 (let* ((date "2025-04-13 21:54:38 -0700"))
563 (package
564 (name "minipro")
565 (version "0.7.3")
566 (source
567 (origin
568 (method git-fetch)
569 (uri (git-reference
570 (url "https://gitlab.com/DavidGriffith/minipro.git")
571 (commit version)))
572 (file-name (git-file-name name version))
573 (sha256
574 (base32 "1525rn5h73xism16vmivd3cz93g8w76h24f0yvbpc35ydc3fkqf7"))))
575 (native-inputs (list pkg-config which))
576 (inputs (list libusb zlib))
577 (build-system gnu-build-system)
578 (arguments
579 (list
580 #:tests? #f ; no test suite
581 #:phases
582 #~(modify-phases %standard-phases
583 (delete 'configure) ; No ./configure script
584 (add-before 'build 'fix-makefile
585 (lambda _
586 ;; Fix some git related variables that minipro expects
587 (substitute* "Makefile"
588 (("GIT_BRANCH = .*")
589 (string-append "GIT_BRANCH = \"master\"\n"))
590 (("GIT_HASH = .*")
591 (string-append "GIT_HASH = \"" #$version "\"\n"))
592 (("GIT_DATE = .*")
593 (string-append "GIT_DATE = \"" #$date "\"\n"))))))
594 #:make-flags
595 #~(list (string-append "VERSION=" #$version)
596 (string-append "PREFIX=" #$output)
597 (string-append "UDEV_DIR=" #$output "/lib/udev")
598 (string-append "COMPLETIONS_DIR=" #$output
599 "/share/bash-completion/completions"))))
600 (synopsis "Controls the TL866xx series of chip programmers")
601 (description
602 "minipro is designed to program or read the contents of
603chips supported by the TL866xx series of programmers. This includes many
604microcontrollers, ROMs, EEPROMs and PLDs.
605
606To use this program without root privileges you must install the necessary udev
607rules. This can be done by extending @code{udev-service-type} in your
608@code{operating-system} configuration with this package. E.g.:
609@code{(udev-rules-service 'minipro minipro #:groups '(\"plugdev\")}.
610Additionally your user must be member of the @code{plugdev} group.")
611 (home-page "https://gitlab.com/DavidGriffith/minipro")
612 (license license:gpl3+))))
613
614(define-public uefitool
615 (package
616 (name "uefitool")
617 (version "0.28.0")
618 (source (origin
619 (method git-fetch)
620 (uri (git-reference
621 (url "https://github.com/LongSoft/UEFITool")
622 (commit version)))
623 (sha256
624 (base32
625 "1n2hd2dysi5bv2iyq40phh1jxc48gdwzs414vfbxvcharcwapnja"))
626 (file-name (git-file-name name version))))
627 (build-system gnu-build-system)
628 (arguments
629 `(#:phases
630 (modify-phases %standard-phases
631 (replace 'configure
632 (lambda _
633 (invoke "qmake" "-makefile")))
634 (replace 'install
635 (lambda* (#:key outputs #:allow-other-keys)
636 (install-file "UEFITool" (string-append (assoc-ref outputs "out")
637 "/bin")))))))
638 (inputs
639 (list qtbase-5))
640 (home-page "https://github.com/LongSoft/UEFITool/")
641 (synopsis "UEFI image editor")
642 (description "@code{uefitool} is a graphical image file editor for
643Unifinished Extensible Firmware Interface (UEFI) images.")
644 (license license:bsd-2)))
645
646(define-public openfpgaloader
647 (package
648 (name "openfpgaloader")
649 (version "1.1.1")
650 (source (origin
651 (method git-fetch)
652 (uri (git-reference
653 (url "https://github.com/trabucayre/openfpgaloader")
654 (commit (string-append "v" version))))
655 (file-name (git-file-name name version))
656 (sha256
657 (base32
658 "00wbf7z5f55422fmqczxc6f7a2lmr52m1qx8m3ky5gl006rkf0sm"))))
659 (build-system cmake-build-system)
660 (native-inputs
661 (list pkg-config))
662 (inputs (list eudev
663 hidapi
664 libftdi
665 libgpiod
666 libusb
667 zlib))
668 (arguments
669 (list #:tests? #f ;no test suite
670 #:phases
671 #~(modify-phases %standard-phases
672 (add-after 'install 'install-rules
673 (lambda _
674 (for-each
675 (lambda (f)
676 (install-file
677 f (string-append #$output "/lib/udev/rules.d/")))
678 (find-files "../source" "\\.rules$")))))))
679 (synopsis "Utility for programming FPGA")
680 (description "This package provides a program to transfer a bitstream
681to an FPGA. To use @code{openfpgaloader} without root privileges it is
682necessary to install the necessary udev rules. This can be done by extending
683@code{udev-service-type} in the @code{operating-system} configuration file with
684this package, as in:
685@lisp
686(udev-rules-service 'openfpgaloader openfpgaloader #:groups '(\"plugdev\")
687@end lisp
688Additionally, the @samp{plugdev} group should be registered in the
689@code{supplementary-groups} field of your @code{user-account} declaration. Refer
690to @samp{info \"(guix) Base Services\"} for examples.")
691 (home-page "https://trabucayre.github.io/openFPGALoader/")
692 (license license:asl2.0)))
693
694(define-public srecord
695 (package
696 (name "srecord")
697 (version "1.65.0")
698 (source
699 (origin
700 (method url-fetch)
701 (uri (string-append "mirror://sourceforge/srecord/srecord/"
702 (version-major+minor version) "/"
703 "srecord-" version "-Source.tar.gz"))
704 (sha256
705 (base32 "0i3n6g8i28xx8761nadm6p2nf9y31bywx0isyi0h9rawy5yd1hw1"))
706 (modules '((guix build utils)))
707 (snippet
708 '(begin
709 ;; Fix building without Git. Upstream tries to allow it but is buggy.
710 (substitute* "etc/configure.cmake"
711 (("\\(GIT_SHA1\\)") "(FALSE)"))
712 ;; It also tries to install the entire RUNTIME_DEPENDENCY_SET of
713 ;; each executable: libm, libc, libstc++ & more! Get the cluehammer.
714 (substitute* "etc/packaging.cmake"
715 ((".*# Find standard library DLL.*" match)
716 "ENDFUNCTION()\n\nFUNCTION(WTF no)\n"))
717 ;; Now stop it from deliberately clobbering -DCMAKE_INSTALL_PREFIX.
718 (substitute* "CMakeLists.txt"
719 (("set\\(CMAKE_INSTALL_PREFIX") "#"))))))
720 (build-system cmake-build-system)
721 (arguments
722 (list
723 #:modules '((guix build cmake-build-system)
724 (guix build utils)
725 (srfi srfi-26))
726 #:phases
727 #~(modify-phases %standard-phases
728 (add-before 'check 'make-tests-executable
729 (lambda _
730 (for-each
731 (cut chmod <> #o755)
732 ;; We're in a parallel build directory to the sources and tests.
733 (find-files ".." "\\.sh$")))))))
734 (inputs
735 (list boost libgcrypt))
736 (native-inputs
737 (list doxygen
738 ghostscript ; for ps2pdf
739 graphviz ; the build scripts call this ‘doxygen’…
740 groff
741 psutils
742 ;; For the tests.
743 diffutils
744 which
745 ;; XXX Work around Guix's currently-broken psutils package. Remove
746 ;; both and maybe (gnu packages perl) when core-updates is merged.
747 perl
748 perl-ipc-run3))
749 (home-page "https://srecord.sourceforge.net/")
750 (synopsis "Tools for EPROM files")
751 (description "The SRecord package is a collection of powerful tools for
752manipulating EPROM load files. It reads and writes numerous EPROM file
753formats, and can perform many different manipulations.")
754 (license license:gpl3+)))
755
756(define-public uuu
757 (package
758 (name "uuu")
759 (version "1.5.233")
760 (source
761 (origin
762 (method git-fetch)
763 (uri (git-reference
764 (url "https://github.com/NXPmicro/mfgtools")
765 (commit (string-append "uuu_" version))))
766 (file-name (git-file-name name version))
767 (sha256
768 (base32
769 "08pck42sywg0ibj79lhd3iv9z6bvr5g5bqvkls477x9x85nbsw67"))))
770 (build-system cmake-build-system)
771 (arguments
772 (list
773 #:tests? #f ; no tests
774 #:modules '((guix build utils)
775 (ice-9 popen)
776 (srfi srfi-26)
777 (guix build cmake-build-system))
778 #:phases
779 #~(modify-phases %standard-phases
780 (add-before 'configure 'fix-version-gen
781 (lambda _
782 (call-with-output-file ".tarball-version"
783 (lambda (port)
784 (display #$version port)))))
785 (add-after 'install 'install-udev-rules
786 (lambda _
787 (let* ((uuu (string-append #$output "/bin/uuu"))
788 (pipe (open-pipe* OPEN_READ uuu "-udev"))
789 (rules
790 (string-append
791 #$output "/lib/udev/rules.d/70-uuu.rules")))
792 (mkdir-p (string-append #$output "/lib/udev/rules.d"))
793 (call-with-output-file rules
794 (cut dump-port pipe <>))))))))
795 (native-inputs
796 (list pkg-config))
797 (inputs
798 (list libusb bzip2 zlib libzip openssl tinyxml2
799 `(,zstd "lib")))
800 (home-page "https://github.com/NXPmicro/mfgtools")
801 (synopsis "Freescale/NXP I.MX chip image deploy tools")
802 (description "@code{uuu} is a command line tool, evolved out of MFGTools.
803It can be used to upload images to I.MX SoC's using at least their boot ROM.")
804 (license license:bsd-3)))
805
806;; The upstream repository has been archived on 2024-08-21,
807;; the replacement Keymapp does not seem to be free software.
808;; Keep it as long as it builds and works and no replacement is in sight.
809(define-public wally-cli
810 (let ((commit "b0fafe52cc7fb9d55f2b968d4548c99917c7325c")
811 (revision "0"))
812 (package
813 (name "wally-cli")
814 (version (git-version "2.0.1" revision commit))
815 (source
816 (origin
817 (method git-fetch)
818 (uri (git-reference
819 (url "https://github.com/zsa/wally-cli")
820 (commit commit)))
821 (sha256
822 (base32 "09phq2g51x7rlalzb87aqf48p3j4s7s5jdf5vdf48l9805hi2yha"))
823 (file-name (git-file-name name version))))
824 (build-system go-build-system)
825 (arguments
826 (list
827 #:install-source? #f
828 #:import-path "github.com/zsa/wally-cli"
829 #:phases
830 #~(modify-phases %standard-phases
831 ;; XXX: Upstream Golang module name was changed from
832 ;; <gopkg.in/cheggaaa/pb.v1> to <github.com/cheggaaa/pb>, adjust
833 ;; references to it accordingly. Remove it in the new release of
834 ;; the package.
835 (add-after 'unpack 'fix-module-name
836 (lambda* (#:key import-path #:allow-other-keys)
837 (with-directory-excursion (string-append "src/" import-path)
838 (substitute* "main.go"
839 (("gopkg.in/cheggaaa/pb.v1") "github.com/cheggaaa/pb"))))))))
840 (native-inputs
841 (list go-github-com-briandowns-spinner
842 go-github-com-google-gousb
843 go-github-com-logrusorgru-aurora
844 go-github-com-marcinbor85-gohex
845 go-github-com-cheggaaa-pb
846 pkg-config))
847 (home-page "https://ergodox-ez.com/pages/wally")
848 (synopsis "Flashing tool for ZSA keyboards")
849 (description
850 "This tool is for flashing custom layouts to
851@url{https://ergodox-ez.com/,ZSA keyboards}.")
852 (license license:expat))))
853
854(define-public wlink
855 (package
856 (name "wlink")
857 (version "0.1.2")
858 (source
859 (origin
860 (method url-fetch)
861 (uri (crate-uri "wlink" version))
862 (file-name (string-append name "-" version ".tar.gz"))
863 (sha256
864 (base32 "03a1f18lhjnajw0hdzi5najh3jx109lih062c63kb5w7szhfqsj2"))))
865 (build-system cargo-build-system)
866 (arguments `(#:install-source? #f))
867 (native-inputs (list pkg-config))
868 (inputs (cons* eudev libusb (cargo-inputs 'wlink)))
869 (home-page "https://github.com/ch32-rs/wlink")
870 (synopsis "Unofficial WCH-Link command line tool")
871 (description
872 "This package is an unofficial command line tool for use with WCH-Link, a
873USB debbuger tool for flashing and debugging WCH RISC-V and ARM
874microcontrollers. This tool is still in development and may not be ready for
875production use.")
876 (license (list license:asl2.0 license:expat))))
877
878(define-public qdl
879 (let ((commit "13681fcb359c9f9c32a17a91d3dd20df2e413b6d")
880 (revision "1"))
881 (package
882 (name "qdl")
883 (version (git-version "1.0" revision commit))
884 (source
885 (origin
886 (method git-fetch)
887 (uri (git-reference
888 (url "https://git.linaro.org/landing-teams/working/qualcomm/qdl.git")
889 (commit commit)))
890 (file-name (git-file-name name version))
891 (sha256
892 (base32 "0m6wdhfwbf7gzlckxx21bvbv33qjahpzqbg1pdqdd1lifx5f51mj"))))
893 (build-system gnu-build-system)
894 (native-inputs (list libxml2))
895 (inputs (list eudev))
896 (arguments
897 (list
898 #:tests? #f ; No tests implemented
899 #:make-flags
900 #~(list (string-append "CC=" #$(cc-for-target))
901 (string-append "prefix=" #$output))
902 #:phases
903 #~(modify-phases %standard-phases
904 (delete 'configure))))
905 (home-page "https://git.linaro.org/landing-teams/working/qualcomm/qdl")
906 (synopsis "Qualcomm EDL mode flashing tool")
907 (description "This tool communicates with USB devices of id 05c6:9008 to
908upload a flash loader and use this to flash images.")
909 (license license:bsd-3))))