gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / embedded.scm
CommitLineData
35a37efb 1;;; GNU Guix --- Functional package management for GNU
316fa45e 2;;; Copyright © 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
2da8865a 3;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org>
e5e45c06 4;;; Copyright © 2016 David Craven <david@craven.ch>
9be1f2b7 5;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
e35f77e1 6;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
337cb4a0 7;;; Copyright © 2018, 2019, 2021 Clément Lassieur <clement@lassieur.org>
7f6d3f39 8;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
f6ec9f9d 9;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
a613abeb 10;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
87993699 11;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
35a37efb
RW
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages embedded)
29 #:use-module (guix utils)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix svn-download)
33 #:use-module (guix git-download)
34 #:use-module ((guix licenses) #:prefix license:)
615a7eec 35 #:use-module (guix build-system cmake)
35a37efb 36 #:use-module (guix build-system gnu)
2c2fc24b 37 #:use-module (guix build-system python)
569f6016 38 #:use-module (guix build-system trivial)
29e91f0a 39 #:use-module ((guix build utils) #:select (alist-replace delete-file-recursively))
35a37efb 40 #:use-module (gnu packages)
e35f77e1 41 #:use-module (gnu packages admin)
e5e45c06 42 #:use-module (gnu packages autotools)
8ea42482 43 #:use-module ((gnu packages base) #:prefix base:)
2d7c9213 44 #:use-module (gnu packages bison)
c626e281 45 #:use-module (gnu packages boost)
0b8c90b6 46 #:use-module (gnu packages compression)
35a37efb 47 #:use-module (gnu packages cross-base)
2d7c9213 48 #:use-module (gnu packages dejagnu)
35a37efb 49 #:use-module (gnu packages flex)
dbc3c34e 50 #:use-module (gnu packages gcc)
94f36a4f 51 #:use-module (gnu packages gdb)
8ea42482 52 #:use-module (gnu packages guile)
5b83b7b8 53 #:use-module (gnu packages libftdi)
e5e45c06 54 #:use-module (gnu packages libusb)
e88242cb 55 #:use-module (gnu packages messaging)
35a37efb 56 #:use-module (gnu packages perl)
e5e45c06 57 #:use-module (gnu packages pkg-config)
1a6497de 58 #:use-module (gnu packages python)
a613abeb 59 #:use-module (gnu packages python-crypto)
2c2fc24b 60 #:use-module (gnu packages python-xyz)
1a6497de 61 #:use-module (gnu packages swig)
7894ea61 62 #:use-module (gnu packages texinfo)
cc8d346b 63 #:use-module (gnu packages xorg)
7894ea61 64 #:use-module (srfi srfi-1))
35a37efb
RW
65
66;; We must not use the released GCC sources here, because the cross-compiler
67;; does not produce working binaries. Instead we take the very same SVN
68;; revision from the branch that is used for a release of the "GCC ARM
69;; embedded" project on launchpad.
70;; See https://launchpadlibrarian.net/218827644/release.txt
71(define-public gcc-arm-none-eabi-4.9
72 (let ((xgcc (cross-gcc "arm-none-eabi"
7b3318e3
RW
73 #:xgcc gcc-4.9
74 #:xbinutils (cross-binutils "arm-none-eabi")))
35a37efb
RW
75 (revision "1")
76 (svn-revision 227977))
77 (package (inherit xgcc)
78 (version (string-append (package-version xgcc) "-"
79 revision "." (number->string svn-revision)))
80 (source
81 (origin
82 (method svn-fetch)
83 (uri (svn-reference
84 (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-4_9-branch/")
85 (revision svn-revision)))
86 (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
87 (sha256
88 (base32
89 "113r98kygy8rrjfv2pd3z6zlfzbj543pq7xyq8bgh72c608mmsbr"))
7894ea61
LC
90
91 ;; Remove the one patch that doesn't apply to this 4.9 snapshot (the
92 ;; patch is for 4.9.4 and later but this svn snapshot is older).
93 (patches (remove (lambda (patch)
94 (string=? (basename patch)
95 "gcc-arm-bug-71399.patch"))
96 (origin-patches (package-source xgcc))))))
35a37efb
RW
97 (native-inputs
98 `(("flex" ,flex)
7f6d3f39 99 ("gcc@5" ,gcc-5)
35a37efb
RW
100 ,@(package-native-inputs xgcc)))
101 (arguments
102 (substitute-keyword-arguments (package-arguments xgcc)
103 ((#:phases phases)
104 `(modify-phases ,phases
7f6d3f39
MB
105 (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
106 (lambda* (#:key inputs #:allow-other-keys)
107 (let ((gcc (assoc-ref inputs "gcc")))
108 ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
109 ;; prevent header conflict with the GCC from native-inputs.
110 (setenv "CPLUS_INCLUDE_PATH"
111 (string-join
112 (delete (string-append gcc "/include/c++")
113 (string-split (getenv "CPLUS_INCLUDE_PATH")
114 #\:))
115 ":"))
116 (format #t
117 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
118 (getenv "CPLUS_INCLUDE_PATH"))
119 #t)))
35a37efb
RW
120 (add-after 'unpack 'fix-genmultilib
121 (lambda _
122 (substitute* "gcc/genmultilib"
123 (("#!/bin/sh") (string-append "#!" (which "sh"))))
124 #t))))
125 ((#:configure-flags flags)
126 ;; The configure flags are largely identical to the flags used by the
127 ;; "GCC ARM embedded" project.
128 `(append (list "--enable-multilib"
129 "--with-newlib"
130 "--with-multilib-list=armv6-m,armv7-m,armv7e-m"
131 "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
132 "--enable-plugins"
133 "--disable-decimal-float"
134 "--disable-libffi"
135 "--disable-libgomp"
136 "--disable-libmudflap"
137 "--disable-libquadmath"
138 "--disable-libssp"
139 "--disable-libstdcxx-pch"
140 "--disable-nls"
141 "--disable-shared"
142 "--disable-threads"
143 "--disable-tls")
144 (delete "--disable-multilib" ,flags)))))
145 (native-search-paths
146 (list (search-path-specification
147 (variable "CROSS_C_INCLUDE_PATH")
148 (files '("arm-none-eabi/include")))
149 (search-path-specification
150 (variable "CROSS_CPLUS_INCLUDE_PATH")
5c995449
MS
151 (files '("arm-none-eabi/include"
152 "arm-none-eabi/include/c++"
153 "arm-none-eabi/include/c++/arm-none-eabi")))
35a37efb
RW
154 (search-path-specification
155 (variable "CROSS_LIBRARY_PATH")
156 (files '("arm-none-eabi/lib"))))))))
6c39886a 157
dbc3c34e
TF
158(define-public gcc-arm-none-eabi-6
159 (package
160 (inherit gcc-arm-none-eabi-4.9)
161 (version (package-version gcc-6))
162 (source (origin (inherit (package-source gcc-6))
163 (patches
164 (append
165 (origin-patches (package-source gcc-6))
166 (search-patches "gcc-6-cross-environment-variables.patch"
167 "gcc-6-arm-none-eabi-multilib.patch")))))))
168
6c39886a
RW
169(define-public newlib-arm-none-eabi
170 (package
171 (name "newlib")
172 (version "2.4.0")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "ftp://sourceware.org/pub/newlib/newlib-"
176 version ".tar.gz"))
177 (sha256
178 (base32
179 "01i7qllwicf05vsvh39qj7qp5fdifpvvky0x95hjq39mbqiksnsl"))))
180 (build-system gnu-build-system)
181 (arguments
182 `(#:out-of-source? #t
183 ;; The configure flags are identical to the flags used by the "GCC ARM
184 ;; embedded" project.
185 #:configure-flags '("--target=arm-none-eabi"
186 "--enable-newlib-io-long-long"
187 "--enable-newlib-register-fini"
188 "--disable-newlib-supplied-syscalls"
189 "--disable-nls")
190 #:phases
191 (modify-phases %standard-phases
192 (add-after 'unpack 'fix-references-to-/bin/sh
193 (lambda _
194 (substitute* '("libgloss/arm/cpu-init/Makefile.in"
195 "libgloss/arm/Makefile.in"
196 "libgloss/libnosys/Makefile.in"
197 "libgloss/Makefile.in")
198 (("/bin/sh") (which "sh")))
199 #t)))))
200 (native-inputs
201 `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
202 ("xgcc" ,gcc-arm-none-eabi-4.9)
203 ("texinfo" ,texinfo)))
2196e3cc 204 (home-page "https://www.sourceware.org/newlib/")
6c39886a
RW
205 (synopsis "C library for use on embedded systems")
206 (description "Newlib is a C library intended for use on embedded
207systems. It is a conglomeration of several library parts that are easily
208usable on embedded products.")
209 (license (license:non-copyleft
210 "https://www.sourceware.org/newlib/COPYING.NEWLIB"))))
a299a899
RW
211
212(define-public newlib-nano-arm-none-eabi
213 (package (inherit newlib-arm-none-eabi)
214 (name "newlib-nano")
215 (arguments
216 (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi)
217 ;; The configure flags are identical to the flags used by the "GCC ARM
218 ;; embedded" project. They optimize newlib for use on small embedded
219 ;; systems with limited memory.
220 ((#:configure-flags flags)
221 ''("--target=arm-none-eabi"
222 "--enable-multilib"
223 "--disable-newlib-supplied-syscalls"
224 "--enable-newlib-reent-small"
225 "--disable-newlib-fvwrite-in-streamio"
226 "--disable-newlib-fseek-optimization"
227 "--disable-newlib-wide-orient"
228 "--enable-newlib-nano-malloc"
229 "--disable-newlib-unbuf-stream-opt"
230 "--enable-lite-exit"
231 "--enable-newlib-global-atexit"
232 "--enable-newlib-nano-formatted-io"
87993699
MS
233 "--disable-nls"))
234 ((#:phases phases)
235 `(modify-phases ,phases
236 ;; XXX: Most arm toolchains offer both *.a and *_nano.a as newlib
237 ;; and newlib-nano respectively. The headers are usually
238 ;; arm-none-eabi/include/newlib.h for newlib and
239 ;; arm-none-eabi/include/newlib-nano/newlib.h for newlib-nano. We
240 ;; have two different toolchain packages for each which works but
241 ;; is a little strange.
242 (add-after 'install 'hardlink-newlib
243 (lambda* (#:key outputs #:allow-other-keys)
244 (let ((out (assoc-ref outputs "out")))
245 ;; The nano.specs file says that newlib-nano files should end
246 ;; in "_nano.a" instead of just ".a". Note that this applies
247 ;; to all the multilib folders too.
248 (for-each
249 (lambda (file)
250 (link file
251 (string-append
252 ;; Strip ".a" off the end
253 (substring file 0 (- (string-length file) 2))
254 ;; Add "_nano.a" onto the end
255 "_nano.a")))
256 (find-files
257 out
258 "^(libc.a|libg.a|librdimon.a|libstdc\\+\\+.a|libsupc\\+\\+.a)$"))
259
260 ;; newlib.h is usually in this location instead so both
261 ;; newlib and newlib-nano can be in the toolchain at the same
262 ;; time
263 (mkdir (string-append out "/arm-none-eabi/include/newlib-nano"))
264 (symlink
265 "../newlib.h"
266 (string-append out "/arm-none-eabi/include/newlib-nano/newlib.h"))
267 #t)))))))
a299a899 268 (synopsis "Newlib variant for small systems with limited memory")))
569f6016 269
04c4ef35
RW
270\f
271;;; The following definitions are for the "7-2018-q2-update" variant of the
272;;; ARM cross toolchain as offered on https://developer.arm.com
273(define-public gcc-arm-none-eabi-7-2018-q2-update
274 (let ((xgcc (cross-gcc "arm-none-eabi"
275 #:xgcc gcc-7
276 #:xbinutils (cross-binutils "arm-none-eabi")))
277 (revision "1")
278 (svn-revision 261907))
279 (package (inherit xgcc)
280 (version (string-append "7-2018-q2-update-"
281 revision "." (number->string svn-revision)))
282 (source
283 (origin
284 (method svn-fetch)
285 (uri (svn-reference
286 (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch/")
287 (revision svn-revision)))
288 (file-name (string-append "gcc-arm-embedded-" version "-checkout"))
289 (sha256
290 (base32
291 "192ggs63bixf3irpijgfkjks73yx1r3a4i6grk1y0i0iny76pmx5"))
292 (patches
293 (append
294 (origin-patches (package-source gcc-7))
295 (search-patches "gcc-7-cross-environment-variables.patch")))))
296 (native-inputs
840d7034 297 `(("flex" ,flex)
04c4ef35
RW
298 ("isl" ,isl-0.18)
299 ,@(alist-delete "isl" (package-native-inputs xgcc))))
300 (arguments
301 (substitute-keyword-arguments (package-arguments xgcc)
302 ((#:phases phases)
303 `(modify-phases ,phases
304 (add-after 'unpack 'expand-version-string
305 (lambda _
306 (make-file-writable "gcc/DEV-PHASE")
307 (with-output-to-file "gcc/DEV-PHASE"
308 (lambda ()
309 (display "7-2018-q2-update")))
310 #t))
311 (add-after 'unpack 'fix-genmultilib
312 (lambda _
313 (substitute* "gcc/genmultilib"
314 (("#!/bin/sh") (string-append "#!" (which "sh"))))
f6ec9f9d
BH
315 #t))
316 (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
317 (lambda* (#:key inputs #:allow-other-keys)
318 (let ((gcc (assoc-ref inputs "gcc")))
319 ;; Remove the default compiler from CPLUS_INCLUDE_PATH to
320 ;; prevent header conflict with the GCC from native-inputs.
321 (setenv "CPLUS_INCLUDE_PATH"
322 (string-join
323 (delete (string-append gcc "/include/c++")
324 (string-split (getenv "CPLUS_INCLUDE_PATH")
325 #\:))
326 ":"))
327 (format #t
328 "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
329 (getenv "CPLUS_INCLUDE_PATH"))
330 #t)))))
04c4ef35
RW
331 ((#:configure-flags flags)
332 ;; The configure flags are largely identical to the flags used by the
333 ;; "GCC ARM embedded" project.
334 `(append (list "--enable-multilib"
335 "--with-newlib"
336 "--with-multilib-list=rmprofile"
337 "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm"
338 "--enable-plugins"
339 "--disable-decimal-float"
340 "--disable-libffi"
341 "--disable-libgomp"
342 "--disable-libmudflap"
343 "--disable-libquadmath"
344 "--disable-libssp"
345 "--disable-libstdcxx-pch"
346 "--disable-nls"
347 "--disable-shared"
348 "--disable-threads"
349 "--disable-tls")
350 (delete "--disable-multilib" ,flags)))))
351 (native-search-paths
352 (list (search-path-specification
353 (variable "CROSS_C_INCLUDE_PATH")
354 (files '("arm-none-eabi/include")))
355 (search-path-specification
356 (variable "CROSS_CPLUS_INCLUDE_PATH")
5c995449
MS
357 (files '("arm-none-eabi/include"
358 "arm-none-eabi/include/c++"
359 "arm-none-eabi/include/c++/arm-none-eabi")))
04c4ef35
RW
360 (search-path-specification
361 (variable "CROSS_LIBRARY_PATH")
362 (files '("arm-none-eabi/lib"))))))))
363
5c792737
RW
364(define-public newlib-arm-none-eabi-7-2018-q2-update
365 ;; This is the same commit as used for the 7-2018-q2-update release
366 ;; according to the release.txt.
367 (let ((commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4")
368 (revision "0"))
369 (package
370 (inherit newlib-arm-none-eabi)
371 (version (git-version "3.0.0" revision commit))
372 (source
373 (origin
374 (method git-fetch)
375 (uri (git-reference
376 (url "http://sourceware.org/git/newlib-cygwin.git")
377 (commit commit)))
378 (file-name (git-file-name "newlib" commit))
379 (sha256
380 (base32
381 "1dq23fqrk75g1a4v7569fvnnw5q440zawbxi3w0g05n8jlqsmvcy"))))
382 (arguments
383 (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi)
384 ;; The configure flags are identical to the flags used by the "GCC ARM
385 ;; embedded" project.
386 ((#:configure-flags flags)
387 `(cons* "--enable-newlib-io-c99-formats"
388 "--enable-newlib-retargetable-locking"
389 "--with-headers=yes"
390 ,flags))))
391 (native-inputs
392 `(("xbinutils" ,(cross-binutils "arm-none-eabi"))
393 ("xgcc" ,gcc-arm-none-eabi-7-2018-q2-update)
394 ("texinfo" ,texinfo))))))
395
f08eed3d
RW
396(define-public newlib-nano-arm-none-eabi-7-2018-q2-update
397 (package (inherit newlib-arm-none-eabi-7-2018-q2-update)
398 (name "newlib-nano")
399 (arguments
400 (package-arguments newlib-nano-arm-none-eabi))
401 (synopsis "Newlib variant for small systems with limited memory")))
402
403\f
1a1e8336
RW
404(define (make-libstdc++-arm-none-eabi xgcc newlib)
405 (let ((libstdc++ (make-libstdc++ xgcc)))
406 (package (inherit libstdc++)
407 (name "libstdc++-arm-none-eabi")
408 (arguments
409 (substitute-keyword-arguments (package-arguments libstdc++)
410 ((#:configure-flags flags)
411 ``("--target=arm-none-eabi"
412 "--host=arm-none-eabi"
413 "--disable-libstdcxx-pch"
414 "--enable-multilib"
415 "--with-multilib-list=armv6-m,armv7-m,armv7e-m"
416 "--disable-shared"
417 "--disable-tls"
418 "--disable-plugin"
419 "--with-newlib"
420 ,(string-append "--with-gxx-include-dir="
421 (assoc-ref %outputs "out")
5c995449 422 "/arm-none-eabi/include/c++")))))
1a1e8336
RW
423 (native-inputs
424 `(("newlib" ,newlib)
425 ("xgcc" ,xgcc)
426 ,@(package-native-inputs libstdc++))))))
427
569f6016
TF
428(define (arm-none-eabi-toolchain xgcc newlib)
429 "Produce a cross-compiler toolchain package with the compiler XGCC and the C
430library variant NEWLIB."
431 (let ((newlib-with-xgcc (package (inherit newlib)
432 (native-inputs
433 (alist-replace "xgcc" (list xgcc)
434 (package-native-inputs newlib))))))
435 (package
436 (name (string-append "arm-none-eabi"
437 (if (string=? (package-name newlib-with-xgcc)
438 "newlib-nano")
439 "-nano" "")
440 "-toolchain"))
441 (version (package-version xgcc))
442 (source #f)
443 (build-system trivial-build-system)
9cdf4872
RW
444 (arguments
445 '(#:modules ((guix build union))
446 #:builder
447 (begin
448 (use-modules (ice-9 match)
449 (guix build union))
450 (match %build-inputs
451 (((names . directories) ...)
452 (union-build (assoc-ref %outputs "out")
e3cfef22
MW
453 directories)
454 #t)))))
569f6016
TF
455 (propagated-inputs
456 `(("binutils" ,(cross-binutils "arm-none-eabi"))
8ea169d0 457 ("libstdc++" ,(make-libstdc++-arm-none-eabi xgcc newlib-with-xgcc))
569f6016
TF
458 ("gcc" ,xgcc)
459 ("newlib" ,newlib-with-xgcc)))
460 (synopsis "Complete GCC tool chain for ARM bare metal development")
461 (description "This package provides a complete GCC tool chain for ARM
462bare metal development. This includes the GCC arm-none-eabi cross compiler
463and newlib (or newlib-nano) as the C library. The supported programming
464languages are C and C++.")
465 (home-page (package-home-page xgcc))
466 (license (package-license xgcc)))))
467
468(define-public arm-none-eabi-toolchain-4.9
469 (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
470 newlib-arm-none-eabi))
471
472(define-public arm-none-eabi-nano-toolchain-4.9
473 (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9
474 newlib-nano-arm-none-eabi))
475
476(define-public arm-none-eabi-toolchain-6
477 (arm-none-eabi-toolchain gcc-arm-none-eabi-6
478 newlib-arm-none-eabi))
479
480(define-public arm-none-eabi-nano-toolchain-6
481 (arm-none-eabi-toolchain gcc-arm-none-eabi-6
482 newlib-nano-arm-none-eabi))
94f36a4f 483
893960ee
RW
484(define-public arm-none-eabi-toolchain-7-2018-q2-update
485 (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
486 newlib-arm-none-eabi-7-2018-q2-update))
487
ee9e108a
RW
488(define-public arm-none-eabi-nano-toolchain-7-2018-q2-update
489 (arm-none-eabi-toolchain gcc-arm-none-eabi-7-2018-q2-update
490 newlib-nano-arm-none-eabi-7-2018-q2-update))
491
94f36a4f
TF
492(define-public gdb-arm-none-eabi
493 (package
494 (inherit gdb)
495 (name "gdb-arm-none-eabi")
496 (arguments
497 `(#:configure-flags '("--target=arm-none-eabi"
498 "--enable-multilib"
499 "--enable-interwork"
500 "--enable-languages=c,c++"
501 "--disable-nls")
502 ,@(package-arguments gdb)))))
e5e45c06
DC
503
504(define-public libjaylink
2eacb95a
MFG
505 (package
506 (name "libjaylink")
507 (version "0.2.0")
508 (source (origin
509 (method git-fetch)
510 (uri (git-reference
511 (url "https://repo.or.cz/libjaylink.git")
512 (commit version)))
513 (file-name (git-file-name name version))
514 (sha256
515 (base32
516 "0ndyfh51hiqyv2yscpj6qd091w7myxxjid3a6rx8f6k233vy826q"))))
517 (build-system gnu-build-system)
518 (native-inputs
519 `(("autoconf" ,autoconf)
520 ("automake" ,automake)
521 ("libtool" ,libtool)
522 ("pkg-config" ,pkg-config)))
523 (inputs
524 `(("libusb" ,libusb)))
525 (home-page "https://repo.or.cz/w/libjaylink.git")
526 (synopsis "Library to interface Segger J-Link devices")
527 (description "libjaylink is a shared library written in C to access
e5e45c06 528SEGGER J-Link and compatible devices.")
2eacb95a 529 (license license:gpl2+)))
91ba6935
DC
530
531(define-public jimtcl
532 (package
533 (name "jimtcl")
e35f77e1 534 (version "0.80")
91ba6935 535 (source (origin
cc17b07a
EF
536 (method git-fetch)
537 (uri (git-reference
538 (url "https://github.com/msteveb/jimtcl")
539 (commit version)))
540 (file-name (git-file-name name version))
91ba6935
DC
541 (sha256
542 (base32
e35f77e1 543 "06rn60cx9sapc175vxvan87b8j5rkhh5gvvz7343xznzwlr0wcgk"))))
91ba6935
DC
544 (build-system gnu-build-system)
545 (arguments
546 `(#:phases
547 (modify-phases %standard-phases
91ba6935 548 (replace 'configure
e35f77e1 549 ;; This package doesn't use autoconf.
91ba6935
DC
550 (lambda* (#:key outputs #:allow-other-keys)
551 (let ((out (assoc-ref outputs "out")))
78854b38 552 (invoke "./configure"
e35f77e1
TGR
553 (string-append "--prefix=" out)))))
554 (add-before 'check 'delete-failing-tests
555 (lambda _
556 ;; XXX All but 1 TTY tests fail (Inappropriate ioctl for device).
557 (delete-file "tests/tty.test")
558 #t))
559 )))
560 (native-inputs
561 ;; For tests.
562 `(("inetutils" ,inetutils))) ; for hostname
fd7ad899 563 (home-page "http://jim.tcl.tk/index.html")
91ba6935
DC
564 (synopsis "Small footprint Tcl implementation")
565 (description "Jim is a small footprint implementation of the Tcl programming
566language.")
567 (license license:bsd-2)))
5b83b7b8
TF
568
569(define-public openocd
cad55e91
MFG
570 (let ((commit "9a877a83a1c8b1f105cdc0de46c5cbc4d9e8799e")
571 (revision "0"))
572 (package
573 (name "openocd")
574 (version (string-append "0.10.0-" revision "."
575 (string-take commit 7)))
576 (source (origin
577 (method git-fetch)
578 (uri (git-reference
579 (url "https://git.code.sf.net/p/openocd/code")
580 (commit commit)))
581 (file-name (string-append name "-" version "-checkout"))
582 (sha256
583 (base32
584 "1q536cp80v2bcy6xwk08f1r2ljyw13jchx3a1z7d3ni3vqql7rc6"))))
585 (build-system gnu-build-system)
586 (native-inputs
587 `(("autoconf" ,autoconf)
588 ("automake" ,automake)
589 ("libtool" ,libtool)
590 ("which" ,base:which)
591 ("pkg-config" ,pkg-config)))
592 (inputs
593 `(("hidapi" ,hidapi)
594 ("jimtcl" ,jimtcl)
595 ("libftdi" ,libftdi)
596 ("libjaylink" ,libjaylink)
597 ("libusb-compat" ,libusb-compat)))
598 (arguments
599 '(#:configure-flags
dcb95c6f
MS
600 (append (list "LIBS=-lutil"
601 "--disable-werror"
cad55e91
MFG
602 "--enable-sysfsgpio"
603 "--disable-internal-jimtcl"
604 "--disable-internal-libjaylink")
605 (map (lambda (programmer)
606 (string-append "--enable-" programmer))
607 '("amtjtagaccel" "armjtagew" "buspirate" "ftdi"
608 "gw16012" "jlink" "opendous" "osbdm"
609 "parport" "aice" "cmsis-dap" "dummy" "jtag_vpi"
610 "remote-bitbang" "rlink" "stlink" "ti-icdi" "ulink"
611 "usbprog" "vsllink" "usb-blaster-2" "usb_blaster"
612 "presto" "openjtag")))
613 #:phases
614 (modify-phases %standard-phases
615 (replace 'bootstrap
616 (lambda _
617 (patch-shebang "bootstrap")
618 (invoke "./bootstrap" "nosubmodule")))
619 (add-after 'autoreconf 'change-udev-group
620 (lambda _
621 (substitute* "contrib/60-openocd.rules"
622 (("plugdev") "dialout"))
623 #t))
624 (add-after 'install 'install-udev-rules
625 (lambda* (#:key outputs #:allow-other-keys)
626 (install-file "contrib/60-openocd.rules"
627 (string-append
628 (assoc-ref outputs "out")
629 "/lib/udev/rules.d/"))
630 #t)))))
631 (home-page "http://openocd.org")
632 (synopsis "On-Chip Debugger")
633 (description "OpenOCD provides on-chip programming and debugging support
5b83b7b8 634with a layered architecture of JTAG interface and TAP support.")
cad55e91 635 (license license:gpl2+))))
2d7c9213 636
791cfa67
RW
637;; The commits for all propeller tools are the stable versions published at
638;; https://github.com/propellerinc/propgcc in the release_1_0. According to
639;; personal correspondence with the developers in July 2017, more recent
640;; versions are currently incompatible with the "Simple Libraries".
2d7c9213
RW
641
642(define propeller-binutils
643 (let ((xbinutils (cross-binutils "propeller-elf"))
791cfa67
RW
644 (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
645 (revision "2"))
2d7c9213
RW
646 (package
647 (inherit xbinutils)
648 (name "propeller-binutils")
649 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
650 (source (origin (inherit (package-source xbinutils))
651 (method git-fetch)
652 (uri (git-reference
b0e7b699 653 (url "https://github.com/parallaxinc/propgcc")
2d7c9213
RW
654 (commit commit)))
655 (file-name (string-append name "-" commit "-checkout"))
656 (sha256
657 (base32
791cfa67
RW
658 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))
659 (patch-flags (list "-p1" "--directory=binutils"))))
2d7c9213 660 (arguments
791cfa67 661 `(;; FIXME: For some reason there are many test failures. It's not
2d7c9213
RW
662 ;; obvious how to fix the failures.
663 #:tests? #f
664 #:phases
665 (modify-phases %standard-phases
791cfa67
RW
666 (add-after 'unpack 'chdir
667 (lambda _ (chdir "binutils") #t)))
668 ,@(substitute-keyword-arguments (package-arguments xbinutils)
669 ((#:configure-flags flags)
670 `(cons "--disable-werror" ,flags)))))
2d7c9213
RW
671 (native-inputs
672 `(("bison" ,bison)
5e54f4ad 673 ("flex" ,flex)
2d7c9213
RW
674 ("texinfo" ,texinfo)
675 ("dejagnu" ,dejagnu)
676 ,@(package-native-inputs xbinutils))))))
677
bb19b2eb 678(define-public propeller-gcc-6
68cb2784 679 (let ((xgcc (cross-gcc "propeller-elf"
7b3318e3 680 #:xbinutils propeller-binutils))
68cb2784
RW
681 (commit "b4f45a4725e0b6d0af59e594c4e3e35ca4105867")
682 (revision "1"))
683 (package (inherit xgcc)
684 (name "propeller-gcc")
685 (version (string-append "6.0.0-" revision "." (string-take commit 9)))
686 (source (origin
687 (method git-fetch)
688 (uri (git-reference
b0e7b699 689 (url "https://github.com/totalspectrum/gcc-propeller")
68cb2784
RW
690 (commit commit)))
691 (file-name (string-append name "-" commit "-checkout"))
692 (sha256
693 (base32
694 "0d9kdxm2fzanjqa7q5850kzbsfl0fqyaahxn74h6nkxxacwa11zb"))
695 (patches
696 (append
697 (origin-patches (package-source gcc-6))
698 (search-patches "gcc-cross-environment-variables.patch")))))
699 (native-inputs
700 `(("flex" ,flex)
701 ,@(package-native-inputs xgcc)))
702 ;; All headers and cross libraries of the propeller toolchain are
703 ;; installed under the "propeller-elf" prefix.
704 (native-search-paths
705 (list (search-path-specification
706 (variable "CROSS_C_INCLUDE_PATH")
707 (files '("propeller-elf/include")))
708 (search-path-specification
709 (variable "CROSS_LIBRARY_PATH")
710 (files '("propeller-elf/lib")))))
711 (home-page "https://github.com/totalspectrum/gcc-propeller")
712 (synopsis "GCC for the Parallax Propeller"))))
713
db90eb8c 714(define-public propeller-gcc-4
bb19b2eb 715 (let ((xgcc propeller-gcc-6)
791cfa67
RW
716 (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
717 (revision "2"))
db90eb8c
RW
718 (package (inherit xgcc)
719 (name "propeller-gcc")
720 (version (string-append "4.6.1-" revision "." (string-take commit 9)))
721 (source (origin
722 (method git-fetch)
723 (uri (git-reference
b0e7b699 724 (url "https://github.com/parallaxinc/propgcc")
db90eb8c
RW
725 (commit commit)))
726 (file-name (string-append name "-" commit "-checkout"))
727 (sha256
728 (base32
791cfa67
RW
729 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))
730 (patch-flags (list "-p1" "--directory=gcc"))
db90eb8c
RW
731 (patches
732 (append
733 (origin-patches (package-source gcc-4.7))
1d3be5d9
RW
734 (search-patches "gcc-4.6-gnu-inline.patch"
735 "gcc-cross-environment-variables.patch")))))
791cfa67
RW
736 (arguments
737 (substitute-keyword-arguments (package-arguments propeller-gcc-6)
738 ((#:phases phases)
739 `(modify-phases ,phases
740 (add-after 'unpack 'chdir
741 (lambda _ (chdir "gcc") #t))))))
8226304b
RW
742 (native-inputs
743 `(("gcc-4" ,gcc-4.9)
744 ,@(package-native-inputs propeller-gcc-6)))
791cfa67 745 (home-page "https://github.com/parallaxinc/propgcc")
57e96e48 746 (supported-systems (delete "aarch64-linux" %supported-systems)))))
db90eb8c 747
bb19b2eb
RW
748;; Version 6 is experimental and may not work correctly. This is why we
749;; default to version 4, which is also used in the binary toolchain bundle
750;; provided by Parallax Inc.
751(define-public propeller-gcc propeller-gcc-4)
752
791cfa67
RW
753
754;; FIXME: We do not build the tiny library because that would require C++
755;; headers, which are not available. This may require adding a propeller-elf
756;; variant of the libstdc++ package.
0d0079b2 757(define-public proplib
791cfa67
RW
758 (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
759 (revision "2"))
0d0079b2
RW
760 (package
761 (name "proplib")
762 (version (string-append "0.0.0-" revision "." (string-take commit 9)))
763 (source (origin
764 (method git-fetch)
765 (uri (git-reference
b0e7b699 766 (url "https://github.com/parallaxinc/propgcc")
0d0079b2
RW
767 (commit commit)))
768 (file-name (string-append name "-" commit "-checkout"))
769 (sha256
770 (base32
791cfa67 771 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))))
0d0079b2
RW
772 (build-system gnu-build-system)
773 (arguments
774 `(#:tests? #f ; no tests
775 #:make-flags
776 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
777 (string-append "BUILD=" (getcwd) "/build"))
778 #:phases
779 (modify-phases %standard-phases
780 (delete 'configure)
791cfa67
RW
781 (add-after 'unpack 'chdir
782 (lambda _ (chdir "lib") #t))
783 (add-after 'chdir 'fix-Makefile
0d0079b2
RW
784 (lambda _
785 (substitute* "Makefile"
0d0079b2
RW
786 ;; Control the installation time of the headers.
787 ((" install-includes") ""))
788 #t))
789 ;; The Makefile does not separate building from installation, so we
790 ;; have to create the target directories at build time.
791 (add-before 'build 'create-target-directories
792 (lambda* (#:key make-flags #:allow-other-keys)
5cb9754c 793 (apply invoke "make" "install-dirs" make-flags)))
0d0079b2
RW
794 (add-before 'build 'set-cross-environment-variables
795 (lambda* (#:key outputs #:allow-other-keys)
796 (setenv "CROSS_LIBRARY_PATH"
797 (string-append (assoc-ref outputs "out")
798 "/propeller-elf/lib:"
799 (or (getenv "CROSS_LIBRARY_PATH") "")))
800 (setenv "CROSS_C_INCLUDE_PATH"
801 (string-append (assoc-ref outputs "out")
802 "/propeller-elf/include:"
803 (or (getenv "CROSS_C_INCLUDE_PATH") "")))
804 #t))
791cfa67 805 (add-before 'install 'install-includes
0d0079b2 806 (lambda* (#:key make-flags #:allow-other-keys)
5cb9754c 807 (apply invoke "make" "install-includes" make-flags))))))
0d0079b2
RW
808 (native-inputs
809 `(("propeller-gcc" ,propeller-gcc)
810 ("propeller-binutils" ,propeller-binutils)
811 ("perl" ,perl)))
791cfa67 812 (home-page "https://github.com/parallaxinc/propgcc")
0d0079b2
RW
813 (synopsis "C library for the Parallax Propeller")
814 (description "This is a C library for the Parallax Propeller
815micro-controller.")
816 ;; Most of the code is released under the Expat license. Some of the
817 ;; included code is public domain and some changes are BSD licensed.
818 (license license:expat))))
819
eb88fbaf
RW
820(define-public propeller-toolchain
821 (package
822 (name "propeller-toolchain")
823 (version (package-version propeller-gcc))
824 (source #f)
825 (build-system trivial-build-system)
e3cfef22 826 (arguments '(#:builder (begin (mkdir %output) #t)))
eb88fbaf
RW
827 (propagated-inputs
828 `(("binutils" ,propeller-binutils)
829 ("libc" ,proplib)
830 ("gcc" ,propeller-gcc)))
831 (synopsis "Complete GCC tool chain for Propeller micro-controllers")
832 (description "This package provides a complete GCC tool chain for
833Propeller micro-controller development.")
834 (home-page (package-home-page propeller-gcc))
835 (license (package-license propeller-gcc))))
836
150e0a1e
RW
837(define-public openspin
838 (package
839 (name "openspin")
840 (version "1.00.78")
841 (source (origin
9be1f2b7
EF
842 (method git-fetch)
843 (uri (git-reference
844 (url "https://github.com/parallaxinc/OpenSpin")
845 (commit version)))
846 (file-name (git-file-name name version))
150e0a1e
RW
847 (sha256
848 (base32
9be1f2b7 849 "0ghk8hj4717ydhqzx2pfs6737s1cxng6sgg2xgbkwvcfclxdbrd0"))))
150e0a1e
RW
850 (build-system gnu-build-system)
851 (arguments
852 `(#:tests? #f ; no tests
853 #:phases
854 (modify-phases %standard-phases
855 (delete 'configure)
856 (add-after 'unpack 'remove-timestamp
857 (lambda _
858 (substitute* "SpinSource/openspin.cpp"
859 ((" Compiled on.*$") "\\n\");"))
860 #t))
861 ;; Makefile does not include "install" target
862 (replace 'install
863 (lambda* (#:key outputs #:allow-other-keys)
864 (let ((bin (string-append (assoc-ref outputs "out")
865 "/bin")))
866 (mkdir-p bin)
867 (install-file "build/openspin" bin)
868 #t))))))
869 (home-page "https://github.com/parallaxinc/OpenSpin")
870 (synopsis "Spin/PASM compiler for the Parallax Propeller")
871 (description "OpenSpin is a compiler for the Spin/PASM language of the
872Parallax Propeller. It was ported from Chip Gracey's original x86 assembler
873code.")
874 (license license:expat)))
875
c6b96af7 876(define-public propeller-load
791cfa67
RW
877 (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3")
878 (revision "2"))
c6b96af7
RW
879 (package
880 (name "propeller-load")
881 (version "3.4.0")
882 (source (origin
883 (method git-fetch)
884 (uri (git-reference
b0e7b699 885 (url "https://github.com/parallaxinc/propgcc")
c6b96af7
RW
886 (commit commit)))
887 (file-name (string-append name "-" commit "-checkout"))
888 (sha256
889 (base32
791cfa67 890 "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck"))))
c6b96af7
RW
891 (build-system gnu-build-system)
892 (arguments
893 `(#:tests? #f ; no tests
894 #:make-flags
895 (list "OS=linux"
896 (string-append "TARGET=" (assoc-ref %outputs "out")))
897 #:phases
898 (modify-phases %standard-phases
791cfa67
RW
899 (add-after 'unpack 'chdir
900 (lambda _ (chdir "loader") #t))
c6b96af7
RW
901 (delete 'configure))))
902 (native-inputs
903 `(("openspin" ,openspin)
904 ("propeller-toolchain" ,propeller-toolchain)))
791cfa67 905 (home-page "https://github.com/parallaxinc/propgcc")
c6b96af7
RW
906 (synopsis "Loader for Parallax Propeller micro-controllers")
907 (description "This package provides the tool @code{propeller-load} to
908upload binaries to a Parallax Propeller micro-controller.")
909 (license license:expat))))
910
0a7860c4
RW
911(define-public spin2cpp
912 (package
913 (name "spin2cpp")
4886d5b2 914 (version "3.6.4")
0a7860c4 915 (source (origin
02aab3df
EF
916 (method git-fetch)
917 (uri (git-reference
918 (url "https://github.com/totalspectrum/spin2cpp")
919 (commit (string-append "v" version))))
920 (file-name (git-file-name name version))
0a7860c4
RW
921 (sha256
922 (base32
02aab3df 923 "0wznqvsckzzz4hdy2rpvj6jqpxw4yn7i0c7zxfm6i46k8gg9327b"))))
0a7860c4
RW
924 (build-system gnu-build-system)
925 (arguments
926 `(#:tests? #f ;; The tests assume that a micro-controller is connected.
927 #:phases
928 (modify-phases %standard-phases
929 (delete 'configure)
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"))
938 #t))
939 (replace 'install
940 (lambda* (#:key outputs #:allow-other-keys)
941 (let ((bin (string-append (assoc-ref outputs "out")
942 "/bin")))
943 (for-each (lambda (file)
944 (install-file (string-append "build/" file)
945 bin))
946 '("testlex" "spin2cpp" "fastspin")))
947 #t)))))
948 (native-inputs
949 `(("bison" ,bison)
950 ("propeller-load" ,propeller-load)
951 ("propeller-toolchain" ,propeller-toolchain)))
952 (home-page "https://github.com/totalspectrum/spin2cpp")
953 (synopsis "Convert Spin code to C, C++, or PASM code")
954 (description "This is a set of tools for converting the Spin language for
955the Parallax Propeller micro-controller into C or C++ code, into PASM, or even
956directly into an executable binary. The binaries produced use LMM PASM, so
957they are much faster than regular Spin bytecodes (but also quite a bit
958larger).")
959 (license license:expat)))
960
3ebc86d9
RW
961(define-public spinsim
962 (let ((commit "66915a7ad1a3a2cf990a725bb341fab8d11eb620")
963 (revision "1"))
964 (package
965 (name "spinsim")
966 (version (string-append "0.75-" revision "." (string-take commit 9)))
967 (source (origin
968 (method git-fetch)
969 (uri (git-reference
b0e7b699 970 (url "https://github.com/parallaxinc/spinsim")
3ebc86d9
RW
971 (commit commit)))
972 (file-name (string-append name "-" commit "-checkout"))
973 (sha256
974 (base32
975 "1n9kdhlxsdx7bz6c80w8dhi96zp633gd6qs0x9i4ii8qv4i7sj5k"))))
976 (build-system gnu-build-system)
977 (arguments
978 `(#:tests? #f ; no tests
979 #:phases
980 (modify-phases %standard-phases
981 (delete 'configure)
982 (replace 'install
983 (lambda* (#:key outputs #:allow-other-keys)
984 (let ((bin (string-append (assoc-ref outputs "out")
985 "/bin")))
986 (install-file "build/spinsim" bin))
987 #t)))))
988 (home-page "https://github.com/parallaxinc/spinsim")
989 (synopsis "Spin simulator")
990 (description "This package provides the tool @code{spinsim}, a simulator
991and simple debugger for Spin programs written for a Parallax Propeller
992micro-controller. Spinsim supports execution from cog memory and hub
993execution, but it does not support multi-tasking. It supports about
994two-thirds of the opcodes in the P2 instruction set.")
995 (license license:expat))))
996
395bbfdb
RW
997(define-public propeller-development-suite
998 (package
999 (name "propeller-development-suite")
1000 (version (package-version propeller-gcc))
1001 (source #f)
1002 (build-system trivial-build-system)
e3cfef22 1003 (arguments '(#:builder (begin (mkdir %output) #t)))
395bbfdb
RW
1004 (propagated-inputs
1005 `(("toolchain" ,propeller-toolchain)
1006 ("openspin" ,openspin)
1007 ("propeller-load" ,propeller-load)
1008 ("spin2cpp" ,spin2cpp)
1009 ("spinsim" ,spinsim)))
1010 (synopsis "Complete development suite for Propeller micro-controllers")
1011 (description "This meta-package provides a complete environment for the
1012development with Parallax Propeller micro-controllers. It includes the GCC
1013toolchain, the loader, the Openspin compiler, the Spin2cpp tool, and the Spin
1014simulator.")
1015 (home-page (package-home-page propeller-gcc))
1016 (license (package-license propeller-gcc))))
8ea42482
DM
1017
1018(define-public binutils-vc4
1019 (let ((commit "708acc851880dbeda1dd18aca4fd0a95b2573b36"))
1020 (package
1021 (name "binutils-vc4")
1022 (version (string-append "2.23.51-0." (string-take commit 7)))
1023 (source (origin
1024 (method git-fetch)
1025 (uri (git-reference
b0e7b699 1026 (url "https://github.com/puppeh/binutils-vc4")
8ea42482 1027 (commit commit)))
493ae57e 1028 (file-name (string-append name "-" version "-checkout"))
8ea42482
DM
1029 (sha256
1030 (base32
1031 "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63"))))
1032 (build-system gnu-build-system)
1033 (arguments
1034 `(#:configure-flags '("--target=vc4-elf"
1035 "--disable-werror"
1036 "--enable-cgen-maint")
1037 #:phases
1038 (modify-phases %standard-phases
1039 (add-after 'unpack 'unpack-cgen
1040 (lambda* (#:key inputs #:allow-other-keys)
1041 (copy-recursively (string-append (assoc-ref inputs "cgen")
1042 "/cgen") "cgen")
1043 #t))
1044 (add-after 'unpack-cgen 'fix-cgen-guile
1045 (lambda _
1046 (substitute* "opcodes/Makefile.in"
1047 (("guile\\{,-\\}1.8") "guile"))
25e25d8f 1048 (invoke "which" "guile"))))))
8ea42482
DM
1049 (native-inputs
1050 `(("cgen"
1051 ,(origin
1052 (method git-fetch)
1053 (uri (git-reference
b0e7b699 1054 (url "https://github.com/puppeh/cgen")
8ea42482
DM
1055 (commit "d8e2a9eb70425f180fdd5bfd032884b0855f2032")))
1056 (sha256
1057 (base32
1058 "14b3h2ji740s8zq5vwm4qdcxs4aa4wxi6wb9di3bv1h39x14nyr9"))))
1059 ("texinfo" ,texinfo)
5e54f4ad 1060 ("flex" ,flex)
8ea42482
DM
1061 ("bison" ,bison)
1062 ("guile-1.8" ,guile-1.8)
1063 ("which" ,base:which)))
1064 (synopsis "Binutils for VC4")
1065 (description "This package provides @code{binutils} for VideoCore IV,
1066the Raspberry Pi chip.")
1067 (license license:gpl3+)
1068 (home-page "https://github.com/puppeh/vc4-toolchain/"))))
7cf06d62
DM
1069
1070(define-public gcc-vc4
f2c63754
DM
1071 (let ((commit "0fe4b83897341742f9df65797474cb0feab4b377")
1072 (xgcc (cross-gcc "vc4-elf" #:xgcc gcc-6 #:xbinutils binutils-vc4)))
7cf06d62
DM
1073 (package (inherit xgcc)
1074 (name "gcc-vc4")
1075 (source (origin
1076 (method git-fetch)
1077 (uri (git-reference
b0e7b699 1078 (url "https://github.com/puppeh/gcc-vc4")
7cf06d62
DM
1079 (commit commit)))
1080 (file-name (string-append name
1081 "-"
1082 (package-version xgcc)
1083 "-checkout"))
1084 (sha256
1085 (base32
f2c63754
DM
1086 "0kvaq4s0assvinmmicwqp07d0wwldcw0fv6f4k13whp3q5909jnr"))
1087 (patches
1088 (search-patches "gcc-6-fix-buffer-size.patch"
1089 "gcc-6-fix-isl-includes.patch"))))
7cf06d62
DM
1090 (native-inputs
1091 `(("flex" ,flex)
1092 ,@(package-native-inputs xgcc)))
1093 (synopsis "GCC for VC4")
1094 (description "This package provides @code{gcc} for VideoCore IV,
1095the Raspberry Pi chip."))))
1a6497de 1096
2ea4587d 1097(define-public python-libmpsse
1a6497de 1098 (package
2ea4587d 1099 (name "python-libmpsse")
782cc119 1100 (version "1.4.1")
1a6497de
DM
1101 (source
1102 (origin
2ea4587d
DM
1103 (method git-fetch)
1104 (uri (git-reference
b0e7b699 1105 (url "https://github.com/daym/libmpsse")
2ea4587d
DM
1106 (commit (string-append "v" version))))
1107 (file-name "libmpsse-checkout")
1a6497de
DM
1108 (sha256
1109 (base32
782cc119 1110 "1rypfb96k2szqgygp3jnwg2zq9kwmfz0460dsahn3r2vkzml8wn7"))))
1a6497de
DM
1111 (build-system gnu-build-system)
1112 (inputs
1113 `(("libftdi" ,libftdi)
2ea4587d 1114 ("python" ,python)))
1a6497de
DM
1115 (native-inputs
1116 `(("pkg-config" ,pkg-config)
1117 ("swig" ,swig)
1118 ("which" ,base:which)))
1119 (arguments
1120 `(#:tests? #f ; No tests exist.
2ea4587d 1121 #:parallel-build? #f ; Would be buggy.
1a6497de
DM
1122 #:make-flags
1123 (list (string-append "CFLAGS=-Wall -fPIC -fno-strict-aliasing -g -O2 "
1124 "$(shell pkg-config --cflags libftdi1)"))
1125 #:phases
1126 (modify-phases %standard-phases
1127 (add-after 'unpack 'set-environment-up
1128 (lambda* (#:key inputs outputs #:allow-other-keys)
2ea4587d
DM
1129 (let ((python (assoc-ref inputs "python")))
1130 (chdir "src")
1131 (setenv "PYDEV" (string-append python
1132 "/include/python"
a7b20226 1133 ,(version-major+minor (package-version python))))
2ea4587d 1134 #t)))
1a6497de 1135 (replace 'install
2ea4587d 1136 (lambda* (#:key inputs outputs make-flags #:allow-other-keys #:rest args)
1a6497de
DM
1137 (let* ((out (assoc-ref outputs "out"))
1138 (out-python (string-append out
2ea4587d
DM
1139 "/lib/python"
1140 ,(version-major+minor (package-version python))
1141 "/site-packages"))
1a6497de
DM
1142 (install (assoc-ref %standard-phases 'install)))
1143 (install #:make-flags (cons (string-append "PYLIB=" out-python)
1144 make-flags))))))))
1145 (home-page "https://code.google.com/archive/p/libmpsse/")
1146 (synopsis "Python library for MPSSE SPI I2C JTAG adapter by FTDI")
1147 (description "This package provides a library in order to support the
1148MPSSE (Multi-Protocol Synchronous Serial Engine) adapter by FTDI that can do
1149SPI, I2C, JTAG.")
1150 (license license:gpl2+)))
981bccf1 1151
2ea4587d
DM
1152(define-public python2-libmpsse
1153 (package
1154 (inherit python-libmpsse)
1155 (name "python2-libmpsse")
1156 (arguments
1157 (substitute-keyword-arguments (package-arguments python-libmpsse)
1158 ((#:phases phases)
1159 `(modify-phases ,phases
1160 (replace 'set-environment-up
1161 (lambda* (#:key inputs outputs #:allow-other-keys)
1162 (let ((python (assoc-ref inputs "python")))
1163 (chdir "src")
1164 (setenv "PYDEV" (string-append python
1165 "/include/python"
1166 ,(version-major+minor (package-version python-2))))
1167 #t)))
1168 (replace 'install
1169 (lambda* (#:key inputs outputs make-flags #:allow-other-keys #:rest args)
1170 (let* ((out (assoc-ref outputs "out"))
1171 (out-python (string-append out
1172 "/lib/python"
1173 ,(version-major+minor (package-version python-2))
1174 "/site-packages"))
1175 (install (assoc-ref %standard-phases 'install)))
1176 (install #:make-flags (cons (string-append "PYLIB=" out-python)
1177 make-flags)))))))))
1178 (inputs
1179 (alist-replace "python" (list python-2)
1180 (package-inputs python-libmpsse)))))
1181
981bccf1
DM
1182(define-public picprog
1183 (package
1184 (name "picprog")
1185 (version "1.9.1")
1186 (source (origin
1187 (method url-fetch)
1188 (uri (string-append "http://www.iki.fi/hyvatti/pic/picprog-"
1189 version ".tar.gz"))
1190 (file-name (string-append name "-" version ".tar.gz"))
1191 (sha256
1192 (base32
316fd29f
EF
1193 "1r04hg1n3v2jf915qr05la3q9cxy7a5jnh9cc98j04lh6c9p4x85"))
1194 (patches (search-patches "picprog-non-intel-support.patch"))))
981bccf1
DM
1195 (build-system gnu-build-system)
1196 (arguments
1197 `(#:tests? #f ; No tests exist.
1198 #:phases
1199 (modify-phases %standard-phases
1200 (add-after 'unpack 'patch-paths
1201 (lambda* (#:key outputs #:allow-other-keys)
1202 (substitute* "Makefile"
1203 (("/usr/local") (assoc-ref outputs "out"))
316fd29f
EF
1204 ((" -o 0 -g 0 ") " ")
1205 (("testport") ""))
981bccf1
DM
1206 #t))
1207 (add-before 'install 'mkdir
1208 (lambda* (#:key outputs #:allow-other-keys)
1209 (let ((out (assoc-ref outputs "out")))
1210 (mkdir-p (string-append out "/bin"))
1211 (mkdir-p (string-append out "/man/man1"))
1212 #t)))
1213 (delete 'configure))))
1214 (synopsis "Programs Microchip's PIC microcontrollers")
1215 (description "This program programs Microchip's PIC microcontrollers.")
dd8cf009 1216 (home-page "https://hyvatti.iki.fi/~jaakko/pic/picprog.html")
981bccf1 1217 (license license:gpl3+)))
cc8d346b
DM
1218
1219(define-public fc-host-tools
1220 (package
1221 (name "fc-host-tools")
3581d4be 1222 (version "14")
cc8d346b
DM
1223 (source (origin
1224 (method url-fetch)
1225 (uri (string-append "ftp://ftp.freecalypso.org/pub/GSM/"
1226 "FreeCalypso/fc-host-tools-r" version ".tar.bz2"))
1227 (sha256
1228 (base32
3581d4be 1229 "09ccd76khfvlx4dwi9dhrzl5mm68402mlych0g7f9ncfr5jzyf26"))))
cc8d346b
DM
1230 (build-system gnu-build-system)
1231 (arguments
1232 `(#:tests? #f ; No tests exist.
1233 #:make-flags
eb6ef893 1234 (list (string-append "INSTALL_PREFIX=" %output)
cc8d346b
DM
1235 (string-append "INCLUDE_INSTALL_DIR=" %output "include/rvinterf"))
1236 #:phases
1237 (modify-phases %standard-phases
1333eb58 1238 (add-after 'unpack 'patch-installation-paths
cc8d346b
DM
1239 (lambda* (#:key outputs #:allow-other-keys)
1240 (substitute* '("Makefile"
6adfcbea
DM
1241 "rvinterf/etmsync/fsiomain.c"
1242 "rvinterf/etmsync/fsnew.c"
1243 "rvinterf/asyncshell/help.c"
1244 "rvinterf/libinterf/launchrvif.c"
cc8d346b
DM
1245 "loadtools/defpath.c"
1246 "loadtools/Makefile"
1247 "miscutil/c139explore"
1dec2691
DM
1248 "miscutil/pirexplore"
1249 "ffstools/tiffs-wrappers/installpath.c"
1dec2691 1250 "uptools/atcmd/atinterf.c")
cc8d346b
DM
1251 (("/opt/freecalypso/loadtools")
1252 (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools"))
16cb1c51
DM
1253 (("\\$\\{INSTALL_PREFIX\\}/loadtools")
1254 (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools"))
1333eb58
DM
1255 (("\\$\\{INSTALL_PREFIX\\}/target-bin")
1256 (string-append (assoc-ref outputs "out") "/lib/freecalypso/target-bin"))
cc8d346b
DM
1257 (("/opt/freecalypso")
1258 (assoc-ref outputs "out")))
1333eb58
DM
1259 #t))
1260 (delete 'configure))))
cc8d346b
DM
1261 (inputs
1262 `(("libx11" ,libx11)))
1263 (synopsis "Freecalypso host tools")
2eefe1d8 1264 (description "This package provides some tools for debugging FreeCalypso phones and the FreeCalypso FCDEV3B dev board.
cc8d346b
DM
1265
1266@enumerate
1267@item fc-e1decode: Decodes a binary Melody E1 file into an ASCII source file.
1268@item fc-e1gen: Encodes an ASCII Melody E1 file into a binary Melody E1 file.
1269@item fc-fr2tch: Converts a GSM 06.10 speech recording from libgsm to hex
1270strings of TCH bits to be fed to the GSM 05.03 channel encoder of a TI
1271Calypso GSM device.
1272@item fc-tch2fr: Converts hex strings of TCH bits to libgsm.
1273@item fc-gsm2vm: utility converts a GSM 06.10 speech sample from the libgsm
1274source format into a voice memo file that can be uploaded into the FFS of a
1275FreeCalypso device and played with the audio_vm_play_start() API or the
1276AT@@VMP command that invokes the latter.
1277@item fc-rgbconv: Convers RGB 5:6:5 to RGB 8:8:8 and vice versa.
1278@item rvinterf: Communicates with a TI Calypso GSM device via RVTMUX.
1279@item rvtdump: produces a human-readable dump of all output emitted by a
1280TI-based GSM fw on the RVTMUX binary packet interface.
1281@item fc-shell: FreeCalypso firmwares have a feature of our own invention
1282(not present in any pre-existing ones) to accept AT commands over the RVTMUX
1283interface. It is useful when no second UART is available for a dedicated
1284standard AT command interface. fc-shell is the tool that allows you to send
1285AT commands to the firmware in this manner.
1286@item fc-memdump: Captures a memory dump from a GSM device.
1287@item fc-serterm: Trivial serial terminal. Escapes binary chars.
1288@item fc-fsio: Going through rvinterf, this tool connects to GSM devices and
1289allows you to manipulate the device's flash file system.
1290@item tiaud-compile: Compiles an audio mode configuration table for TI's
1291Audio Service from our own ASCII source format into the binary format for
1292uploading into FreeCalypso GSM device FFS with fc-fsio.
1293@item tiaud-decomp: Decodes TI's audio mode configuration files read out of
1294FFS into our own ASCII format.
1295@item tiaud-mkvol: Generates the *.vol binary files which need to accompany
1296the main *.cfg ones.
1297@item fc-compalram: Allows running programs on the device without writing
1298them to flash storage.
1299@item fc-xram: Allows running programs on the device without writing them
1300to flash storage.
1301@item fc-iram: Allows running programs on the device without writing them
1302to flash storage.
1303@item fc-loadtool: Writes programs to the device's flash storage.
1304@item pirffs: Allows listing and extracting FFS content captured as a raw
1305flash image from Pirelli phones.
1306@item mokoffs: Allows listing and extracting FFS content captured as a raw
1307flash image from OpenMoko phones.
1308@item tiffs: Allows listing and extracting FFS content captured as a raw
1309flash image from TI phones.
1310@item c139explore: Run-from-RAM program for C139 phones that
1311exercises their peripheral hardware: LCD, keypad backlight, buzzer, vibrator.
1312@item pirexplore: Run-from-RAM program for Pirelli DP-L10 phones that
1313exercises their peripheral hardware, primarily their LCD.
1314@item tfc139: Breaks into Mot C1xx phones via shellcode injection, allowing
1315you to reflash locked phones with new firmware with fc-loadtool.
1316@item ctracedec: GSM firmwares built in TI's Windows environment have a
1317compressed trace misfeature whereby many of the ASCII strings
1318in debug trace messages get replaced with numeric indices at
1319build time, and these numeric indices are all that gets emitted
1320on the RVTMUX serial channel. This tools decodes these numeric indices
1321back to strings in trace output.
1322@item fc-cal2text: This utility takes a dump of TI's /gsm/rf flash file system
1323directory subtree as input (either extracted in vitro with tiffs
1324or read out in vivo with fc-fsio) and converts all RF tables
1325found therein into a readable ASCII format.
1326@item imei-luhn: Computes or verifies the Luhn check digit of an IMEI number.
1327@item fc-dspapidump: Reads and dumps the contents of the DSP API RAM in a
1328target Calypso GSM device.
1329@item fc-vm2hex: Converts the old-fashioned (non-AMR) voice memo files read
1330out of FFS into hex strings.
1331@item fc-buzplay: Plays piezoelectic buzzer melodies on an actual
1332Calypso device equipped with such a buzzer (Mot C1xx, TI's D-Sample board,
1333our planned future HSMBP) by loading a buzplayer agent onto the target and
1334feeding melodies to be played to it.
1335@item fc-tmsh: TI-based GSM firmwares provide a rich set of Test Mode commands
1336that can be issued through the RVTMUX (debug trace) serial channel.
1337This program is our test mode shell for sending Test Mode commands to targets
1338and displaying decoded target responses.
2eefe1d8
DM
1339@item fcup-smsend: Send a short message via SMS
1340@item fcup-smsendmult: Send multiple short messages via SMS in one go
1341@item fcup-smsendpdu: Send multiple short messages given in PDU format via SMS
1342@item sms-pdu-decode: Decode PDU format messages
1bb4fd64
DM
1343@item fc-dspromdump: Dump DSP ROM.
1344@item pcm-sms-decode: Decode /pcm/SMS binary files read out of FFS maintained
1345by Pirelli DP-L10. Display the SMS in human-readable form.
1346@item srec-regions: Parse S-record (TI's *.m0), identify the set of
1347discontiguous regions into which this SREC image deposits bits, and list
1348these identified regions.
cc8d346b
DM
1349@end enumerate")
1350 (home-page "https://www.freecalypso.org/")
1351 (license license:public-domain)))
615a7eec
CL
1352
1353(define-public stlink
1354 (package
1355 (name "stlink")
1356 (version "1.5.1")
1357 (source
1358 (origin
fe1506a0
EF
1359 (method git-fetch)
1360 (uri (git-reference
1361 (url "https://github.com/texane/stlink")
1362 (commit (string-append "v" version))))
1363 (file-name (git-file-name name version))
615a7eec
CL
1364 (sha256
1365 (base32
fe1506a0 1366 "1d5gxiqpsm8fc105cxlp27af9fk339fap5h6nay21x5a7n61jgyc"))))
615a7eec
CL
1367 (build-system cmake-build-system)
1368 (arguments
1369 `(#:tests? #f ;no tests
1370 #:configure-flags
1371 (let* ((out (assoc-ref %outputs "out"))
1372 (etc (in-vicinity out "etc"))
1373 (modprobe (in-vicinity etc "modprobe.d"))
1374 (udev-rules (in-vicinity etc "udev/rules.d")))
1375 (list (string-append "-DSTLINK_UDEV_RULES_DIR=" udev-rules)
1376 (string-append "-DSTLINK_MODPROBED_DIR=" modprobe)))))
1377 (inputs
1378 `(("libusb" ,libusb)))
1379 (synopsis "Programmer for STM32 Discovery boards")
1380 (description "This package provides a firmware programmer for the STM32
1381Discovery boards. It supports two versions of the chip: ST-LINK/V1 (on
1382STM32VL discovery kits) and ST-LINK/V2 (on STM32L discovery and later kits).
1383Two different transport layers are used: ST-LINK/V1 uses SCSI passthru
1384commands over USB, and ST-LINK/V2 and ST-LINK/V2-1 (seen on Nucleo boards) use
1385raw USB commands.")
1386 (home-page "https://github.com/texane/stlink")
1387 ;; The flashloaders/stm32l0x.s and flashloaders/stm32lx.s source files are
1388 ;; licensed under the GPLv2+.
1389 (license (list license:bsd-3 license:gpl2+))))
2c2fc24b
CL
1390
1391(define-public west
1392 (package
1393 (name "west")
1394 (version "0.6.3")
1395 (source
1396 (origin
1397 (method url-fetch)
1398 (uri (pypi-uri "west" version))
1399 (sha256
1400 (base32
1401 "0ql6ij1hrj2ir5wkxm96zgig5qwvfwa75w77wh2y13w6b9cqcr4b"))))
1402 (propagated-inputs
1403 `(("python-colorama" ,python-colorama)
1404 ("python-configobj" ,python-configobj)
1405 ("python-pykwalify" ,python-pykwalify)
1406 ("python-pyyaml" ,python-pyyaml)))
1407 (build-system python-build-system)
1408 (home-page "https://github.com/zephyrproject-rtos/west")
1409 (synopsis "Zephyr RTOS Project meta-tool")
1410 (description "West is the swiss-army knife command line tool of the Zephyr
1411project. Its built-in commands provide a multiple repository management
1412system with features inspired by Google’s Repo tool and Git submodules. West
1413simplifies configuration and is also pluggable: you can write your own west
1414\"extension commands\" which add additional features to west. Zephyr uses
1415this feature to provide conveniences for building applications, flashing and
1416debugging them, and more.")
1417 (license license:expat)))
bbf8a309 1418
bbf8a309
DM
1419(define-public ebusd
1420 (package
1421 (name "ebusd")
1422 (version "3.4")
1423 (source (origin
1424 (method git-fetch)
1425 (uri (git-reference
8ed4c468 1426 (url "https://github.com/john30/ebusd")
bbf8a309
DM
1427 (commit (string-append "v" version))))
1428 (file-name (string-append name "-" version "-checkout"))
1429 (sha256
1430 (base32
1431 "0iva70bam7wdx60bpd3an9kxr28zxlvp3vprivgqshwwdhqa0hzp"))))
1432 (build-system gnu-build-system)
1433 (arguments
1434 `(#:phases
1435 (modify-phases %standard-phases
1436 (add-after 'install 'install-config
1437 (lambda* (#:key inputs outputs #:allow-other-keys)
1438 (let ((config-destination
1439 (string-append (assoc-ref outputs "out")
1440 "/share/ebusd")))
1441 (copy-recursively (string-append (assoc-ref inputs "config")
1442 "/ebusd-2.1.x")
1443 config-destination)
1444 #t))))))
e88242cb
DM
1445 (inputs
1446 `(("mosquitto" ,mosquitto)))
bbf8a309
DM
1447 (native-inputs
1448 `(("automake" ,automake)
1449 ("autoconf" ,autoconf)
1450 ("config"
1451 ,(origin
1452 (method git-fetch)
1453 (uri (git-reference
8ed4c468 1454 (url "https://github.com/john30/ebusd-configuration")
bbf8a309
DM
1455 (commit "666c0f6b9c4d7545eff7f43ab28a1c7baeab7913")))
1456 (file-name "config-checkout")
1457 (sha256
1458 (base32
1459 "0yxnx8p4lbk614l16854r9s9d8s9c7ixgczfs8mph94xz0wkda7x"))))))
1460 (synopsis "Daemon for communicating with eBUS devices")
1461 (description "This package provides @command{ebusd}, a daemon for
1462handling communication with eBUS devices connected to a 2-wire bus system
1463(\"energy bus\" used by numerous heating systems).")
1464 (home-page "https://ebusd.eu/")
1465 (license license:gpl3+)))
29e91f0a
SS
1466
1467(define-public ucsim
1468 (package
1469 (name "ucsim")
1470 (version "0.6-pre67")
1471 (source (origin
1472 (method url-fetch)
1473 (uri (string-append
1474 "http://mazsola.iit.uni-miskolc.hu/ucsim/download/unix/"
1475 "devel/ucsim-" version ".tar.gz"))
1476 (sha256
1477 (base32
1478 "0aahj9pbfjphjrm4hgs9pfmp6d5aikaq4yvxlrvhywjinnnf0qp1"))))
1479 (build-system gnu-build-system)
1480 (arguments
1481 `(#:configure-flags '("--enable-avr-port"
1482 "--enable-m6809-port"
1483 "--enable-p1516-port"
1484 "--enable-st7-port")
1485 #:phases
1486 (modify-phases %standard-phases
1487 (add-after 'unpack 'patch-makefiles
1488 (lambda _
1489 (substitute* (find-files "." "(\\.mk$|\\.in$)")
1490 (("/bin/sh") (which "sh")))
1491 #t))
1492 (add-after 'install 'remove-empty-directory
1493 (lambda* (#:key outputs #:allow-other-keys)
1494 (delete-file-recursively
1495 (string-append (assoc-ref outputs "out") "/share/man"))
1496 #t)))))
1497 (native-inputs
1498 `(("bison" ,bison)
1499 ("flex" ,flex)))
1500 (home-page "http://mazsola.iit.uni-miskolc.hu/ucsim/")
1501 (synopsis "Simulators for various microcontroller families")
1502 (description "μCsim is a collection of software simulators for
1503microcontrollers in the Atmel AVR; Intel MCS-51 (8051); Motorola 68HC08 and
15046809; P1516; Padauk PDK13, PDK14 and PDK15; STMicroelectronics ST7 and STM8;
1505and Zilog Z80 families, plus many of their variants.")
1506 (license license:gpl2+)))
c626e281
SS
1507
1508(define-public sdcc
1509 (package
1510 (name "sdcc")
e6cd049e 1511 (version "4.1.0")
c626e281
SS
1512 (source (origin
1513 (method url-fetch)
1514 (uri (string-append
1515 "mirror://sourceforge/sdcc/sdcc"
1516 "/" version "/sdcc-src-" version ".tar.bz2"))
1517 (sha256
1518 (base32
e6cd049e 1519 "0gskzli17ghnn5qllvn4d56qf9bvvclqjh63nnj63p52smvggvc1"))
c626e281
SS
1520 (modules '((guix build utils)))
1521 (snippet
1522 '(begin
1523 ;; Remove non-free source files
1524 (delete-file-recursively "device/non-free")
1525 ;; Remove bundled μCsim source
1526 (delete-file-recursively "sim")
1527 #t))
1528 (patches (search-patches "sdcc-disable-non-free-code.patch"))))
1529 (build-system gnu-build-system)
1530 (native-inputs
1531 `(("bison" ,bison)
1532 ("boost" ,boost)
1533 ("flex" ,flex)
1534 ("python-2" ,python-2)
0b8c90b6
SS
1535 ("texinfo" ,texinfo)
1536 ("zlib" ,zlib)))
c626e281 1537 (arguments
c11fedf6
SS
1538 `(;; GPUTILS is required for the PIC ports, but the licensing status of
1539 ;; some of the files contained in its distribution is unclear (see
1540 ;; https://issues.guix.gnu.org/44557). For this reason it is not yet
1541 ;; available as a package in Guix.
c626e281
SS
1542 #:configure-flags
1543 '("--disable-pic14-port" "--disable-pic16-port" "--disable-ucsim")
1544 #:phases
1545 (modify-phases %standard-phases
c369a907 1546 (add-after 'unpack 'patch-makefiles
c626e281
SS
1547 (lambda _
1548 (substitute* (find-files "." "(\\.mk$|\\.in$)")
1549 (("/bin/sh") (which "sh")))
1550 #t)))))
1551 (home-page "http://sdcc.sourceforge.net")
20ba8656 1552 (synopsis "C compiler suite for 8-bit microcontrollers")
c626e281 1553 (description "SDCC is a retargetable, optimizing Standard C compiler suite
0b8c90b6
SS
1554that targets 8-bit microcontrollers in the Intel MCS-51 (8051); Motorola
155568HC08; Padauk PDK13, PDK14 and PDK15; STMicroelectronics STM8; and Zilog Z80
1556families, plus many of their variants.")
1fd317de
SS
1557 (license (list license:gpl2+
1558 license:gpl3+
1559 license:lgpl2.0+
1560 license:lgpl2.1+
1561 license:lgpl3+
1562 license:public-domain
1563 license:zlib))))
a613abeb
JL
1564
1565(define-public python-psptool
1566 (package
1567 (name "python-psptool")
1568 (version "2.2")
1569 (source (origin
1570 (method url-fetch)
1571 (uri (pypi-uri "psptool" version))
1572 (sha256
1573 (base32
1574 "1kx0xpfx67m4zclk4gs97wiwjms8i7z4f6b6m68y8sfgpshy4rf3"))
1575 (modules '((guix build utils)))
1576 (snippet
1577 '(begin
1578 ;; IPython is not used by the package at all
1579 (substitute* '("psptool/directory.py" "psptool/entry.py")
1580 (("from IPython.*") ""))))))
1581 (build-system python-build-system)
1582 (propagated-inputs
1583 `(("python-cryptography" ,python-cryptography)
1584 ("python-prettytable" ,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+)))
337cb4a0
CL
1589
1590(define-public agent-proxy
1591 (let ((commit "8927798a71d246871ea8fc22b4512296a3fa1765")
1592 (revision "0"))
1593 (package
1594 (name "agent-proxy")
1595 (version (git-version "1.98" revision commit))
1596 (home-page
1597 "https://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git")
1598 (source (origin
1599 (method git-fetch)
1600 (uri (git-reference (url home-page) (commit commit)))
1601 (file-name (git-file-name name version))
1602 (sha256
1603 (base32
1604 "1bxkzwsqfld4pknmiq8j3k55pv90n8s6kzh0xh42bhy2jv1wxz2z"))))
1605 (build-system gnu-build-system)
1606 (arguments
1607 `(#:tests? #f
1608 #:phases
1609 (modify-phases %standard-phases
1610 (delete 'configure)
1611 (add-after 'build 'build-kdmx
1612 (lambda _
1613 (invoke "make" "-C" "kdmx")
1614 #t))
1615 (replace 'install
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)
1620 #t))))))
1621 (synopsis "Proxies to run kgdb/gdbserver and console on a serial port")
1622 (description "These programs are proxies allowing to run kgdb/gdbserver
1623and console on a single serial port. agent-proxy creates network sockets,
1624whereas kdmx creates pseudo-ttys.")
1625 (license license:gpl2))))