1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org>
4 ;;; Copyright © 2016 David Craven <david@craven.ch>
5 ;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018, 2019, 2021 Clément Lassieur <clement@lassieur.org>
8 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
9 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
10 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
11 ;;; Copyright © 2020, 2021, 2022 Simon South <simon@simonsouth.net>
12 ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
13 ;;; Copyright © 2022 Mathieu Othacehe <othacehe@gnu.org>
14 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages embedded)
32 #:use-module (guix utils)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix svn-download)
36 #:use-module (guix git-download)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system python)
41 #:use-module (guix build-system trivial)
42 #:use-module ((guix build utils) #:select (alist-replace delete-file-recursively))
43 #:use-module (gnu packages)
44 #:use-module (gnu packages admin)
45 #:use-module (gnu packages autotools)
46 #:use-module ((gnu packages base) #:prefix base:)
47 #:use-module (gnu packages bison)
48 #:use-module (gnu packages boost)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages cross-base)
52 #:use-module (gnu packages dejagnu)
53 #:use-module (gnu packages flex)
54 #:use-module (gnu packages gcc)
55 #:use-module (gnu packages gdb)
56 #:use-module (gnu packages guile)
57 #:use-module (gnu packages libftdi)
58 #:use-module (gnu packages libusb)
59 #:use-module (gnu packages messaging)
60 #:use-module (gnu packages ncurses)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages pkg-config)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-crypto)
65 #:use-module (gnu packages python-web)
66 #:use-module (gnu packages python-xyz)
67 #:use-module (gnu packages readline)
68 #:use-module (gnu packages swig)
69 #:use-module (gnu packages texinfo)
70 #:use-module (gnu packages version-control)
71 #:use-module (gnu packages xorg)
72 #:use-module (srfi srfi-1))
74 ;; We must not use the released GCC sources here, because the cross-compiler
75 ;; does not produce working binaries. Instead we take the very same SVN
76 ;; revision from the branch that is used for a release of the "GCC ARM
77 ;; embedded" project on launchpad.
78 ;; See https://launchpadlibrarian.net/218827644/release.txt
79 (define-public gcc-arm-none-eabi-4.9
80 (let ((xgcc (cross-gcc "arm-none-eabi"
82 #:xbinutils (cross-binutils "arm-none-eabi")))
84 (svn-revision 227977))
85 (package (inherit xgcc)
86 (version (string-append (package-version xgcc) "-"
87 revision "." (number->string svn-revision)))
92 (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-4_9-branch/")
93 (revision svn-revision)))
94 (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
97 "113r98kygy8rrjfv2pd3z6zlfzbj543pq7xyq8bgh72c608mmsbr"))
99 ;; Remove the one patch that doesn't apply to this 4.9 snapshot (the
100 ;; patch is for 4.9.4 and later but this svn snapshot is older).
101 (patches (remove (lambda (patch)
102 (string=? (basename patch)
103 "gcc-arm-bug-71399.patch"))
104 (origin-patches (package-source xgcc))))))
108 ,@(package-native-inputs xgcc)))
110 (substitute-keyword-arguments (package-arguments xgcc)
112 `(modify-phases ,phases
113 (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
114 (lambda* (#:key inputs #:allow-other-keys)
115 (let ((gcc (assoc-ref inputs "gcc")))
116 ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
117 ;; prevent header conflict with the GCC from native-inputs.
118 (setenv "CPLUS_INCLUDE_PATH"
120 (delete (string-append gcc "/include/c++")
121 (string-split (getenv "CPLUS_INCLUDE_PATH")
125 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
126 (getenv "CPLUS_INCLUDE_PATH"))
128 (add-after 'unpack 'fix-genmultilib
130 (substitute* "gcc/genmultilib"
131 (("#!/bin/sh") (string-append "#!" (which "sh"))))
133 ((#:configure-flags flags)
134 ;; The configure flags are largely identical to the flags used by the
135 ;; "GCC ARM embedded" project.
136 `(append (list "--enable-multilib"
138 "--with-multilib-list=armv6-m,armv7-m,armv7e-m"
139 "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
141 "--disable-decimal-float"
144 "--disable-libmudflap"
145 "--disable-libquadmath"
147 "--disable-libstdcxx-pch"
152 (delete "--disable-multilib" ,flags)))))
154 (list (search-path-specification
155 (variable "CROSS_C_INCLUDE_PATH")
156 (files '("arm-none-eabi/include")))
157 (search-path-specification
158 (variable "CROSS_CPLUS_INCLUDE_PATH")
159 (files '("arm-none-eabi/include"
160 "arm-none-eabi/include/c++"
161 "arm-none-eabi/include/c++/arm-none-eabi")))
162 (search-path-specification
163 (variable "CROSS_LIBRARY_PATH")
164 (files '("arm-none-eabi/lib"))))))))
166 (define-public gcc-arm-none-eabi-6
168 (inherit gcc-arm-none-eabi-4.9)
169 (version (package-version gcc-6))
170 (source (origin (inherit (package-source gcc-6))
173 (origin-patches (package-source gcc-6))
174 (search-patches "gcc-6-cross-environment-variables.patch"
175 "gcc-6-arm-none-eabi-multilib.patch")))))))
177 (define-public newlib-arm-none-eabi
183 (uri (string-append "ftp://sourceware.org/pub/newlib/newlib-"
187 "01i7qllwicf05vsvh39qj7qp5fdifpvvky0x95hjq39mbqiksnsl"))))
188 (build-system gnu-build-system)
190 `(#:out-of-source? #t
191 ;; The configure flags are identical to the flags used by the "GCC ARM
192 ;; embedded" project.
193 #:configure-flags '("--target=arm-none-eabi"
194 "--enable-newlib-io-long-long"
195 "--enable-newlib-register-fini"
196 "--disable-newlib-supplied-syscalls"
199 (modify-phases %standard-phases
200 (add-after 'unpack 'fix-references-to-/bin/sh
202 (substitute* '("libgloss/arm/cpu-init/Makefile.in"
203 "libgloss/arm/Makefile.in"
204 "libgloss/libnosys/Makefile.in"
205 "libgloss/Makefile.in")
206 (("/bin/sh") (which "sh")))
209 `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
210 ("xgcc" ,gcc-arm-none-eabi-4.9)
211 ("texinfo" ,texinfo)))
212 (home-page "https://www.sourceware.org/newlib/")
213 (synopsis "C library for use on embedded systems")
214 (description "Newlib is a C library intended for use on embedded
215 systems. It is a conglomeration of several library parts that are easily
216 usable on embedded products.")
217 (license (license:non-copyleft
218 "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
220 (define-public newlib-nano-arm-none-eabi
221 (package (inherit newlib-arm-none-eabi)
224 (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi)
225 ;; The configure flags are identical to the flags used by the "GCC ARM
226 ;; embedded" project. They optimize newlib for use on small embedded
227 ;; systems with limited memory.
228 ((#:configure-flags flags)
229 ''("--target=arm-none-eabi"
231 "--disable-newlib-supplied-syscalls"
232 "--enable-newlib-reent-small"
233 "--disable-newlib-fvwrite-in-streamio"
234 "--disable-newlib-fseek-optimization"
235 "--disable-newlib-wide-orient"
236 "--enable-newlib-nano-malloc"
237 "--disable-newlib-unbuf-stream-opt"
239 "--enable-newlib-global-atexit"
240 "--enable-newlib-nano-formatted-io"
243 `(modify-phases ,phases
244 ;; XXX: Most arm toolchains offer both *.a and *_nano.a as newlib
245 ;; and newlib-nano respectively. The headers are usually
246 ;; arm-none-eabi/include/newlib.h for newlib and
247 ;; arm-none-eabi/include/newlib-nano/newlib.h for newlib-nano. We
248 ;; have two different toolchain packages for each which works but
249 ;; is a little strange.
250 (add-after 'install 'hardlink-newlib
251 (lambda* (#:key outputs #:allow-other-keys)
252 (let ((out (assoc-ref outputs "out")))
253 ;; The nano.specs file says that newlib-nano files should end
254 ;; in "_nano.a" instead of just ".a". Note that this applies
255 ;; to all the multilib folders too.
260 ;; Strip ".a" off the end
261 (substring file 0 (- (string-length file) 2))
262 ;; Add "_nano.a" onto the end
266 "^(libc.a|libg.a|librdimon.a|libstdc\\+\\+.a|libsupc\\+\\+.a)$"))
268 ;; newlib.h is usually in this location instead so both
269 ;; newlib and newlib-nano can be in the toolchain at the same
271 (mkdir (string-append out "/arm-none-eabi/include/newlib-nano"))
274 (string-append out "/arm-none-eabi/include/newlib-nano/newlib.h"))
276 (synopsis "Newlib variant for small systems with limited memory")))
279 ;;; The following definitions are for the "7-2018-q2-update" variant of the
280 ;;; ARM cross toolchain as offered on https://developer.arm.com
281 (define-public gcc-arm-none-eabi-7-2018-q2-update
282 (let ((xgcc (cross-gcc "arm-none-eabi"
284 #:xbinutils (cross-binutils "arm-none-eabi")))
286 (svn-revision 261907))
287 (package (inherit xgcc)
288 (version (string-append "7-2018-q2-update-"
289 revision "." (number->string svn-revision)))
294 (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch/")
295 (revision svn-revision)))
296 (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
299 "192ggs63bixf3irpijgfkjks73yx1r3a4i6grk1y0i0iny76pmx5"))
302 (origin-patches (package-source gcc-7))
303 (search-patches "gcc-7-cross-environment-variables.patch")))))
305 (modify-inputs (package-native-inputs xgcc)
307 (prepend flex isl-0.18)))
309 (substitute-keyword-arguments (package-arguments xgcc)
311 `(modify-phases ,phases
312 (add-after 'unpack 'expand-version-string
314 (make-file-writable "gcc/DEV-PHASE")
315 (with-output-to-file "gcc/DEV-PHASE"
317 (display "7-2018-q2-update")))
319 (add-after 'unpack 'fix-genmultilib
321 (substitute* "gcc/genmultilib"
322 (("#!/bin/sh") (string-append "#!" (which "sh"))))
324 (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
325 (lambda* (#:key inputs #:allow-other-keys)
326 (let ((gcc (assoc-ref inputs "gcc")))
327 ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
328 ;; prevent header conflict with the GCC from native-inputs.
329 (setenv "CPLUS_INCLUDE_PATH"
331 (delete (string-append gcc "/include/c++")
332 (string-split (getenv "CPLUS_INCLUDE_PATH")
336 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
337 (getenv "CPLUS_INCLUDE_PATH"))
339 ((#:configure-flags flags)
340 ;; The configure flags are largely identical to the flags used by the
341 ;; "GCC ARM embedded" project.
342 `(append (list "--enable-multilib"
344 "--with-multilib-list=rmprofile"
345 "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
347 "--disable-decimal-float"
350 "--disable-libmudflap"
351 "--disable-libquadmath"
353 "--disable-libstdcxx-pch"
358 (delete "--disable-multilib" ,flags)))))
360 (list (search-path-specification
361 (variable "CROSS_C_INCLUDE_PATH")
362 (files '("arm-none-eabi/include")))
363 (search-path-specification
364 (variable "CROSS_CPLUS_INCLUDE_PATH")
365 (files '("arm-none-eabi/include"
366 "arm-none-eabi/include/c++"
367 "arm-none-eabi/include/c++/arm-none-eabi")))
368 (search-path-specification
369 (variable "CROSS_LIBRARY_PATH")
370 (files '("arm-none-eabi/lib"))))))))
372 (define-public newlib-arm-none-eabi-7-2018-q2-update
373 ;; This is the same commit as used for the 7-2018-q2-update release
374 ;; according to the release.txt.
375 (let ((commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4")
378 (inherit newlib-arm-none-eabi)
379 (version (git-version "3.0.0" revision commit))
384 (url "http://sourceware.org/git/newlib-cygwin.git")
386 (file-name (git-file-name "newlib" commit))
389 "1dq23fqrk75g1a4v7569fvnnw5q440zawbxi3w0g05n8jlqsmvcy"))))
391 (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi)
392 ;; The configure flags are identical to the flags used by the "GCC ARM
393 ;; embedded" project.
394 ((#:configure-flags flags)
395 `(cons* "--enable-newlib-io-c99-formats"
396 "--enable-newlib-retargetable-locking"
400 `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
401 ("xgcc" ,gcc-arm-none-eabi-7-2018-q2-update)
402 ("texinfo" ,texinfo))))))
404 (define-public newlib-nano-arm-none-eabi-7-2018-q2-update
405 (package (inherit newlib-arm-none-eabi-7-2018-q2-update)
408 (package-arguments newlib-nano-arm-none-eabi))
409 (synopsis "Newlib variant for small systems with limited memory")))
412 (define (make-libstdc++-arm-none-eabi xgcc newlib)
413 (let ((libstdc++ (make-libstdc++ xgcc)))
414 (package (inherit libstdc++)
415 (name "libstdc++-arm-none-eabi")
417 (substitute-keyword-arguments (package-arguments libstdc++)
418 ((#:configure-flags flags)
419 ``("--target=arm-none-eabi"
420 "--host=arm-none-eabi"
421 "--disable-libstdcxx-pch"
423 "--with-multilib-list=armv6-m,armv7-m,armv7e-m"
428 ,(string-append "--with-gxx-include-dir="
429 (assoc-ref %outputs "out")
430 "/arm-none-eabi/include/c++")))))
434 ,@(package-native-inputs libstdc++))))))
436 (define (arm-none-eabi-toolchain xgcc newlib)
437 "Produce a cross-compiler toolchain package with the compiler XGCC and the C
438 library variant NEWLIB."
439 (let ((newlib-with-xgcc (package (inherit newlib)
441 (alist-replace "xgcc" (list xgcc)
442 (package-native-inputs newlib))))))
444 (name (string-append "arm-none-eabi"
445 (if (string=? (package-name newlib-with-xgcc)
449 (version (package-version xgcc))
451 (build-system trivial-build-system)
453 '(#:modules ((guix build union))
456 (use-modules (ice-9 match)
459 (((names . directories) ...)
460 (union-build (assoc-ref %outputs "out")
464 `(("binutils" ,(cross-binutils "arm-none-eabi"))
465 ("libstdc++" ,(make-libstdc++-arm-none-eabi xgcc newlib-with-xgcc))
467 ("newlib" ,newlib-with-xgcc)))
468 (synopsis "Complete GCC tool chain for ARM bare metal development")
469 (description "This package provides a complete GCC tool chain for ARM
470 bare metal development. This includes the GCC arm-none-eabi cross compiler
471 and newlib (or newlib-nano) as the C library. The supported programming
472 languages are C and C++.")
473 (home-page (package-home-page xgcc))
474 (license (package-license xgcc)))))
476 (define-public arm-none-eabi-toolchain-4.9
477 (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
478 newlib-arm-none-eabi))
480 (define-public arm-none-eabi-nano-toolchain-4.9
481 (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
482 newlib-nano-arm-none-eabi))
484 (define-public arm-none-eabi-toolchain-6
485 (arm-none-eabi-toolchain gcc-arm-none-eabi-6
486 newlib-arm-none-eabi))
488 (define-public arm-none-eabi-nano-toolchain-6
489 (arm-none-eabi-toolchain gcc-arm-none-eabi-6
490 newlib-nano-arm-none-eabi))
492 (define-public arm-none-eabi-toolchain-7-2018-q2-update
493 (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
494 newlib-arm-none-eabi-7-2018-q2-update))
496 (define-public arm-none-eabi-nano-toolchain-7-2018-q2-update
497 (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
498 newlib-nano-arm-none-eabi-7-2018-q2-update))
500 (define-public gdb-arm-none-eabi
503 (name "gdb-arm-none-eabi")
505 `(#:configure-flags '("--target=arm-none-eabi"
508 "--enable-languages=c,c++"
510 ,@(package-arguments gdb)))))
512 (define-public libjaylink
519 (url "https://repo.or.cz/libjaylink.git")
521 (file-name (git-file-name name version))
524 "0ndyfh51hiqyv2yscpj6qd091w7myxxjid3a6rx8f6k233vy826q"))))
525 (build-system gnu-build-system)
527 (list autoconf automake libtool pkg-config))
530 (home-page "https://repo.or.cz/w/libjaylink.git")
531 (synopsis "Library to interface Segger J-Link devices")
532 (description "libjaylink is a shared library written in C to access
533 SEGGER J-Link and compatible devices.")
534 (license license:gpl2+)))
536 (define-public jimtcl
543 (url "https://github.com/msteveb/jimtcl")
545 (file-name (git-file-name name version))
548 "06rn60cx9sapc175vxvan87b8j5rkhh5gvvz7343xznzwlr0wcgk"))))
549 (build-system gnu-build-system)
552 (modify-phases %standard-phases
554 ;; This package doesn't use autoconf.
555 (lambda* (#:key outputs #:allow-other-keys)
556 (let ((out (assoc-ref outputs "out")))
557 (invoke "./configure"
558 (string-append "--prefix=" out)))))
559 (add-before 'check 'delete-failing-tests
561 ;; XXX All but 1 TTY tests fail (Inappropriate ioctl for device).
562 (delete-file "tests/tty.test")
567 (list inetutils)) ; for hostname
568 (home-page "http://jim.tcl.tk/index.html")
569 (synopsis "Small footprint Tcl implementation")
570 (description "Jim is a small footprint implementation of the Tcl programming
572 (license license:bsd-2)))
574 (define-public openocd
581 (url "https://git.code.sf.net/p/openocd/code")
582 (commit (string-append "v" version))))
583 (file-name (string-append name "-" version "-checkout"))
586 "0qi4sixwvw1i7c64sy221fsjs82qf3asmdk86g74ds2jjm3f8pzp"))))
587 (build-system gnu-build-system)
596 (list hidapi jimtcl libftdi libjaylink libusb-compat))
599 (append (list "LIBS=-lutil"
602 "--disable-internal-jimtcl"
603 "--disable-internal-libjaylink")
604 (map (lambda (programmer)
605 (string-append "--enable-" programmer))
606 '("amtjtagaccel" "armjtagew" "buspirate" "ftdi"
607 "gw16012" "jlink" "opendous" "osbdm"
608 "parport" "aice" "cmsis-dap" "dummy" "jtag_vpi"
609 "remote-bitbang" "rlink" "stlink" "ti-icdi" "ulink"
610 "usbprog" "vsllink" "usb-blaster-2" "usb_blaster"
611 "presto" "openjtag" "rshim" "ft232r" "xds110"
612 "cmsis-dap-v2" "nulink" "kitprog" "jtag_dpi"
613 "bcm2835gpio" "imx_gpio" "ep93xx" "at91rm9200"
614 "sysfsgpio" "xlnx-pcie-xvc")))
616 (modify-phases %standard-phases
619 ;; Make build reproducible.
620 (substitute* "src/Makefile.am"
621 (("-DPKGBLDDATE=") "-DDISABLED_PKGBLDDATE="))
622 (patch-shebang "bootstrap")
623 (invoke "./bootstrap" "nosubmodule")))
624 (add-after 'unpack 'change-udev-group
626 (substitute* "contrib/60-openocd.rules"
627 (("plugdev") "dialout"))))
628 (add-after 'install 'install-udev-rules
629 (lambda* (#:key outputs #:allow-other-keys)
630 (install-file "contrib/60-openocd.rules"
632 (assoc-ref outputs "out")
633 "/lib/udev/rules.d/")))))))
634 (home-page "https://openocd.org/")
635 (synopsis "On-Chip Debugger")
636 (description "OpenOCD provides on-chip programming and debugging support
637 with a layered architecture of JTAG interface and TAP support.")
638 (license license:gpl2+)))
640 ;; The commits for all propeller tools are the stable versions published at
641 ;; https://github.com/propellerinc/propgcc in the release_1_0. According to
642 ;; personal correspondence with the developers in July 2017, more recent
643 ;; versions are currently incompatible with the "Simple Libraries".
645 (define propeller-binutils
646 (let ((xbinutils (cross-binutils "propeller-elf"))
647 (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
651 (name "propeller-binutils")
652 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
653 (source (origin (inherit (package-source xbinutils))
656 (url "https://github.com/parallaxinc/propgcc")
658 (file-name (string-append name "-" commit "-checkout"))
661 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))
664 `(;; FIXME: For some reason there are many test failures. It's not
665 ;; obvious how to fix the failures.
668 (modify-phases %standard-phases
669 (add-after 'unpack 'chdir
670 (lambda _ (chdir "binutils") #t)))
671 ,@(substitute-keyword-arguments (package-arguments xbinutils)
672 ((#:configure-flags flags)
673 `(cons "--disable-werror" ,flags)))))
679 ,@(package-native-inputs xbinutils))))))
681 (define-public propeller-gcc-6
682 (let ((xgcc (cross-gcc "propeller-elf"
683 #:xbinutils propeller-binutils))
684 (commit "b4f45a4725e0b6d0af59e594c4e3e35ca4105867")
686 (package (inherit xgcc)
687 (name "propeller-gcc")
688 (version (string-append "6.0.0-" revision "." (string-take commit 9)))
692 (url "https://github.com/totalspectrum/gcc-propeller")
694 (file-name (string-append name "-" commit "-checkout"))
697 "0d9kdxm2fzanjqa7q5850kzbsfl0fqyaahxn74h6nkxxacwa11zb"))
700 (origin-patches (package-source gcc-6))
701 (search-patches "gcc-cross-environment-variables.patch")))))
703 (modify-inputs (package-native-inputs xgcc)
705 ;; All headers and cross libraries of the propeller toolchain are
706 ;; installed under the "propeller-elf" prefix.
708 (list (search-path-specification
709 (variable "CROSS_C_INCLUDE_PATH")
710 (files '("propeller-elf/include")))
711 (search-path-specification
712 (variable "CROSS_LIBRARY_PATH")
713 (files '("propeller-elf/lib")))))
714 (home-page "https://github.com/totalspectrum/gcc-propeller")
715 (synopsis "GCC for the Parallax Propeller"))))
717 (define-public propeller-gcc-4
718 (let ((xgcc propeller-gcc-6)
719 (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
721 (package (inherit xgcc)
722 (name "propeller-gcc")
723 (version (string-append "4.6.1-" revision "." (string-take commit 9)))
727 (url "https://github.com/parallaxinc/propgcc")
729 (file-name (string-append name "-" commit "-checkout"))
732 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))
733 (patch-flags (list "-p1" "--directory=gcc"))
736 (origin-patches (package-source gcc-4.7))
737 (search-patches "gcc-4.6-gnu-inline.patch"
738 "gcc-cross-environment-variables.patch")))))
740 (substitute-keyword-arguments (package-arguments propeller-gcc-6)
742 `(modify-phases ,phases
743 (add-after 'unpack 'chdir
744 (lambda _ (chdir "gcc") #t))))))
747 ,@(package-native-inputs propeller-gcc-6)))
748 (home-page "https://github.com/parallaxinc/propgcc")
749 (supported-systems (delete "aarch64-linux" %supported-systems)))))
751 ;; Version 6 is experimental and may not work correctly. This is why we
752 ;; default to version 4, which is also used in the binary toolchain bundle
753 ;; provided by Parallax Inc.
754 (define-public propeller-gcc propeller-gcc-4)
757 ;; FIXME: We do not build the tiny library because that would require C++
758 ;; headers, which are not available. This may require adding a propeller-elf
759 ;; variant of the libstdc++ package.
760 (define-public proplib
761 (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
765 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
769 (url "https://github.com/parallaxinc/propgcc")
771 (file-name (string-append name "-" commit "-checkout"))
774 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))))
775 (build-system gnu-build-system)
777 `(#:tests? #f ; no tests
779 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
780 (string-append "BUILD=" (getcwd) "/build"))
782 (modify-phases %standard-phases
784 (add-after 'unpack 'chdir
785 (lambda _ (chdir "lib") #t))
786 (add-after 'chdir 'fix-Makefile
788 (substitute* "Makefile"
789 ;; Control the installation time of the headers.
790 ((" install-includes") ""))
792 ;; The Makefile does not separate building from installation, so we
793 ;; have to create the target directories at build time.
794 (add-before 'build 'create-target-directories
795 (lambda* (#:key make-flags #:allow-other-keys)
796 (apply invoke "make" "install-dirs" make-flags)))
797 (add-before 'build 'set-cross-environment-variables
798 (lambda* (#:key outputs #:allow-other-keys)
799 (setenv "CROSS_LIBRARY_PATH"
800 (string-append (assoc-ref outputs "out")
801 "/propeller-elf/lib:"
802 (or (getenv "CROSS_LIBRARY_PATH") "")))
803 (setenv "CROSS_C_INCLUDE_PATH"
804 (string-append (assoc-ref outputs "out")
805 "/propeller-elf/include:"
806 (or (getenv "CROSS_C_INCLUDE_PATH") "")))
808 (add-before 'install 'install-includes
809 (lambda* (#:key make-flags #:allow-other-keys)
810 (apply invoke "make" "install-includes" make-flags))))))
812 (list propeller-gcc propeller-binutils perl))
813 (home-page "https://github.com/parallaxinc/propgcc")
814 (synopsis "C library for the Parallax Propeller")
815 (description "This is a C library for the Parallax Propeller
817 ;; Most of the code is released under the Expat license. Some of the
818 ;; included code is public domain and some changes are BSD licensed.
819 (license license:expat))))
821 (define-public propeller-toolchain
823 (name "propeller-toolchain")
824 (version (package-version propeller-gcc))
826 (build-system trivial-build-system)
827 (arguments '(#:builder (begin (mkdir %output) #t)))
829 `(("binutils" ,propeller-binutils)
831 ("gcc" ,propeller-gcc)))
832 (synopsis "Complete GCC tool chain for Propeller micro-controllers")
833 (description "This package provides a complete GCC tool chain for
834 Propeller micro-controller development.")
835 (home-page (package-home-page propeller-gcc))
836 (license (package-license propeller-gcc))))
838 (define-public openspin
845 (url "https://github.com/parallaxinc/OpenSpin")
847 (file-name (git-file-name name version))
850 "0ghk8hj4717ydhqzx2pfs6737s1cxng6sgg2xgbkwvcfclxdbrd0"))))
851 (build-system gnu-build-system)
853 `(#:tests? #f ; no tests
855 (modify-phases %standard-phases
857 (add-after 'unpack 'remove-timestamp
859 (substitute* "SpinSource/openspin.cpp"
860 ((" Compiled on.*$") "\\n\");"))
862 ;; Makefile does not include "install" target
864 (lambda* (#:key outputs #:allow-other-keys)
865 (let ((bin (string-append (assoc-ref outputs "out")
868 (install-file "build/openspin" bin)
870 (home-page "https://github.com/parallaxinc/OpenSpin")
871 (synopsis "Spin/PASM compiler for the Parallax Propeller")
872 (description "OpenSpin is a compiler for the Spin/PASM language of the
873 Parallax Propeller. It was ported from Chip Gracey's original x86 assembler
875 (license license:expat)))
877 (define-public propeller-load
878 (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
881 (name "propeller-load")
886 (url "https://github.com/parallaxinc/propgcc")
888 (file-name (string-append name "-" commit "-checkout"))
891 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))))
892 (build-system gnu-build-system)
894 `(#:tests? #f ; no tests
897 (string-append "TARGET=" (assoc-ref %outputs "out")))
899 (modify-phases %standard-phases
900 (add-after 'unpack 'chdir
901 (lambda _ (chdir "loader") #t))
902 (delete 'configure))))
904 (list openspin propeller-toolchain))
905 (home-page "https://github.com/parallaxinc/propgcc")
906 (synopsis "Loader for Parallax Propeller micro-controllers")
907 (description "This package provides the tool @code{propeller-load} to
908 upload binaries to a Parallax Propeller micro-controller.")
909 (license license:expat))))
911 (define-public spin2cpp
918 (url "https://github.com/totalspectrum/spin2cpp")
919 (commit (string-append "v" version))))
920 (file-name (git-file-name name version))
923 "0wznqvsckzzz4hdy2rpvj6jqpxw4yn7i0c7zxfm6i46k8gg9327b"))))
924 (build-system gnu-build-system)
926 `(#:tests? #f ;; The tests assume that a micro-controller is connected.
928 (modify-phases %standard-phases
930 (add-before 'build 'set-cross-environment-variables
931 (lambda* (#:key inputs #:allow-other-keys)
932 (setenv "CROSS_LIBRARY_PATH"
933 (string-append (assoc-ref inputs "propeller-toolchain")
934 "/propeller-elf/lib"))
935 (setenv "CROSS_C_INCLUDE_PATH"
936 (string-append (assoc-ref inputs "propeller-toolchain")
937 "/propeller-elf/include"))
940 (lambda* (#:key outputs #:allow-other-keys)
941 (let ((bin (string-append (assoc-ref outputs "out")
943 (for-each (lambda (file)
944 (install-file (string-append "build/" file)
946 '("testlex" "spin2cpp" "fastspin")))
949 (list bison propeller-load propeller-toolchain))
950 (home-page "https://github.com/totalspectrum/spin2cpp")
951 (synopsis "Convert Spin code to C, C++, or PASM code")
952 (description "This is a set of tools for converting the Spin language for
953 the Parallax Propeller micro-controller into C or C++ code, into PASM, or even
954 directly into an executable binary. The binaries produced use LMM PASM, so
955 they are much faster than regular Spin bytecodes (but also quite a bit
957 (license license:expat)))
959 (define-public spinsim
960 (let ((commit "66915a7ad1a3a2cf990a725bb341fab8d11eb620")
964 (version (string-append "0.75-" revision "." (string-take commit 9)))
968 (url "https://github.com/parallaxinc/spinsim")
970 (file-name (string-append name "-" commit "-checkout"))
973 "1n9kdhlxsdx7bz6c80w8dhi96zp633gd6qs0x9i4ii8qv4i7sj5k"))))
974 (build-system gnu-build-system)
976 `(#:tests? #f ; no tests
978 (modify-phases %standard-phases
981 (lambda* (#:key outputs #:allow-other-keys)
982 (let ((bin (string-append (assoc-ref outputs "out")
984 (install-file "build/spinsim" bin))
986 (home-page "https://github.com/parallaxinc/spinsim")
987 (synopsis "Spin simulator")
988 (description "This package provides the tool @code{spinsim}, a simulator
989 and simple debugger for Spin programs written for a Parallax Propeller
990 micro-controller. Spinsim supports execution from cog memory and hub
991 execution, but it does not support multi-tasking. It supports about
992 two-thirds of the opcodes in the P2 instruction set.")
993 (license license:expat))))
995 (define-public propeller-development-suite
997 (name "propeller-development-suite")
998 (version (package-version propeller-gcc))
1000 (build-system trivial-build-system)
1001 (arguments '(#:builder (begin (mkdir %output) #t)))
1003 `(("toolchain" ,propeller-toolchain)
1004 ("openspin" ,openspin)
1005 ("propeller-load" ,propeller-load)
1006 ("spin2cpp" ,spin2cpp)
1007 ("spinsim" ,spinsim)))
1008 (synopsis "Complete development suite for Propeller micro-controllers")
1009 (description "This meta-package provides a complete environment for the
1010 development with Parallax Propeller micro-controllers. It includes the GCC
1011 toolchain, the loader, the Openspin compiler, the Spin2cpp tool, and the Spin
1013 (home-page (package-home-page propeller-gcc))
1014 (license (package-license propeller-gcc))))
1016 (define-public binutils-vc4
1017 (let ((commit "708acc851880dbeda1dd18aca4fd0a95b2573b36"))
1019 (name "binutils-vc4")
1020 (version (string-append "2.23.51-0." (string-take commit 7)))
1024 (url "https://github.com/puppeh/binutils-vc4")
1026 (file-name (string-append name "-" version "-checkout"))
1029 "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63"))))
1030 (build-system gnu-build-system)
1032 `(#:configure-flags '("--target=vc4-elf"
1034 "--enable-cgen-maint")
1036 (modify-phases %standard-phases
1037 (add-after 'unpack 'unpack-cgen
1038 (lambda* (#:key inputs #:allow-other-keys)
1039 (copy-recursively (string-append (assoc-ref inputs "cgen")
1042 (add-after 'unpack-cgen 'fix-cgen-guile
1044 (substitute* "opcodes/Makefile.in"
1045 (("guile\\{,-\\}1.8") "guile"))
1046 (invoke "which" "guile"))))))
1052 (url "https://github.com/puppeh/cgen")
1053 (commit "d8e2a9eb70425f180fdd5bfd032884b0855f2032")))
1056 "14b3h2ji740s8zq5vwm4qdcxs4aa4wxi6wb9di3bv1h39x14nyr9"))))
1057 ("texinfo" ,texinfo)
1060 ("guile-1.8" ,guile-1.8)
1061 ("which" ,base:which)))
1062 (synopsis "Binutils for VC4")
1063 (description "This package provides @code{binutils} for VideoCore IV,
1064 the Raspberry Pi chip.")
1065 (license license:gpl3+)
1066 (home-page "https://github.com/puppeh/vc4-toolchain/"))))
1068 (define-public gcc-vc4
1069 (let ((commit "0fe4b83897341742f9df65797474cb0feab4b377")
1070 (xgcc (cross-gcc "vc4-elf" #:xgcc gcc-6 #:xbinutils binutils-vc4)))
1071 (package (inherit xgcc)
1076 (url "https://github.com/puppeh/gcc-vc4")
1078 (file-name (string-append name
1080 (package-version xgcc)
1084 "0kvaq4s0assvinmmicwqp07d0wwldcw0fv6f4k13whp3q5909jnr"))
1086 (search-patches "gcc-6-fix-buffer-size.patch"
1087 "gcc-6-fix-isl-includes.patch"))))
1089 (modify-inputs (package-native-inputs xgcc)
1091 (synopsis "GCC for VC4")
1092 (description "This package provides @code{gcc} for VideoCore IV,
1093 the Raspberry Pi chip."))))
1095 (define-public python-libmpsse
1097 (name "python-libmpsse")
1103 (url "https://github.com/daym/libmpsse")
1104 (commit (string-append "v" version))))
1105 (file-name "libmpsse-checkout")
1108 "1rypfb96k2szqgygp3jnwg2zq9kwmfz0460dsahn3r2vkzml8wn7"))))
1109 (build-system gnu-build-system)
1111 (list libftdi python))
1113 (list pkg-config swig base:which))
1115 `(#:tests? #f ; No tests exist.
1116 #:parallel-build? #f ; Would be buggy.
1118 (list (string-append "CFLAGS=-Wall -fPIC -fno-strict-aliasing -g -O2 "
1119 "$(shell pkg-config --cflags libftdi1)"))
1121 (modify-phases %standard-phases
1122 (add-after 'unpack 'set-environment-up
1123 (lambda* (#:key inputs outputs #:allow-other-keys)
1124 (let ((python (assoc-ref inputs "python")))
1126 (setenv "PYDEV" (string-append python
1128 ,(version-major+minor (package-version python))))
1131 (lambda* (#:key inputs outputs make-flags #:allow-other-keys #:rest args)
1132 (let* ((out (assoc-ref outputs "out"))
1133 (out-python (string-append out
1135 ,(version-major+minor (package-version python))
1137 (install (assoc-ref %standard-phases 'install)))
1138 (install #:make-flags (cons (string-append "PYLIB=" out-python)
1140 (home-page "https://code.google.com/archive/p/libmpsse/")
1141 (synopsis "Python library for MPSSE SPI I2C JTAG adapter by FTDI")
1142 (description "This package provides a library in order to support the
1143 MPSSE (Multi-Protocol Synchronous Serial Engine) adapter by FTDI that can do
1145 (license license:gpl2+)))
1147 (define-public picprog
1153 (uri (string-append "http://www.iki.fi/hyvatti/pic/picprog-"
1155 (file-name (string-append name "-" version ".tar.gz"))
1158 "1r04hg1n3v2jf915qr05la3q9cxy7a5jnh9cc98j04lh6c9p4x85"))
1159 (patches (search-patches "picprog-non-intel-support.patch"))))
1160 (build-system gnu-build-system)
1162 `(#:tests? #f ; No tests exist.
1164 (modify-phases %standard-phases
1165 (add-after 'unpack 'patch-paths
1166 (lambda* (#:key outputs #:allow-other-keys)
1167 (substitute* "Makefile"
1168 (("/usr/local") (assoc-ref outputs "out"))
1169 ((" -o 0 -g 0 ") " ")
1172 (add-before 'install 'mkdir
1173 (lambda* (#:key outputs #:allow-other-keys)
1174 (let ((out (assoc-ref outputs "out")))
1175 (mkdir-p (string-append out "/bin"))
1176 (mkdir-p (string-append out "/man/man1"))
1178 (delete 'configure))))
1179 (synopsis "Programs Microchip's PIC microcontrollers")
1180 (description "This program programs Microchip's PIC microcontrollers.")
1181 (home-page "https://hyvatti.iki.fi/~jaakko/pic/picprog.html")
1182 (license license:gpl3+)))
1184 (define-public fc-host-tools
1186 (name "fc-host-tools")
1190 (uri (string-append "ftp://ftp.freecalypso.org/pub/GSM/"
1191 "FreeCalypso/fc-host-tools-r" version ".tar.bz2"))
1194 "17v3xc44mmlvp0irwm1p55zdgzd31ic3nsjxnv8y28a1i85103cv"))))
1195 (build-system gnu-build-system)
1197 `(#:tests? #f ; No tests exist.
1199 (list (string-append "INSTALL_PREFIX=" %output)
1200 (string-append "INCLUDE_INSTALL_DIR=" %output "include/rvinterf"))
1202 (modify-phases %standard-phases
1203 (add-after 'unpack 'patch-installation-paths
1204 (lambda* (#:key outputs #:allow-other-keys)
1205 (substitute* (cons* "miscutil/c139explore"
1206 "miscutil/pirexplore"
1207 (find-files "." "^(.*\\.[ch]|Makefile)$"))
1208 (("/opt/freecalypso/bin/fc-simtool")
1210 (("/opt/freecalypso/bin/fc-uicc-tool")
1212 (("/opt/freecalypso/loadtools")
1213 (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools"))
1214 (("\\$\\{INSTALL_PREFIX\\}/loadtools")
1215 (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools"))
1216 (("\\$\\{INSTALL_PREFIX\\}/target-bin")
1217 (string-append (assoc-ref outputs "out") "/lib/freecalypso/target-bin"))
1218 (("/opt/freecalypso")
1219 (assoc-ref outputs "out")))
1221 (delete 'configure))))
1224 (synopsis "Freecalypso host tools")
1225 (description "This package provides some tools for debugging FreeCalypso phones and the FreeCalypso FCDEV3B dev board.
1228 @item fc-e1decode: Decodes a binary Melody E1 file into an ASCII source file.
1229 @item fc-e1gen: Encodes an ASCII Melody E1 file into a binary Melody E1 file.
1230 @item fc-fr2tch: Converts a GSM 06.10 speech recording from libgsm to hex
1231 strings of TCH bits to be fed to the GSM 05.03 channel encoder of a TI
1233 @item fc-tch2fr: Converts hex strings of TCH bits to libgsm.
1234 @item fc-gsm2vm: utility converts a GSM 06.10 speech sample from the libgsm
1235 source format into a voice memo file that can be uploaded into the FFS of a
1236 FreeCalypso device and played with the audio_vm_play_start() API or the
1237 AT@@VMP command that invokes the latter.
1238 @item fc-rgbconv: Convers RGB 5:6:5 to RGB 8:8:8 and vice versa.
1239 @item rvinterf: Communicates with a TI Calypso GSM device via RVTMUX.
1240 @item rvtdump: produces a human-readable dump of all output emitted by a
1241 TI-based GSM fw on the RVTMUX binary packet interface.
1242 @item fc-shell: FreeCalypso firmwares have a feature of our own invention
1243 (not present in any pre-existing ones) to accept AT commands over the RVTMUX
1244 interface. It is useful when no second UART is available for a dedicated
1245 standard AT command interface. fc-shell is the tool that allows you to send
1246 AT commands to the firmware in this manner.
1247 @item fc-memdump: Captures a memory dump from a GSM device.
1248 @item fc-serterm: Trivial serial terminal. Escapes binary chars.
1249 @item fc-fsio: Going through rvinterf, this tool connects to GSM devices and
1250 allows you to manipulate the device's flash file system.
1251 @item tiaud-compile: Compiles an audio mode configuration table for TI's
1252 Audio Service from our own ASCII source format into the binary format for
1253 uploading into FreeCalypso GSM device FFS with fc-fsio.
1254 @item tiaud-decomp: Decodes TI's audio mode configuration files read out of
1255 FFS into our own ASCII format.
1256 @item tiaud-mkvol: Generates the *.vol binary files which need to accompany
1257 the main *.cfg ones.
1258 @item fc-compalram: Allows running programs on the device without writing
1259 them to flash storage.
1260 @item fc-xram: Allows running programs on the device without writing them
1262 @item fc-iram: Allows running programs on the device without writing them
1264 @item fc-loadtool: Writes programs to the device's flash storage.
1265 @item fc-simint: Loads and runs simagent on the phone, then calls fc-simtool
1266 (see @url{https://www.freecalypso.org/hg/fc-sim-tools,fc-sim-tools
1267 repository}) on the host to connect to it.
1268 @item pirffs: Allows listing and extracting FFS content captured as a raw
1269 flash image from Pirelli phones.
1270 @item mokoffs: Allows listing and extracting FFS content captured as a raw
1271 flash image from OpenMoko phones.
1272 @item tiffs: Allows listing and extracting FFS content captured as a raw
1273 flash image from TI phones.
1274 @item c139explore: Run-from-RAM program for C139 phones that
1275 exercises their peripheral hardware: LCD, keypad backlight, buzzer, vibrator.
1276 @item pirexplore: Run-from-RAM program for Pirelli DP-L10 phones that
1277 exercises their peripheral hardware, primarily their LCD.
1278 @item tfc139: Breaks into Mot C1xx phones via shellcode injection, allowing
1279 you to reflash locked phones with new firmware with fc-loadtool.
1280 @item ctracedec: GSM firmwares built in TI's Windows environment have a
1281 compressed trace misfeature whereby many of the ASCII strings
1282 in debug trace messages get replaced with numeric indices at
1283 build time, and these numeric indices are all that gets emitted
1284 on the RVTMUX serial channel. This tools decodes these numeric indices
1285 back to strings in trace output.
1286 @item fc-cal2text: This utility takes a dump of TI's /gsm/rf flash file system
1287 directory subtree as input (either extracted in vitro with tiffs
1288 or read out in vivo with fc-fsio) and converts all RF tables
1289 found therein into a readable ASCII format.
1290 @item imei-luhn: Computes or verifies the Luhn check digit of an IMEI number.
1291 @item fc-dspapidump: Reads and dumps the contents of the DSP API RAM in a
1292 target Calypso GSM device.
1293 @item fc-vm2hex: Converts the old-fashioned (non-AMR) voice memo files read
1294 out of FFS into hex strings.
1295 @item fc-buzplay: Plays piezoelectic buzzer melodies on an actual
1296 Calypso device equipped with such a buzzer (Mot C1xx, TI's D-Sample board,
1297 our planned future HSMBP) by loading a buzplayer agent onto the target and
1298 feeding melodies to be played to it.
1299 @item fc-tmsh: TI-based GSM firmwares provide a rich set of Test Mode commands
1300 that can be issued through the RVTMUX (debug trace) serial channel.
1301 This program is our test mode shell for sending Test Mode commands to targets
1302 and displaying decoded target responses.
1303 @item fcup-smsend: Send a short message via SMS
1304 @item fcup-smsendmult: Send multiple short messages via SMS in one go
1305 @item fcup-smsendpdu: Send multiple short messages given in PDU format via SMS
1306 @item sms-pdu-decode: Decode PDU format messages
1307 @item fc-dspromdump: Dump DSP ROM.
1308 @item pcm-sms-decode: Decode /pcm/SMS binary files read out of FFS maintained
1309 by Pirelli DP-L10. Display the SMS in human-readable form.
1310 @item srec-regions: Parse S-record (TI's *.m0), identify the set of
1311 discontiguous regions into which this SREC image deposits bits, and list
1312 these identified regions.
1314 (home-page "https://www.freecalypso.org/")
1315 (license license:public-domain)))
1317 (define-public stcgal
1322 ;; Neither the unit tests nor the "doc" subdirectory referred to
1323 ;; by stcgal's setup.py is present in the source distribution on
1324 ;; PyPI, so we fetch directly from the project's git repository
1328 (url "https://github.com/grigorig/stcgal")
1329 (commit (string-append "v" version))))
1330 (file-name (git-file-name name version))
1333 "1d10qxyghz66zp7iqpm8q8rfv9jz9n609gxmfcav1lssmf1dlyk3"))
1334 (modules '((guix build utils)))
1336 ;; Make tests compatible with PyYAML 6 and later.
1337 '(substitute* '("tests/test_program.py"
1338 "tests/test_fuzzing.py")
1339 (("yaml\\.load\\(test_file\\.read\\(\\)\\)")
1340 "yaml.load(test_file.read(), Loader=yaml.SafeLoader)")))))
1341 (build-system python-build-system)
1343 (list python-pyserial python-pyusb python-tqdm))
1346 (list python-pyyaml))
1347 (home-page "https://github.com/grigorig/stcgal")
1348 (synopsis "Programmer for STC 8051-compatible microcontrollers")
1349 (description "stcgal is a command-line flash-programming tool for STC
1350 MCU's line of Intel 8051-compatible microcontrollers, including those in the
1351 STC89, STC90, STC10, STC11, STC12, STC15 and STC8 series.")
1352 (license license:expat)))
1354 (define-public stlink
1362 (url "https://github.com/stlink-org/stlink")
1363 (commit (string-append "v" version))))
1364 (file-name (git-file-name name version))
1367 "03xypffpbp4imrczbxmq69vgkr7mbp0ps9dk815br5wwlz6vgygl"))))
1368 (build-system cmake-build-system)
1370 `(#:tests? #f ;no tests
1372 (let* ((out (assoc-ref %outputs "out"))
1373 (etc (in-vicinity out "etc"))
1374 (modprobe (in-vicinity etc "modprobe.d"))
1375 (udev-rules (in-vicinity etc "udev/rules.d")))
1376 (list (string-append "-DSTLINK_UDEV_RULES_DIR=" udev-rules)
1377 (string-append "-DSTLINK_MODPROBED_DIR=" modprobe)))))
1380 (synopsis "Programmer for STM32 Discovery boards")
1381 (description "This package provides a firmware programmer for the STM32
1382 Discovery boards. It supports two versions of the chip: ST-LINK/V1 (on
1383 STM32VL discovery kits) and ST-LINK/V2 (on STM32L discovery and later kits).
1384 Two different transport layers are used: ST-LINK/V1 uses SCSI passthru
1385 commands over USB, and ST-LINK/V2 and ST-LINK/V2-1 (seen on Nucleo boards) use
1387 (home-page "https://github.com/stlink-org/stlink")
1388 ;; The flashloaders/stm32l0x.s and flashloaders/stm32lx.s source files are
1389 ;; licensed under the GPLv2+.
1390 (license (list license:bsd-3 license:gpl2+))))
1399 (uri (pypi-uri "west" version))
1402 "1hw9qas8ry8prn24iqka8kw2nv7ndxr95mvwr5lww53w2sr7p807"))))
1404 (list python-colorama
1408 (build-system python-build-system)
1409 (home-page "https://github.com/zephyrproject-rtos/west")
1410 (synopsis "Zephyr RTOS Project meta-tool")
1411 (description "West is the swiss-army knife command line tool of the Zephyr
1412 project. Its built-in commands provide a multiple repository management
1413 system with features inspired by Google’s Repo tool and Git submodules. West
1414 simplifies configuration and is also pluggable: you can write your own west
1415 \"extension commands\" which add additional features to west. Zephyr uses
1416 this feature to provide conveniences for building applications, flashing and
1417 debugging them, and more.")
1418 (license license:expat)))
1420 (define-public ebusd
1427 (url "https://github.com/john30/ebusd")
1428 (commit (string-append "v" version))))
1429 (file-name (string-append name "-" version "-checkout"))
1432 "0iva70bam7wdx60bpd3an9kxr28zxlvp3vprivgqshwwdhqa0hzp"))))
1433 (build-system gnu-build-system)
1436 (modify-phases %standard-phases
1437 (add-after 'install 'install-config
1438 (lambda* (#:key inputs outputs #:allow-other-keys)
1439 (let ((config-destination
1440 (string-append (assoc-ref outputs "out")
1442 (copy-recursively (string-append (assoc-ref inputs "config")
1449 `(("automake" ,automake)
1450 ("autoconf" ,autoconf)
1455 (url "https://github.com/john30/ebusd-configuration")
1456 (commit "666c0f6b9c4d7545eff7f43ab28a1c7baeab7913")))
1457 (file-name "config-checkout")
1460 "0yxnx8p4lbk614l16854r9s9d8s9c7ixgczfs8mph94xz0wkda7x"))))))
1461 (synopsis "Daemon for communicating with eBUS devices")
1462 (description "This package provides @command{ebusd}, a daemon for
1463 handling communication with eBUS devices connected to a 2-wire bus system
1464 (\"energy bus\" used by numerous heating systems).")
1465 (home-page "https://ebusd.eu/")
1466 (license license:gpl3+)))
1468 (define-public ucsim
1475 "http://mazsola.iit.uni-miskolc.hu/ucsim/download/unix/"
1476 "source/v" (version-major+minor version) ".x/"
1477 "ucsim-" version ".tar.gz"))
1480 "080471wvkjdzxz5j3zdaq1apjcj84ql50kn26b7p4ansixnimml4"))))
1481 (build-system gnu-build-system)
1484 (modify-phases %standard-phases
1485 (add-after 'unpack 'patch-makefiles
1487 (substitute* (find-files "." "(\\.mk$|\\.in$)")
1488 (("/bin/sh") (which "sh"))))))))
1492 (append (list bison flex)
1493 ;; Certain tests use assemblers provided by SDCC.
1494 (if (not (%current-target-system))
1497 (home-page "http://mazsola.iit.uni-miskolc.hu/ucsim/")
1498 (synopsis "Simulators for various microcontroller families")
1499 (description "μCsim is a collection of software simulators for
1500 microcontrollers in the Atmel AVR; Intel MCS-51 (8051); MOS Technology 6502;
1501 Motorola 6800, 68HC08 and 6809; P1516; Padauk PDK13, PDK14 and PDK15;
1502 STMicroelectronics ST7 and STM8; Xilinx PicoBlaze; and Zilog Z80 families,
1503 plus many of their variants.")
1504 (license license:gpl2+)))
1513 "mirror://sourceforge/sdcc/sdcc"
1514 "/" version "/sdcc-src-" version ".tar.bz2"))
1517 "0ly0m3q9vzjb9kcfjh79s77wpl4w7xhybzy4h9x0bmmw4cfsx6xl"))
1518 (modules '((guix build utils)))
1521 ;; Remove non-free source files
1522 (delete-file-recursively "device/non-free")
1523 ;; Remove bundled μCsim source
1524 (delete-file-recursively "sim")
1526 (patches (search-patches "sdcc-disable-non-free-code.patch"))))
1527 (build-system gnu-build-system)
1531 (list bison boost flex python-2 texinfo zlib))
1533 `(;; GPUTILS is required for the PIC ports, but the licensing status of
1534 ;; some of the files contained in its distribution is unclear (see
1535 ;; https://issues.guix.gnu.org/44557). For this reason it is not yet
1536 ;; available as a package in Guix.
1538 '("--disable-pic14-port" "--disable-pic16-port" "--disable-ucsim")
1540 (modify-phases %standard-phases
1541 (add-after 'unpack 'patch-makefiles
1543 (substitute* (find-files "." "(\\.mk$|\\.in$)")
1544 (("/bin/sh") (which "sh")))
1545 ;; --disable-ucsim disables sdcc-misc, patch it back in.
1546 (substitute* "Makefile.in"
1547 (("debugger/mcs51" line)
1548 (string-append line "\n"
1549 "TARGETS += sdcc-misc\n"
1550 "PKGS += $(SDCC_MISC)")))
1552 (home-page "http://sdcc.sourceforge.net")
1553 (synopsis "C compiler suite for 8-bit microcontrollers")
1554 (description "SDCC is a retargetable, optimizing Standard C compiler suite
1555 that targets 8-bit microcontrollers in the Intel MCS-51 (8051); MOS Technology
1556 6502; Motorola 68HC08; Padauk PDK13, PDK14 and PDK15; STMicroelectronics STM8;
1557 and Zilog Z80 families, plus many of their variants.")
1558 (license (list license:gpl2+
1563 license:public-domain
1566 (define-public python-psptool
1568 (name "python-psptool")
1572 (uri (pypi-uri "psptool" version))
1575 "1kx0xpfx67m4zclk4gs97wiwjms8i7z4f6b6m68y8sfgpshy4rf3"))
1576 (modules '((guix build utils)))
1579 ;; IPython is not used by the package at all
1580 (substitute* '("psptool/directory.py" "psptool/entry.py")
1581 (("from IPython.*") ""))))))
1582 (build-system python-build-system)
1584 (list python-cryptography python-prettytable))
1585 (home-page "https://github.com/PSPReverse/psptool")
1586 (synopsis "Tool for dealing with AMD binary blobs")
1587 (description "PSPTool is a tool for dealing with AMD binary blobs")
1588 (license license:gpl3+)))
1590 (define-public agent-proxy
1591 (let ((commit "8927798a71d246871ea8fc22b4512296a3fa1765")
1594 (name "agent-proxy")
1595 (version (git-version "1.98" revision commit))
1597 "https://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git")
1600 (uri (git-reference (url home-page) (commit commit)))
1601 (file-name (git-file-name name version))
1604 "1bxkzwsqfld4pknmiq8j3k55pv90n8s6kzh0xh42bhy2jv1wxz2z"))))
1605 (build-system gnu-build-system)
1609 (modify-phases %standard-phases
1611 (add-after 'build 'build-kdmx
1613 (invoke "make" "-C" "kdmx")
1616 (lambda* (#:key outputs #:allow-other-keys)
1617 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
1618 (install-file "agent-proxy" bin)
1619 (install-file "kdmx/kdmx" bin)
1621 (synopsis "Proxies to run kgdb/gdbserver and console on a serial port")
1622 (description "These programs are proxies allowing to run kgdb/gdbserver
1623 and console on a single serial port. agent-proxy creates network sockets,
1624 whereas kdmx creates pseudo-ttys.")
1625 (license license:gpl2))))
1627 (define-public mbed-tools
1634 (uri (pypi-uri "mbed-tools" version))
1637 "0gdmyxy97bqr9bmkg90v3axmrr2db734nwzq2l05z84x9qiarc9i"))))
1640 (modify-phases %standard-phases
1641 (add-after 'unpack 'relax-requirements
1643 (substitute* "setup.py"
1644 (("\"Click>=7.1,<8\"")
1645 "\"Click>=7.1\""))))
1647 (lambda* (#:key tests? #:allow-other-keys)
1649 ;; Remove this failing test.
1650 (delete-file "tests/ci_scripts/test_sync_board_db.py")
1651 (invoke "pytest" "-vv")))))))
1656 python-requests-mock
1668 python-typing-extensions
1671 (build-system python-build-system)
1672 (home-page "https://github.com/ARMmbed/mbed-tools")
1673 (synopsis "ARM Mbed command line tools")
1674 (description "This package is the successor of @code{mbed-cli}. It
1675 provides command line tools for Mbed OS to detect Mbed enabled devices
1676 connected by USB, checkout Mbed projects and perform builds amongst other
1678 (license license:asl2.0)))