Commit | Line | Data |
---|---|---|
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 | |
207 | systems. It is a conglomeration of several library parts that are easily | |
208 | usable 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 | |
430 | library 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 | |
462 | bare metal development. This includes the GCC arm-none-eabi cross compiler | |
463 | and newlib (or newlib-nano) as the C library. The supported programming | |
464 | languages 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 | 528 | SEGGER 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 | |
566 | language.") | |
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 | 634 | with 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 | |
815 | micro-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 | |
833 | Propeller 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 | |
872 | Parallax Propeller. It was ported from Chip Gracey's original x86 assembler | |
873 | code.") | |
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 | |
908 | upload 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 | |
955 | the Parallax Propeller micro-controller into C or C++ code, into PASM, or even | |
956 | directly into an executable binary. The binaries produced use LMM PASM, so | |
957 | they are much faster than regular Spin bytecodes (but also quite a bit | |
958 | larger).") | |
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 | |
991 | and simple debugger for Spin programs written for a Parallax Propeller | |
992 | micro-controller. Spinsim supports execution from cog memory and hub | |
993 | execution, but it does not support multi-tasking. It supports about | |
994 | two-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 | |
1012 | development with Parallax Propeller micro-controllers. It includes the GCC | |
1013 | toolchain, the loader, the Openspin compiler, the Spin2cpp tool, and the Spin | |
1014 | simulator.") | |
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, | |
1066 | the 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, | |
1095 | the 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 | |
1148 | MPSSE (Multi-Protocol Synchronous Serial Engine) adapter by FTDI that can do | |
1149 | SPI, 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") | |
4d69bd76 | 1222 | (version "15") |
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 | |
4d69bd76 | 1229 | "17v3xc44mmlvp0irwm1p55zdgzd31ic3nsjxnv8y28a1i85103cv")))) |
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 | 1239 | (lambda* (#:key outputs #:allow-other-keys) |
b72e27c8 DM |
1240 | (substitute* (cons* "miscutil/c139explore" |
1241 | "miscutil/pirexplore" | |
1242 | (find-files "." "^(.*\\.[ch]|Makefile)$")) | |
4d69bd76 DM |
1243 | (("/opt/freecalypso/bin/fc-simtool") |
1244 | "fc-simtool") | |
1245 | (("/opt/freecalypso/bin/fc-uicc-tool") | |
1246 | "fc-uicc-tool") | |
cc8d346b DM |
1247 | (("/opt/freecalypso/loadtools") |
1248 | (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools")) | |
16cb1c51 DM |
1249 | (("\\$\\{INSTALL_PREFIX\\}/loadtools") |
1250 | (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools")) | |
1333eb58 DM |
1251 | (("\\$\\{INSTALL_PREFIX\\}/target-bin") |
1252 | (string-append (assoc-ref outputs "out") "/lib/freecalypso/target-bin")) | |
cc8d346b DM |
1253 | (("/opt/freecalypso") |
1254 | (assoc-ref outputs "out"))) | |
1333eb58 DM |
1255 | #t)) |
1256 | (delete 'configure)))) | |
cc8d346b DM |
1257 | (inputs |
1258 | `(("libx11" ,libx11))) | |
1259 | (synopsis "Freecalypso host tools") | |
2eefe1d8 | 1260 | (description "This package provides some tools for debugging FreeCalypso phones and the FreeCalypso FCDEV3B dev board. |
cc8d346b DM |
1261 | |
1262 | @enumerate | |
1263 | @item fc-e1decode: Decodes a binary Melody E1 file into an ASCII source file. | |
1264 | @item fc-e1gen: Encodes an ASCII Melody E1 file into a binary Melody E1 file. | |
1265 | @item fc-fr2tch: Converts a GSM 06.10 speech recording from libgsm to hex | |
1266 | strings of TCH bits to be fed to the GSM 05.03 channel encoder of a TI | |
1267 | Calypso GSM device. | |
1268 | @item fc-tch2fr: Converts hex strings of TCH bits to libgsm. | |
1269 | @item fc-gsm2vm: utility converts a GSM 06.10 speech sample from the libgsm | |
1270 | source format into a voice memo file that can be uploaded into the FFS of a | |
1271 | FreeCalypso device and played with the audio_vm_play_start() API or the | |
1272 | AT@@VMP command that invokes the latter. | |
1273 | @item fc-rgbconv: Convers RGB 5:6:5 to RGB 8:8:8 and vice versa. | |
1274 | @item rvinterf: Communicates with a TI Calypso GSM device via RVTMUX. | |
1275 | @item rvtdump: produces a human-readable dump of all output emitted by a | |
1276 | TI-based GSM fw on the RVTMUX binary packet interface. | |
1277 | @item fc-shell: FreeCalypso firmwares have a feature of our own invention | |
1278 | (not present in any pre-existing ones) to accept AT commands over the RVTMUX | |
1279 | interface. It is useful when no second UART is available for a dedicated | |
1280 | standard AT command interface. fc-shell is the tool that allows you to send | |
1281 | AT commands to the firmware in this manner. | |
1282 | @item fc-memdump: Captures a memory dump from a GSM device. | |
1283 | @item fc-serterm: Trivial serial terminal. Escapes binary chars. | |
1284 | @item fc-fsio: Going through rvinterf, this tool connects to GSM devices and | |
1285 | allows you to manipulate the device's flash file system. | |
1286 | @item tiaud-compile: Compiles an audio mode configuration table for TI's | |
1287 | Audio Service from our own ASCII source format into the binary format for | |
1288 | uploading into FreeCalypso GSM device FFS with fc-fsio. | |
1289 | @item tiaud-decomp: Decodes TI's audio mode configuration files read out of | |
1290 | FFS into our own ASCII format. | |
1291 | @item tiaud-mkvol: Generates the *.vol binary files which need to accompany | |
1292 | the main *.cfg ones. | |
1293 | @item fc-compalram: Allows running programs on the device without writing | |
1294 | them to flash storage. | |
1295 | @item fc-xram: Allows running programs on the device without writing them | |
1296 | to flash storage. | |
1297 | @item fc-iram: Allows running programs on the device without writing them | |
1298 | to flash storage. | |
1299 | @item fc-loadtool: Writes programs to the device's flash storage. | |
4d69bd76 DM |
1300 | @item fc-simint: Loads and runs simagent on the phone, then calls fc-simtool |
1301 | (see @url{https://www.freecalypso.org/hg/fc-sim-tools,fc-sim-tools | |
1302 | repository}) on the host to connect to it. | |
cc8d346b DM |
1303 | @item pirffs: Allows listing and extracting FFS content captured as a raw |
1304 | flash image from Pirelli phones. | |
1305 | @item mokoffs: Allows listing and extracting FFS content captured as a raw | |
1306 | flash image from OpenMoko phones. | |
1307 | @item tiffs: Allows listing and extracting FFS content captured as a raw | |
1308 | flash image from TI phones. | |
1309 | @item c139explore: Run-from-RAM program for C139 phones that | |
1310 | exercises their peripheral hardware: LCD, keypad backlight, buzzer, vibrator. | |
1311 | @item pirexplore: Run-from-RAM program for Pirelli DP-L10 phones that | |
1312 | exercises their peripheral hardware, primarily their LCD. | |
1313 | @item tfc139: Breaks into Mot C1xx phones via shellcode injection, allowing | |
1314 | you to reflash locked phones with new firmware with fc-loadtool. | |
1315 | @item ctracedec: GSM firmwares built in TI's Windows environment have a | |
1316 | compressed trace misfeature whereby many of the ASCII strings | |
1317 | in debug trace messages get replaced with numeric indices at | |
1318 | build time, and these numeric indices are all that gets emitted | |
1319 | on the RVTMUX serial channel. This tools decodes these numeric indices | |
1320 | back to strings in trace output. | |
1321 | @item fc-cal2text: This utility takes a dump of TI's /gsm/rf flash file system | |
1322 | directory subtree as input (either extracted in vitro with tiffs | |
1323 | or read out in vivo with fc-fsio) and converts all RF tables | |
1324 | found therein into a readable ASCII format. | |
1325 | @item imei-luhn: Computes or verifies the Luhn check digit of an IMEI number. | |
1326 | @item fc-dspapidump: Reads and dumps the contents of the DSP API RAM in a | |
1327 | target Calypso GSM device. | |
1328 | @item fc-vm2hex: Converts the old-fashioned (non-AMR) voice memo files read | |
1329 | out of FFS into hex strings. | |
1330 | @item fc-buzplay: Plays piezoelectic buzzer melodies on an actual | |
1331 | Calypso device equipped with such a buzzer (Mot C1xx, TI's D-Sample board, | |
1332 | our planned future HSMBP) by loading a buzplayer agent onto the target and | |
1333 | feeding melodies to be played to it. | |
1334 | @item fc-tmsh: TI-based GSM firmwares provide a rich set of Test Mode commands | |
1335 | that can be issued through the RVTMUX (debug trace) serial channel. | |
1336 | This program is our test mode shell for sending Test Mode commands to targets | |
1337 | and displaying decoded target responses. | |
2eefe1d8 DM |
1338 | @item fcup-smsend: Send a short message via SMS |
1339 | @item fcup-smsendmult: Send multiple short messages via SMS in one go | |
1340 | @item fcup-smsendpdu: Send multiple short messages given in PDU format via SMS | |
1341 | @item sms-pdu-decode: Decode PDU format messages | |
1bb4fd64 DM |
1342 | @item fc-dspromdump: Dump DSP ROM. |
1343 | @item pcm-sms-decode: Decode /pcm/SMS binary files read out of FFS maintained | |
1344 | by Pirelli DP-L10. Display the SMS in human-readable form. | |
1345 | @item srec-regions: Parse S-record (TI's *.m0), identify the set of | |
1346 | discontiguous regions into which this SREC image deposits bits, and list | |
1347 | these identified regions. | |
cc8d346b DM |
1348 | @end enumerate") |
1349 | (home-page "https://www.freecalypso.org/") | |
1350 | (license license:public-domain))) | |
615a7eec CL |
1351 | |
1352 | (define-public stlink | |
1353 | (package | |
1354 | (name "stlink") | |
1355 | (version "1.5.1") | |
1356 | (source | |
1357 | (origin | |
fe1506a0 EF |
1358 | (method git-fetch) |
1359 | (uri (git-reference | |
1360 | (url "https://github.com/texane/stlink") | |
1361 | (commit (string-append "v" version)))) | |
1362 | (file-name (git-file-name name version)) | |
615a7eec CL |
1363 | (sha256 |
1364 | (base32 | |
fe1506a0 | 1365 | "1d5gxiqpsm8fc105cxlp27af9fk339fap5h6nay21x5a7n61jgyc")))) |
615a7eec CL |
1366 | (build-system cmake-build-system) |
1367 | (arguments | |
1368 | `(#:tests? #f ;no tests | |
1369 | #:configure-flags | |
1370 | (let* ((out (assoc-ref %outputs "out")) | |
1371 | (etc (in-vicinity out "etc")) | |
1372 | (modprobe (in-vicinity etc "modprobe.d")) | |
1373 | (udev-rules (in-vicinity etc "udev/rules.d"))) | |
1374 | (list (string-append "-DSTLINK_UDEV_RULES_DIR=" udev-rules) | |
1375 | (string-append "-DSTLINK_MODPROBED_DIR=" modprobe))))) | |
1376 | (inputs | |
1377 | `(("libusb" ,libusb))) | |
1378 | (synopsis "Programmer for STM32 Discovery boards") | |
1379 | (description "This package provides a firmware programmer for the STM32 | |
1380 | Discovery boards. It supports two versions of the chip: ST-LINK/V1 (on | |
1381 | STM32VL discovery kits) and ST-LINK/V2 (on STM32L discovery and later kits). | |
1382 | Two different transport layers are used: ST-LINK/V1 uses SCSI passthru | |
1383 | commands over USB, and ST-LINK/V2 and ST-LINK/V2-1 (seen on Nucleo boards) use | |
1384 | raw USB commands.") | |
1385 | (home-page "https://github.com/texane/stlink") | |
1386 | ;; The flashloaders/stm32l0x.s and flashloaders/stm32lx.s source files are | |
1387 | ;; licensed under the GPLv2+. | |
1388 | (license (list license:bsd-3 license:gpl2+)))) | |
2c2fc24b CL |
1389 | |
1390 | (define-public west | |
1391 | (package | |
1392 | (name "west") | |
1393 | (version "0.6.3") | |
1394 | (source | |
1395 | (origin | |
1396 | (method url-fetch) | |
1397 | (uri (pypi-uri "west" version)) | |
1398 | (sha256 | |
1399 | (base32 | |
1400 | "0ql6ij1hrj2ir5wkxm96zgig5qwvfwa75w77wh2y13w6b9cqcr4b")))) | |
1401 | (propagated-inputs | |
1402 | `(("python-colorama" ,python-colorama) | |
1403 | ("python-configobj" ,python-configobj) | |
1404 | ("python-pykwalify" ,python-pykwalify) | |
1405 | ("python-pyyaml" ,python-pyyaml))) | |
1406 | (build-system python-build-system) | |
1407 | (home-page "https://github.com/zephyrproject-rtos/west") | |
1408 | (synopsis "Zephyr RTOS Project meta-tool") | |
1409 | (description "West is the swiss-army knife command line tool of the Zephyr | |
1410 | project. Its built-in commands provide a multiple repository management | |
1411 | system with features inspired by Google’s Repo tool and Git submodules. West | |
1412 | simplifies configuration and is also pluggable: you can write your own west | |
1413 | \"extension commands\" which add additional features to west. Zephyr uses | |
1414 | this feature to provide conveniences for building applications, flashing and | |
1415 | debugging them, and more.") | |
1416 | (license license:expat))) | |
bbf8a309 | 1417 | |
bbf8a309 DM |
1418 | (define-public ebusd |
1419 | (package | |
1420 | (name "ebusd") | |
1421 | (version "3.4") | |
1422 | (source (origin | |
1423 | (method git-fetch) | |
1424 | (uri (git-reference | |
8ed4c468 | 1425 | (url "https://github.com/john30/ebusd") |
bbf8a309 DM |
1426 | (commit (string-append "v" version)))) |
1427 | (file-name (string-append name "-" version "-checkout")) | |
1428 | (sha256 | |
1429 | (base32 | |
1430 | "0iva70bam7wdx60bpd3an9kxr28zxlvp3vprivgqshwwdhqa0hzp")))) | |
1431 | (build-system gnu-build-system) | |
1432 | (arguments | |
1433 | `(#:phases | |
1434 | (modify-phases %standard-phases | |
1435 | (add-after 'install 'install-config | |
1436 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1437 | (let ((config-destination | |
1438 | (string-append (assoc-ref outputs "out") | |
1439 | "/share/ebusd"))) | |
1440 | (copy-recursively (string-append (assoc-ref inputs "config") | |
1441 | "/ebusd-2.1.x") | |
1442 | config-destination) | |
1443 | #t)))))) | |
e88242cb DM |
1444 | (inputs |
1445 | `(("mosquitto" ,mosquitto))) | |
bbf8a309 DM |
1446 | (native-inputs |
1447 | `(("automake" ,automake) | |
1448 | ("autoconf" ,autoconf) | |
1449 | ("config" | |
1450 | ,(origin | |
1451 | (method git-fetch) | |
1452 | (uri (git-reference | |
8ed4c468 | 1453 | (url "https://github.com/john30/ebusd-configuration") |
bbf8a309 DM |
1454 | (commit "666c0f6b9c4d7545eff7f43ab28a1c7baeab7913"))) |
1455 | (file-name "config-checkout") | |
1456 | (sha256 | |
1457 | (base32 | |
1458 | "0yxnx8p4lbk614l16854r9s9d8s9c7ixgczfs8mph94xz0wkda7x")))))) | |
1459 | (synopsis "Daemon for communicating with eBUS devices") | |
1460 | (description "This package provides @command{ebusd}, a daemon for | |
1461 | handling communication with eBUS devices connected to a 2-wire bus system | |
1462 | (\"energy bus\" used by numerous heating systems).") | |
1463 | (home-page "https://ebusd.eu/") | |
1464 | (license license:gpl3+))) | |
29e91f0a SS |
1465 | |
1466 | (define-public ucsim | |
1467 | (package | |
1468 | (name "ucsim") | |
4261c15a | 1469 | (version "0.6-pre68") |
29e91f0a SS |
1470 | (source (origin |
1471 | (method url-fetch) | |
1472 | (uri (string-append | |
1473 | "http://mazsola.iit.uni-miskolc.hu/ucsim/download/unix/" | |
1474 | "devel/ucsim-" version ".tar.gz")) | |
1475 | (sha256 | |
1476 | (base32 | |
4261c15a | 1477 | "1bfj21f5pcfcg1xqqynlcfr8mn6qj5705cgc2lfr2s3n97qsd9df")))) |
29e91f0a SS |
1478 | (build-system gnu-build-system) |
1479 | (arguments | |
1480 | `(#:configure-flags '("--enable-avr-port" | |
1481 | "--enable-m6809-port" | |
1482 | "--enable-p1516-port" | |
1483 | "--enable-st7-port") | |
1484 | #:phases | |
1485 | (modify-phases %standard-phases | |
1486 | (add-after 'unpack 'patch-makefiles | |
1487 | (lambda _ | |
1488 | (substitute* (find-files "." "(\\.mk$|\\.in$)") | |
1489 | (("/bin/sh") (which "sh"))) | |
1490 | #t)) | |
1491 | (add-after 'install 'remove-empty-directory | |
1492 | (lambda* (#:key outputs #:allow-other-keys) | |
1493 | (delete-file-recursively | |
1494 | (string-append (assoc-ref outputs "out") "/share/man")) | |
1495 | #t))))) | |
1496 | (native-inputs | |
1497 | `(("bison" ,bison) | |
1498 | ("flex" ,flex))) | |
1499 | (home-page "http://mazsola.iit.uni-miskolc.hu/ucsim/") | |
1500 | (synopsis "Simulators for various microcontroller families") | |
1501 | (description "μCsim is a collection of software simulators for | |
1502 | microcontrollers in the Atmel AVR; Intel MCS-51 (8051); Motorola 68HC08 and | |
1503 | 6809; P1516; Padauk PDK13, PDK14 and PDK15; STMicroelectronics ST7 and STM8; | |
1504 | and Zilog Z80 families, plus many of their variants.") | |
1505 | (license license:gpl2+))) | |
c626e281 SS |
1506 | |
1507 | (define-public sdcc | |
1508 | (package | |
1509 | (name "sdcc") | |
e6cd049e | 1510 | (version "4.1.0") |
c626e281 SS |
1511 | (source (origin |
1512 | (method url-fetch) | |
1513 | (uri (string-append | |
1514 | "mirror://sourceforge/sdcc/sdcc" | |
1515 | "/" version "/sdcc-src-" version ".tar.bz2")) | |
1516 | (sha256 | |
1517 | (base32 | |
e6cd049e | 1518 | "0gskzli17ghnn5qllvn4d56qf9bvvclqjh63nnj63p52smvggvc1")) |
c626e281 SS |
1519 | (modules '((guix build utils))) |
1520 | (snippet | |
1521 | '(begin | |
1522 | ;; Remove non-free source files | |
1523 | (delete-file-recursively "device/non-free") | |
1524 | ;; Remove bundled μCsim source | |
1525 | (delete-file-recursively "sim") | |
1526 | #t)) | |
1527 | (patches (search-patches "sdcc-disable-non-free-code.patch")))) | |
1528 | (build-system gnu-build-system) | |
1529 | (native-inputs | |
1530 | `(("bison" ,bison) | |
1531 | ("boost" ,boost) | |
1532 | ("flex" ,flex) | |
1533 | ("python-2" ,python-2) | |
0b8c90b6 SS |
1534 | ("texinfo" ,texinfo) |
1535 | ("zlib" ,zlib))) | |
c626e281 | 1536 | (arguments |
c11fedf6 SS |
1537 | `(;; GPUTILS is required for the PIC ports, but the licensing status of |
1538 | ;; some of the files contained in its distribution is unclear (see | |
1539 | ;; https://issues.guix.gnu.org/44557). For this reason it is not yet | |
1540 | ;; available as a package in Guix. | |
c626e281 SS |
1541 | #:configure-flags |
1542 | '("--disable-pic14-port" "--disable-pic16-port" "--disable-ucsim") | |
1543 | #:phases | |
1544 | (modify-phases %standard-phases | |
c369a907 | 1545 | (add-after 'unpack 'patch-makefiles |
c626e281 SS |
1546 | (lambda _ |
1547 | (substitute* (find-files "." "(\\.mk$|\\.in$)") | |
1548 | (("/bin/sh") (which "sh"))) | |
e4beaa7c JL |
1549 | ;; --disable-ucsim disables sdcc-misc, patch it back in. |
1550 | (substitute* "Makefile.in" | |
1551 | (("debugger/mcs51" line) | |
1552 | (string-append line "\n" | |
1553 | "TARGETS += sdcc-misc\n" | |
1554 | "PKGS += $(SDCC_MISC)"))) | |
c626e281 SS |
1555 | #t))))) |
1556 | (home-page "http://sdcc.sourceforge.net") | |
20ba8656 | 1557 | (synopsis "C compiler suite for 8-bit microcontrollers") |
c626e281 | 1558 | (description "SDCC is a retargetable, optimizing Standard C compiler suite |
0b8c90b6 SS |
1559 | that targets 8-bit microcontrollers in the Intel MCS-51 (8051); Motorola |
1560 | 68HC08; Padauk PDK13, PDK14 and PDK15; STMicroelectronics STM8; and Zilog Z80 | |
1561 | families, plus many of their variants.") | |
1fd317de SS |
1562 | (license (list license:gpl2+ |
1563 | license:gpl3+ | |
1564 | license:lgpl2.0+ | |
1565 | license:lgpl2.1+ | |
1566 | license:lgpl3+ | |
1567 | license:public-domain | |
1568 | license:zlib)))) | |
a613abeb JL |
1569 | |
1570 | (define-public python-psptool | |
1571 | (package | |
1572 | (name "python-psptool") | |
1573 | (version "2.2") | |
1574 | (source (origin | |
1575 | (method url-fetch) | |
1576 | (uri (pypi-uri "psptool" version)) | |
1577 | (sha256 | |
1578 | (base32 | |
1579 | "1kx0xpfx67m4zclk4gs97wiwjms8i7z4f6b6m68y8sfgpshy4rf3")) | |
1580 | (modules '((guix build utils))) | |
1581 | (snippet | |
1582 | '(begin | |
1583 | ;; IPython is not used by the package at all | |
1584 | (substitute* '("psptool/directory.py" "psptool/entry.py") | |
1585 | (("from IPython.*") "")))))) | |
1586 | (build-system python-build-system) | |
1587 | (propagated-inputs | |
1588 | `(("python-cryptography" ,python-cryptography) | |
1589 | ("python-prettytable" ,python-prettytable))) | |
1590 | (home-page "https://github.com/PSPReverse/psptool") | |
1591 | (synopsis "Tool for dealing with AMD binary blobs") | |
1592 | (description "PSPTool is a tool for dealing with AMD binary blobs") | |
1593 | (license license:gpl3+))) | |
337cb4a0 CL |
1594 | |
1595 | (define-public agent-proxy | |
1596 | (let ((commit "8927798a71d246871ea8fc22b4512296a3fa1765") | |
1597 | (revision "0")) | |
1598 | (package | |
1599 | (name "agent-proxy") | |
1600 | (version (git-version "1.98" revision commit)) | |
1601 | (home-page | |
1602 | "https://git.kernel.org/pub/scm/utils/kernel/kgdb/agent-proxy.git") | |
1603 | (source (origin | |
1604 | (method git-fetch) | |
1605 | (uri (git-reference (url home-page) (commit commit))) | |
1606 | (file-name (git-file-name name version)) | |
1607 | (sha256 | |
1608 | (base32 | |
1609 | "1bxkzwsqfld4pknmiq8j3k55pv90n8s6kzh0xh42bhy2jv1wxz2z")))) | |
1610 | (build-system gnu-build-system) | |
1611 | (arguments | |
1612 | `(#:tests? #f | |
1613 | #:phases | |
1614 | (modify-phases %standard-phases | |
1615 | (delete 'configure) | |
1616 | (add-after 'build 'build-kdmx | |
1617 | (lambda _ | |
1618 | (invoke "make" "-C" "kdmx") | |
1619 | #t)) | |
1620 | (replace 'install | |
1621 | (lambda* (#:key outputs #:allow-other-keys) | |
1622 | (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) | |
1623 | (install-file "agent-proxy" bin) | |
1624 | (install-file "kdmx/kdmx" bin) | |
1625 | #t)))))) | |
1626 | (synopsis "Proxies to run kgdb/gdbserver and console on a serial port") | |
1627 | (description "These programs are proxies allowing to run kgdb/gdbserver | |
1628 | and console on a single serial port. agent-proxy creates network sockets, | |
1629 | whereas kdmx creates pseudo-ttys.") | |
1630 | (license license:gpl2)))) |