projects/guix·blob python-team · refs

910 lines · 35.2 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.7.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 "0kxbydmskyw3kqa01k16k20qd0ny5i477pab6dygwzizhglsqa23"))))
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.1")
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 "08sxn48jljrcily77g8yj89rhzwk0gjrz9lkglgrwl587x6q7sf7"))))
490 (build-system qt-build-system)
491 (arguments
492 `(#:build-type "Release"
493 #:qtbase ,qtbase
494 #:tests? #f ; no tests
495 #:phases
496 (modify-phases %standard-phases
497 (add-after 'unpack 'patch-invocations
498 (lambda* (#:key outputs #:allow-other-keys)
499 (substitute* '("heimdall-frontend/source/aboutform.cpp"
500 "heimdall-frontend/source/mainwindow.cpp")
501 (("start[(]\"heimdall\"")
502 (string-append "start(\"" (assoc-ref outputs "out")
503 "/bin/heimdall\"")))
504 #t))
505 (replace 'install
506 (lambda* (#:key outputs #:allow-other-keys)
507 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
508 (lib (string-append (assoc-ref outputs "out") "/lib")))
509 (install-file "bin/heimdall" bin)
510 (install-file "bin/heimdall-frontend" bin)
511 (install-file "libpit/libpit.a" lib)
512 #t))))))
513 (inputs
514 (list libusb qtwayland zlib))
515 (native-inputs (list pkg-config))
516 (home-page "https://glassechidna.com.au/heimdall/")
517 (synopsis "Flash firmware onto Samsung mobile devices")
518 (description "@command{heimdall} is a tool suite used to flash firmware (aka
519ROMs) onto Samsung mobile devices. Heimdall connects to a mobile device over
520USB and interacts with low-level software running on the device, known as Loke.
521Loke and Heimdall communicate via the custom Samsung-developed protocol typically
522referred to as the \"Odin 3 protocol\".")
523 (license license:expat)))
524
525(define-public me-cleaner
526 (package
527 (name "me-cleaner")
528 (version "1.2")
529 (source
530 (origin
531 (method git-fetch)
532 (uri (git-reference
533 (url "https://github.com/corna/me_cleaner")
534 (commit (string-append "v" version))))
535 (sha256
536 (base32 "1bdj2clm13ir441vn7sv860xsc5gh71ja5lc2wn0gggnff0adxj4"))
537 (file-name (git-file-name name version))))
538 (build-system pyproject-build-system)
539 (arguments
540 (list
541 #:tests? #f ; No tests.
542 #:phases
543 #~(modify-phases %standard-phases
544 (add-after 'install 'install-documentation
545 (lambda _
546 (install-file "man/me_cleaner.1"
547 (string-append #$output "/share/man/man1")))))))
548 (native-inputs (list python-setuptools))
549 (home-page "https://github.com/corna/me_cleaner")
550 (synopsis "Intel ME cleaner")
551 (description
552 "This package provides tools for disabling Intel ME as far as possible
553(it only edits ME firmware image files).")
554 (license license:gpl3+)
555
556 ;; This is an Intel thing.
557 (supported-systems '("x86_64-linux" "i686-linux"))))
558
559(define-public minipro
560 ;; When built from a Git repo, minipro expects GIT_DATE to be set to the
561 ;; value of `git show -s --format=%ci'. When updating the package, run this
562 ;; in a checkout and put the value here.
563 (let* ((date "2025-04-13 21:54:38 -0700"))
564 (package
565 (name "minipro")
566 (version "0.7.3")
567 (source
568 (origin
569 (method git-fetch)
570 (uri (git-reference
571 (url "https://gitlab.com/DavidGriffith/minipro.git")
572 (commit version)))
573 (file-name (git-file-name name version))
574 (sha256
575 (base32 "1525rn5h73xism16vmivd3cz93g8w76h24f0yvbpc35ydc3fkqf7"))))
576 (native-inputs (list pkg-config which))
577 (inputs (list libusb zlib))
578 (build-system gnu-build-system)
579 (arguments
580 (list
581 #:tests? #f ; no test suite
582 #:phases
583 #~(modify-phases %standard-phases
584 (delete 'configure) ; No ./configure script
585 (add-before 'build 'fix-makefile
586 (lambda _
587 ;; Fix some git related variables that minipro expects
588 (substitute* "Makefile"
589 (("GIT_BRANCH = .*")
590 (string-append "GIT_BRANCH = \"master\"\n"))
591 (("GIT_HASH = .*")
592 (string-append "GIT_HASH = \"" #$version "\"\n"))
593 (("GIT_DATE = .*")
594 (string-append "GIT_DATE = \"" #$date "\"\n"))))))
595 #:make-flags
596 #~(list (string-append "VERSION=" #$version)
597 (string-append "PREFIX=" #$output)
598 (string-append "UDEV_DIR=" #$output "/lib/udev")
599 (string-append "COMPLETIONS_DIR=" #$output
600 "/share/bash-completion/completions"))))
601 (synopsis "Controls the TL866xx series of chip programmers")
602 (description
603 "minipro is designed to program or read the contents of
604chips supported by the TL866xx series of programmers. This includes many
605microcontrollers, ROMs, EEPROMs and PLDs.
606
607To use this program without root privileges you must install the necessary udev
608rules. This can be done by extending @code{udev-service-type} in your
609@code{operating-system} configuration with this package. E.g.:
610@code{(udev-rules-service 'minipro minipro #:groups '(\"plugdev\")}.
611Additionally your user must be member of the @code{plugdev} group.")
612 (home-page "https://gitlab.com/DavidGriffith/minipro")
613 (license license:gpl3+))))
614
615(define-public uefitool
616 (package
617 (name "uefitool")
618 (version "0.28.0")
619 (source (origin
620 (method git-fetch)
621 (uri (git-reference
622 (url "https://github.com/LongSoft/UEFITool")
623 (commit version)))
624 (sha256
625 (base32
626 "1n2hd2dysi5bv2iyq40phh1jxc48gdwzs414vfbxvcharcwapnja"))
627 (file-name (git-file-name name version))))
628 (build-system gnu-build-system)
629 (arguments
630 `(#:phases
631 (modify-phases %standard-phases
632 (replace 'configure
633 (lambda _
634 (invoke "qmake" "-makefile")))
635 (replace 'install
636 (lambda* (#:key outputs #:allow-other-keys)
637 (install-file "UEFITool" (string-append (assoc-ref outputs "out")
638 "/bin")))))))
639 (inputs
640 (list qtbase-5))
641 (home-page "https://github.com/LongSoft/UEFITool/")
642 (synopsis "UEFI image editor")
643 (description "@code{uefitool} is a graphical image file editor for
644Unifinished Extensible Firmware Interface (UEFI) images.")
645 (license license:bsd-2)))
646
647(define-public openfpgaloader
648 (package
649 (name "openfpgaloader")
650 (version "1.1.1")
651 (source (origin
652 (method git-fetch)
653 (uri (git-reference
654 (url "https://github.com/trabucayre/openfpgaloader")
655 (commit (string-append "v" version))))
656 (file-name (git-file-name name version))
657 (sha256
658 (base32
659 "00wbf7z5f55422fmqczxc6f7a2lmr52m1qx8m3ky5gl006rkf0sm"))))
660 (build-system cmake-build-system)
661 (native-inputs
662 (list pkg-config))
663 (inputs (list eudev
664 hidapi
665 libftdi
666 libgpiod
667 libusb
668 zlib))
669 (arguments
670 (list #:tests? #f ;no test suite
671 #:phases
672 #~(modify-phases %standard-phases
673 (add-after 'install 'install-rules
674 (lambda _
675 (for-each
676 (lambda (f)
677 (install-file
678 f (string-append #$output "/lib/udev/rules.d/")))
679 (find-files "../source" "\\.rules$")))))))
680 (synopsis "Utility for programming FPGA")
681 (description "This package provides a program to transfer a bitstream
682to an FPGA. To use @code{openfpgaloader} without root privileges it is
683necessary to install the necessary udev rules. This can be done by extending
684@code{udev-service-type} in the @code{operating-system} configuration file with
685this package, as in:
686@lisp
687(udev-rules-service 'openfpgaloader openfpgaloader #:groups '(\"plugdev\")
688@end lisp
689Additionally, the @samp{plugdev} group should be registered in the
690@code{supplementary-groups} field of your @code{user-account} declaration. Refer
691to @samp{info \"(guix) Base Services\"} for examples.")
692 (home-page "https://trabucayre.github.io/openFPGALoader/")
693 (license license:asl2.0)))
694
695(define-public srecord
696 (package
697 (name "srecord")
698 (version "1.65.0")
699 (source
700 (origin
701 (method url-fetch)
702 (uri (string-append "mirror://sourceforge/srecord/srecord/"
703 (version-major+minor version) "/"
704 "srecord-" version "-Source.tar.gz"))
705 (sha256
706 (base32 "0i3n6g8i28xx8761nadm6p2nf9y31bywx0isyi0h9rawy5yd1hw1"))
707 (modules '((guix build utils)))
708 (snippet
709 '(begin
710 ;; Fix building without Git. Upstream tries to allow it but is buggy.
711 (substitute* "etc/configure.cmake"
712 (("\\(GIT_SHA1\\)") "(FALSE)"))
713 ;; It also tries to install the entire RUNTIME_DEPENDENCY_SET of
714 ;; each executable: libm, libc, libstc++ & more! Get the cluehammer.
715 (substitute* "etc/packaging.cmake"
716 ((".*# Find standard library DLL.*" match)
717 "ENDFUNCTION()\n\nFUNCTION(WTF no)\n"))
718 ;; Now stop it from deliberately clobbering -DCMAKE_INSTALL_PREFIX.
719 (substitute* "CMakeLists.txt"
720 (("set\\(CMAKE_INSTALL_PREFIX") "#"))))))
721 (build-system cmake-build-system)
722 (arguments
723 (list
724 #:modules '((guix build cmake-build-system)
725 (guix build utils)
726 (srfi srfi-26))
727 #:phases
728 #~(modify-phases %standard-phases
729 (add-before 'check 'make-tests-executable
730 (lambda _
731 (for-each
732 (cut chmod <> #o755)
733 ;; We're in a parallel build directory to the sources and tests.
734 (find-files ".." "\\.sh$")))))))
735 (inputs
736 (list boost libgcrypt))
737 (native-inputs
738 (list doxygen
739 ghostscript ; for ps2pdf
740 graphviz ; the build scripts call this ‘doxygen’…
741 groff
742 psutils
743 ;; For the tests.
744 diffutils
745 which
746 ;; XXX Work around Guix's currently-broken psutils package. Remove
747 ;; both and maybe (gnu packages perl) when core-updates is merged.
748 perl
749 perl-ipc-run3))
750 (home-page "https://srecord.sourceforge.net/")
751 (synopsis "Tools for EPROM files")
752 (description "The SRecord package is a collection of powerful tools for
753manipulating EPROM load files. It reads and writes numerous EPROM file
754formats, and can perform many different manipulations.")
755 (license license:gpl3+)))
756
757(define-public uuu
758 (package
759 (name "uuu")
760 (version "1.5.233")
761 (source
762 (origin
763 (method git-fetch)
764 (uri (git-reference
765 (url "https://github.com/NXPmicro/mfgtools")
766 (commit (string-append "uuu_" version))))
767 (file-name (git-file-name name version))
768 (sha256
769 (base32
770 "08pck42sywg0ibj79lhd3iv9z6bvr5g5bqvkls477x9x85nbsw67"))))
771 (build-system cmake-build-system)
772 (arguments
773 (list
774 #:tests? #f ; no tests
775 #:modules '((guix build utils)
776 (ice-9 popen)
777 (srfi srfi-26)
778 (guix build cmake-build-system))
779 #:phases
780 #~(modify-phases %standard-phases
781 (add-before 'configure 'fix-version-gen
782 (lambda _
783 (call-with-output-file ".tarball-version"
784 (lambda (port)
785 (display #$version port)))))
786 (add-after 'install 'install-udev-rules
787 (lambda _
788 (let* ((uuu (string-append #$output "/bin/uuu"))
789 (pipe (open-pipe* OPEN_READ uuu "-udev"))
790 (rules
791 (string-append
792 #$output "/lib/udev/rules.d/70-uuu.rules")))
793 (mkdir-p (string-append #$output "/lib/udev/rules.d"))
794 (call-with-output-file rules
795 (cut dump-port pipe <>))))))))
796 (native-inputs
797 (list pkg-config))
798 (inputs
799 (list libusb bzip2 zlib libzip openssl tinyxml2
800 `(,zstd "lib")))
801 (home-page "https://github.com/NXPmicro/mfgtools")
802 (synopsis "Freescale/NXP I.MX chip image deploy tools")
803 (description "@code{uuu} is a command line tool, evolved out of MFGTools.
804It can be used to upload images to I.MX SoC's using at least their boot ROM.")
805 (license license:bsd-3)))
806
807;; The upstream repository has been archived on 2024-08-21,
808;; the replacement Keymapp does not seem to be free software.
809;; Keep it as long as it builds and works and no replacement is in sight.
810(define-public wally-cli
811 (let ((commit "b0fafe52cc7fb9d55f2b968d4548c99917c7325c")
812 (revision "0"))
813 (package
814 (name "wally-cli")
815 (version (git-version "2.0.1" revision commit))
816 (source
817 (origin
818 (method git-fetch)
819 (uri (git-reference
820 (url "https://github.com/zsa/wally-cli")
821 (commit commit)))
822 (sha256
823 (base32 "09phq2g51x7rlalzb87aqf48p3j4s7s5jdf5vdf48l9805hi2yha"))
824 (file-name (git-file-name name version))))
825 (build-system go-build-system)
826 (arguments
827 (list
828 #:install-source? #f
829 #:import-path "github.com/zsa/wally-cli"
830 #:phases
831 #~(modify-phases %standard-phases
832 ;; XXX: Upstream Golang module name was changed from
833 ;; <gopkg.in/cheggaaa/pb.v1> to <github.com/cheggaaa/pb>, adjust
834 ;; references to it accordingly. Remove it in the new release of
835 ;; the package.
836 (add-after 'unpack 'fix-module-name
837 (lambda* (#:key import-path #:allow-other-keys)
838 (with-directory-excursion (string-append "src/" import-path)
839 (substitute* "main.go"
840 (("gopkg.in/cheggaaa/pb.v1") "github.com/cheggaaa/pb"))))))))
841 (native-inputs
842 (list go-github-com-briandowns-spinner
843 go-github-com-google-gousb
844 go-github-com-logrusorgru-aurora
845 go-github-com-marcinbor85-gohex
846 go-github-com-cheggaaa-pb
847 pkg-config))
848 (home-page "https://ergodox-ez.com/pages/wally")
849 (synopsis "Flashing tool for ZSA keyboards")
850 (description
851 "This tool is for flashing custom layouts to
852@url{https://ergodox-ez.com/,ZSA keyboards}.")
853 (license license:expat))))
854
855(define-public wlink
856 (package
857 (name "wlink")
858 (version "0.1.2")
859 (source
860 (origin
861 (method url-fetch)
862 (uri (crate-uri "wlink" version))
863 (file-name (string-append name "-" version ".tar.gz"))
864 (sha256
865 (base32 "03a1f18lhjnajw0hdzi5najh3jx109lih062c63kb5w7szhfqsj2"))))
866 (build-system cargo-build-system)
867 (arguments `(#:install-source? #f))
868 (native-inputs (list pkg-config))
869 (inputs (cons* eudev libusb (cargo-inputs 'wlink)))
870 (home-page "https://github.com/ch32-rs/wlink")
871 (synopsis "Unofficial WCH-Link command line tool")
872 (description
873 "This package is an unofficial command line tool for use with WCH-Link, a
874USB debbuger tool for flashing and debugging WCH RISC-V and ARM
875microcontrollers. This tool is still in development and may not be ready for
876production use.")
877 (license (list license:asl2.0 license:expat))))
878
879(define-public qdl
880 (let ((commit "13681fcb359c9f9c32a17a91d3dd20df2e413b6d")
881 (revision "1"))
882 (package
883 (name "qdl")
884 (version (git-version "1.0" revision commit))
885 (source
886 (origin
887 (method git-fetch)
888 (uri (git-reference
889 (url "https://git.linaro.org/landing-teams/working/qualcomm/qdl.git")
890 (commit commit)))
891 (file-name (git-file-name name version))
892 (sha256
893 (base32 "0m6wdhfwbf7gzlckxx21bvbv33qjahpzqbg1pdqdd1lifx5f51mj"))))
894 (build-system gnu-build-system)
895 (native-inputs (list libxml2))
896 (inputs (list eudev))
897 (arguments
898 (list
899 #:tests? #f ; No tests implemented
900 #:make-flags
901 #~(list (string-append "CC=" #$(cc-for-target))
902 (string-append "prefix=" #$output))
903 #:phases
904 #~(modify-phases %standard-phases
905 (delete 'configure))))
906 (home-page "https://git.linaro.org/landing-teams/working/qualcomm/qdl")
907 (synopsis "Qualcomm EDL mode flashing tool")
908 (description "This tool communicates with USB devices of id 05c6:9008 to
909upload a flash loader and use this to flash images.")
910 (license license:bsd-3))))