Commit | Line | Data |
---|---|---|
35a37efb | 1 | ;;; GNU Guix --- Functional package management for GNU |
8226304b | 2 | ;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net> |
2da8865a | 3 | ;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org> |
e5e45c06 | 4 | ;;; Copyright © 2016 David Craven <david@craven.ch> |
316fd29f | 5 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
4886d5b2 | 6 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
35a37efb RW |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages embedded) | |
24 | #:use-module (guix utils) | |
25 | #:use-module (guix packages) | |
26 | #:use-module (guix download) | |
27 | #:use-module (guix svn-download) | |
28 | #:use-module (guix git-download) | |
29 | #:use-module ((guix licenses) #:prefix license:) | |
30 | #:use-module (guix build-system gnu) | |
569f6016 TF |
31 | #:use-module (guix build-system trivial) |
32 | #:use-module (guix build utils) | |
35a37efb | 33 | #:use-module (gnu packages) |
e5e45c06 | 34 | #:use-module (gnu packages autotools) |
8ea42482 | 35 | #:use-module ((gnu packages base) #:prefix base:) |
2d7c9213 | 36 | #:use-module (gnu packages bison) |
35a37efb | 37 | #:use-module (gnu packages cross-base) |
2d7c9213 | 38 | #:use-module (gnu packages dejagnu) |
35a37efb | 39 | #:use-module (gnu packages flex) |
dbc3c34e | 40 | #:use-module (gnu packages gcc) |
94f36a4f | 41 | #:use-module (gnu packages gdb) |
8ea42482 | 42 | #:use-module (gnu packages guile) |
5b83b7b8 | 43 | #:use-module (gnu packages libftdi) |
e5e45c06 | 44 | #:use-module (gnu packages libusb) |
35a37efb | 45 | #:use-module (gnu packages perl) |
e5e45c06 | 46 | #:use-module (gnu packages pkg-config) |
1a6497de DM |
47 | #:use-module (gnu packages python) |
48 | #:use-module (gnu packages swig) | |
7894ea61 | 49 | #:use-module (gnu packages texinfo) |
cc8d346b | 50 | #:use-module (gnu packages xorg) |
7894ea61 | 51 | #:use-module (srfi srfi-1)) |
35a37efb RW |
52 | |
53 | ;; We must not use the released GCC sources here, because the cross-compiler | |
54 | ;; does not produce working binaries. Instead we take the very same SVN | |
55 | ;; revision from the branch that is used for a release of the "GCC ARM | |
56 | ;; embedded" project on launchpad. | |
57 | ;; See https://launchpadlibrarian.net/218827644/release.txt | |
58 | (define-public gcc-arm-none-eabi-4.9 | |
59 | (let ((xgcc (cross-gcc "arm-none-eabi" | |
7b3318e3 RW |
60 | #:xgcc gcc-4.9 |
61 | #:xbinutils (cross-binutils "arm-none-eabi"))) | |
35a37efb RW |
62 | (revision "1") |
63 | (svn-revision 227977)) | |
64 | (package (inherit xgcc) | |
65 | (version (string-append (package-version xgcc) "-" | |
66 | revision "." (number->string svn-revision))) | |
67 | (source | |
68 | (origin | |
69 | (method svn-fetch) | |
70 | (uri (svn-reference | |
71 | (url "svn://gcc.gnu.org/svn/gcc/branches/ARM/embedded-4_9-branch/") | |
72 | (revision svn-revision))) | |
73 | (file-name (string-append "gcc-arm-embedded-" version "-checkout")) | |
74 | (sha256 | |
75 | (base32 | |
76 | "113r98kygy8rrjfv2pd3z6zlfzbj543pq7xyq8bgh72c608mmsbr")) | |
7894ea61 LC |
77 | |
78 | ;; Remove the one patch that doesn't apply to this 4.9 snapshot (the | |
79 | ;; patch is for 4.9.4 and later but this svn snapshot is older). | |
80 | (patches (remove (lambda (patch) | |
81 | (string=? (basename patch) | |
82 | "gcc-arm-bug-71399.patch")) | |
83 | (origin-patches (package-source xgcc)))))) | |
35a37efb RW |
84 | (native-inputs |
85 | `(("flex" ,flex) | |
86 | ,@(package-native-inputs xgcc))) | |
87 | (arguments | |
88 | (substitute-keyword-arguments (package-arguments xgcc) | |
89 | ((#:phases phases) | |
90 | `(modify-phases ,phases | |
91 | (add-after 'unpack 'fix-genmultilib | |
92 | (lambda _ | |
93 | (substitute* "gcc/genmultilib" | |
94 | (("#!/bin/sh") (string-append "#!" (which "sh")))) | |
95 | #t)))) | |
96 | ((#:configure-flags flags) | |
97 | ;; The configure flags are largely identical to the flags used by the | |
98 | ;; "GCC ARM embedded" project. | |
99 | `(append (list "--enable-multilib" | |
100 | "--with-newlib" | |
101 | "--with-multilib-list=armv6-m,armv7-m,armv7e-m" | |
102 | "--with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm" | |
103 | "--enable-plugins" | |
104 | "--disable-decimal-float" | |
105 | "--disable-libffi" | |
106 | "--disable-libgomp" | |
107 | "--disable-libmudflap" | |
108 | "--disable-libquadmath" | |
109 | "--disable-libssp" | |
110 | "--disable-libstdcxx-pch" | |
111 | "--disable-nls" | |
112 | "--disable-shared" | |
113 | "--disable-threads" | |
114 | "--disable-tls") | |
115 | (delete "--disable-multilib" ,flags))))) | |
116 | (native-search-paths | |
117 | (list (search-path-specification | |
118 | (variable "CROSS_C_INCLUDE_PATH") | |
119 | (files '("arm-none-eabi/include"))) | |
120 | (search-path-specification | |
121 | (variable "CROSS_CPLUS_INCLUDE_PATH") | |
122 | (files '("arm-none-eabi/include"))) | |
123 | (search-path-specification | |
124 | (variable "CROSS_LIBRARY_PATH") | |
125 | (files '("arm-none-eabi/lib")))))))) | |
6c39886a | 126 | |
dbc3c34e TF |
127 | (define-public gcc-arm-none-eabi-6 |
128 | (package | |
129 | (inherit gcc-arm-none-eabi-4.9) | |
130 | (version (package-version gcc-6)) | |
131 | (source (origin (inherit (package-source gcc-6)) | |
132 | (patches | |
133 | (append | |
134 | (origin-patches (package-source gcc-6)) | |
135 | (search-patches "gcc-6-cross-environment-variables.patch" | |
136 | "gcc-6-arm-none-eabi-multilib.patch"))))))) | |
137 | ||
6c39886a RW |
138 | (define-public newlib-arm-none-eabi |
139 | (package | |
140 | (name "newlib") | |
141 | (version "2.4.0") | |
142 | (source (origin | |
143 | (method url-fetch) | |
144 | (uri (string-append "ftp://sourceware.org/pub/newlib/newlib-" | |
145 | version ".tar.gz")) | |
146 | (sha256 | |
147 | (base32 | |
148 | "01i7qllwicf05vsvh39qj7qp5fdifpvvky0x95hjq39mbqiksnsl")))) | |
149 | (build-system gnu-build-system) | |
150 | (arguments | |
151 | `(#:out-of-source? #t | |
152 | ;; The configure flags are identical to the flags used by the "GCC ARM | |
153 | ;; embedded" project. | |
154 | #:configure-flags '("--target=arm-none-eabi" | |
155 | "--enable-newlib-io-long-long" | |
156 | "--enable-newlib-register-fini" | |
157 | "--disable-newlib-supplied-syscalls" | |
158 | "--disable-nls") | |
159 | #:phases | |
160 | (modify-phases %standard-phases | |
161 | (add-after 'unpack 'fix-references-to-/bin/sh | |
162 | (lambda _ | |
163 | (substitute* '("libgloss/arm/cpu-init/Makefile.in" | |
164 | "libgloss/arm/Makefile.in" | |
165 | "libgloss/libnosys/Makefile.in" | |
166 | "libgloss/Makefile.in") | |
167 | (("/bin/sh") (which "sh"))) | |
168 | #t))))) | |
169 | (native-inputs | |
170 | `(("xbinutils" ,(cross-binutils "arm-none-eabi")) | |
171 | ("xgcc" ,gcc-arm-none-eabi-4.9) | |
172 | ("texinfo" ,texinfo))) | |
173 | (home-page "http://www.sourceware.org/newlib/") | |
174 | (synopsis "C library for use on embedded systems") | |
175 | (description "Newlib is a C library intended for use on embedded | |
176 | systems. It is a conglomeration of several library parts that are easily | |
177 | usable on embedded products.") | |
178 | (license (license:non-copyleft | |
179 | "https://www.sourceware.org/newlib/COPYING.NEWLIB")))) | |
a299a899 RW |
180 | |
181 | (define-public newlib-nano-arm-none-eabi | |
182 | (package (inherit newlib-arm-none-eabi) | |
183 | (name "newlib-nano") | |
184 | (arguments | |
185 | (substitute-keyword-arguments (package-arguments newlib-arm-none-eabi) | |
186 | ;; The configure flags are identical to the flags used by the "GCC ARM | |
187 | ;; embedded" project. They optimize newlib for use on small embedded | |
188 | ;; systems with limited memory. | |
189 | ((#:configure-flags flags) | |
190 | ''("--target=arm-none-eabi" | |
191 | "--enable-multilib" | |
192 | "--disable-newlib-supplied-syscalls" | |
193 | "--enable-newlib-reent-small" | |
194 | "--disable-newlib-fvwrite-in-streamio" | |
195 | "--disable-newlib-fseek-optimization" | |
196 | "--disable-newlib-wide-orient" | |
197 | "--enable-newlib-nano-malloc" | |
198 | "--disable-newlib-unbuf-stream-opt" | |
199 | "--enable-lite-exit" | |
200 | "--enable-newlib-global-atexit" | |
201 | "--enable-newlib-nano-formatted-io" | |
202 | "--disable-nls")))) | |
203 | (synopsis "Newlib variant for small systems with limited memory"))) | |
569f6016 | 204 | |
1a1e8336 RW |
205 | (define (make-libstdc++-arm-none-eabi xgcc newlib) |
206 | (let ((libstdc++ (make-libstdc++ xgcc))) | |
207 | (package (inherit libstdc++) | |
208 | (name "libstdc++-arm-none-eabi") | |
209 | (arguments | |
210 | (substitute-keyword-arguments (package-arguments libstdc++) | |
211 | ((#:configure-flags flags) | |
212 | ``("--target=arm-none-eabi" | |
213 | "--host=arm-none-eabi" | |
214 | "--disable-libstdcxx-pch" | |
215 | "--enable-multilib" | |
216 | "--with-multilib-list=armv6-m,armv7-m,armv7e-m" | |
217 | "--disable-shared" | |
218 | "--disable-tls" | |
219 | "--disable-plugin" | |
220 | "--with-newlib" | |
221 | ,(string-append "--with-gxx-include-dir=" | |
222 | (assoc-ref %outputs "out") | |
223 | "/arm-none-eabi/include"))))) | |
224 | (native-inputs | |
225 | `(("newlib" ,newlib) | |
226 | ("xgcc" ,xgcc) | |
227 | ,@(package-native-inputs libstdc++)))))) | |
228 | ||
569f6016 TF |
229 | (define (arm-none-eabi-toolchain xgcc newlib) |
230 | "Produce a cross-compiler toolchain package with the compiler XGCC and the C | |
231 | library variant NEWLIB." | |
232 | (let ((newlib-with-xgcc (package (inherit newlib) | |
233 | (native-inputs | |
234 | (alist-replace "xgcc" (list xgcc) | |
235 | (package-native-inputs newlib)))))) | |
236 | (package | |
237 | (name (string-append "arm-none-eabi" | |
238 | (if (string=? (package-name newlib-with-xgcc) | |
239 | "newlib-nano") | |
240 | "-nano" "") | |
241 | "-toolchain")) | |
242 | (version (package-version xgcc)) | |
243 | (source #f) | |
244 | (build-system trivial-build-system) | |
9cdf4872 RW |
245 | (arguments |
246 | '(#:modules ((guix build union)) | |
247 | #:builder | |
248 | (begin | |
249 | (use-modules (ice-9 match) | |
250 | (guix build union)) | |
251 | (match %build-inputs | |
252 | (((names . directories) ...) | |
253 | (union-build (assoc-ref %outputs "out") | |
e3cfef22 MW |
254 | directories) |
255 | #t))))) | |
569f6016 TF |
256 | (propagated-inputs |
257 | `(("binutils" ,(cross-binutils "arm-none-eabi")) | |
8ea169d0 | 258 | ("libstdc++" ,(make-libstdc++-arm-none-eabi xgcc newlib-with-xgcc)) |
569f6016 TF |
259 | ("gcc" ,xgcc) |
260 | ("newlib" ,newlib-with-xgcc))) | |
261 | (synopsis "Complete GCC tool chain for ARM bare metal development") | |
262 | (description "This package provides a complete GCC tool chain for ARM | |
263 | bare metal development. This includes the GCC arm-none-eabi cross compiler | |
264 | and newlib (or newlib-nano) as the C library. The supported programming | |
265 | languages are C and C++.") | |
266 | (home-page (package-home-page xgcc)) | |
267 | (license (package-license xgcc))))) | |
268 | ||
269 | (define-public arm-none-eabi-toolchain-4.9 | |
270 | (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9 | |
271 | newlib-arm-none-eabi)) | |
272 | ||
273 | (define-public arm-none-eabi-nano-toolchain-4.9 | |
274 | (arm-none-eabi-toolchain gcc-arm-none-eabi-4.9 | |
275 | newlib-nano-arm-none-eabi)) | |
276 | ||
277 | (define-public arm-none-eabi-toolchain-6 | |
278 | (arm-none-eabi-toolchain gcc-arm-none-eabi-6 | |
279 | newlib-arm-none-eabi)) | |
280 | ||
281 | (define-public arm-none-eabi-nano-toolchain-6 | |
282 | (arm-none-eabi-toolchain gcc-arm-none-eabi-6 | |
283 | newlib-nano-arm-none-eabi)) | |
94f36a4f TF |
284 | |
285 | (define-public gdb-arm-none-eabi | |
286 | (package | |
287 | (inherit gdb) | |
288 | (name "gdb-arm-none-eabi") | |
289 | (arguments | |
290 | `(#:configure-flags '("--target=arm-none-eabi" | |
291 | "--enable-multilib" | |
292 | "--enable-interwork" | |
293 | "--enable-languages=c,c++" | |
294 | "--disable-nls") | |
295 | ,@(package-arguments gdb))))) | |
e5e45c06 DC |
296 | |
297 | (define-public libjaylink | |
298 | ;; No release tarballs available. | |
2da8865a TF |
299 | (let ((commit "699b7001d34a79c8e7064503dde1bede786fd7f0") |
300 | (revision "2")) | |
e5e45c06 DC |
301 | (package |
302 | (name "libjaylink") | |
303 | (version (string-append "0.1.0-" revision "." | |
304 | (string-take commit 7))) | |
305 | (source (origin | |
306 | (method git-fetch) | |
307 | (uri (git-reference | |
5f13bf09 | 308 | (url "https://git.zapb.de/libjaylink.git") |
e5e45c06 DC |
309 | (commit commit))) |
310 | (file-name (string-append name "-" version "-checkout")) | |
311 | (sha256 | |
312 | (base32 | |
2da8865a | 313 | "034872d44myycnzn67v5b8ixrgmg8sk32aqalvm5x7108w2byww1")))) |
e5e45c06 DC |
314 | (build-system gnu-build-system) |
315 | (native-inputs | |
316 | `(("autoconf" ,autoconf) | |
317 | ("automake" ,automake) | |
318 | ("libtool" ,libtool) | |
319 | ("pkg-config" ,pkg-config))) | |
320 | (inputs | |
321 | `(("libusb" ,libusb))) | |
322 | (arguments | |
323 | `(#:phases | |
324 | (modify-phases %standard-phases | |
d10092b8 | 325 | (add-after 'unpack 'autoreconf |
e5e45c06 DC |
326 | (lambda _ |
327 | (zero? (system* "autoreconf" "-vfi"))))))) | |
328 | (home-page "http://repo.or.cz/w/libjaylink.git") | |
329 | (synopsis "Library to interface Segger J-Link devices") | |
330 | (description "libjaylink is a shared library written in C to access | |
331 | SEGGER J-Link and compatible devices.") | |
332 | (license license:gpl2+)))) | |
91ba6935 DC |
333 | |
334 | (define-public jimtcl | |
335 | (package | |
336 | (name "jimtcl") | |
337 | (version "0.77") | |
338 | (source (origin | |
339 | (method url-fetch) | |
340 | (uri (string-append | |
341 | "https://github.com/msteveb/jimtcl" | |
342 | "/archive/" version ".tar.gz")) | |
343 | (file-name (string-append name "-" version ".tar.gz")) | |
344 | (sha256 | |
345 | (base32 | |
346 | "1cmk3qscqckg70chjyimzxa2qcka4qac0j4wq908kiijp45cax08")))) | |
347 | (build-system gnu-build-system) | |
348 | (arguments | |
349 | `(#:phases | |
350 | (modify-phases %standard-phases | |
351 | ;; Doesn't use autoconf. | |
352 | (replace 'configure | |
353 | (lambda* (#:key outputs #:allow-other-keys) | |
354 | (let ((out (assoc-ref outputs "out"))) | |
355 | (zero? (system* "./configure" | |
356 | (string-append "--prefix=" out))))))))) | |
357 | (home-page "http://jim.tcl.tk") | |
358 | (synopsis "Small footprint Tcl implementation") | |
359 | (description "Jim is a small footprint implementation of the Tcl programming | |
360 | language.") | |
361 | (license license:bsd-2))) | |
5b83b7b8 TF |
362 | |
363 | (define-public openocd | |
ea1aa452 TF |
364 | (package |
365 | (name "openocd") | |
366 | (version "0.10.0") | |
367 | (source (origin | |
368 | (method url-fetch) | |
369 | (uri (string-append "mirror://sourceforge/openocd/openocd/" | |
370 | version "/openocd-" version ".tar.gz")) | |
371 | (sha256 | |
372 | (base32 | |
373 | "09p57y3c2spqx4vjjlz1ljm1lcd0j9q8g76ywxqgn3yc34wv18zd")) | |
374 | ;; FIXME: Remove after nrf52 patch is merged. | |
375 | (patches | |
376 | (search-patches "openocd-nrf52.patch")))) | |
377 | (build-system gnu-build-system) | |
378 | (native-inputs | |
379 | `(("autoconf" ,autoconf) | |
380 | ("automake" ,automake) | |
381 | ("libtool" ,libtool) | |
382 | ("pkg-config" ,pkg-config))) | |
383 | (inputs | |
384 | `(("hidapi" ,hidapi) | |
385 | ("jimtcl" ,jimtcl) | |
386 | ("libftdi" ,libftdi) | |
387 | ("libjaylink" ,libjaylink) | |
388 | ("libusb-compat" ,libusb-compat))) | |
389 | (arguments | |
390 | '(#:configure-flags | |
391 | (append (list "--disable-werror" | |
392 | "--enable-sysfsgpio" | |
393 | "--disable-internal-jimtcl" | |
394 | "--disable-internal-libjaylink") | |
395 | (map (lambda (programmer) | |
396 | (string-append "--enable-" programmer)) | |
397 | '("amtjtagaccel" "armjtagew" "buspirate" "ftdi" | |
398 | "gw16012" "jlink" "opendous" "osbdm" | |
399 | "parport" "aice" "cmsis-dap" "dummy" "jtag_vpi" | |
400 | "remote-bitbang" "rlink" "stlink" "ti-icdi" "ulink" | |
401 | "usbprog" "vsllink" "usb-blaster-2" "usb_blaster" | |
402 | "presto" "openjtag"))) | |
403 | #:phases | |
404 | (modify-phases %standard-phases | |
405 | (add-before 'configure 'autoreconf | |
406 | (lambda _ | |
407 | (zero? (system* "autoreconf" "-vfi")))) | |
408 | (add-after 'autoreconf 'change-udev-group | |
409 | (lambda _ | |
410 | (substitute* "contrib/60-openocd.rules" | |
411 | (("plugdev") "dialout")) | |
412 | #t)) | |
413 | (add-after 'install 'install-udev-rules | |
414 | (lambda* (#:key outputs #:allow-other-keys) | |
415 | (install-file "contrib/60-openocd.rules" | |
416 | (string-append | |
417 | (assoc-ref outputs "out") | |
418 | "/lib/udev/rules.d/"))))))) | |
419 | (home-page "http://openocd.org") | |
420 | (synopsis "On-Chip Debugger") | |
421 | (description "OpenOCD provides on-chip programming and debugging support | |
5b83b7b8 | 422 | with a layered architecture of JTAG interface and TAP support.") |
ea1aa452 | 423 | (license license:gpl2+))) |
2d7c9213 | 424 | |
791cfa67 RW |
425 | ;; The commits for all propeller tools are the stable versions published at |
426 | ;; https://github.com/propellerinc/propgcc in the release_1_0. According to | |
427 | ;; personal correspondence with the developers in July 2017, more recent | |
428 | ;; versions are currently incompatible with the "Simple Libraries". | |
2d7c9213 RW |
429 | |
430 | (define propeller-binutils | |
431 | (let ((xbinutils (cross-binutils "propeller-elf")) | |
791cfa67 RW |
432 | (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3") |
433 | (revision "2")) | |
2d7c9213 RW |
434 | (package |
435 | (inherit xbinutils) | |
436 | (name "propeller-binutils") | |
437 | (version (string-append "0.0.0-" revision "." (string-take commit 9))) | |
438 | (source (origin (inherit (package-source xbinutils)) | |
439 | (method git-fetch) | |
440 | (uri (git-reference | |
791cfa67 | 441 | (url "https://github.com/parallaxinc/propgcc.git") |
2d7c9213 RW |
442 | (commit commit))) |
443 | (file-name (string-append name "-" commit "-checkout")) | |
444 | (sha256 | |
445 | (base32 | |
791cfa67 RW |
446 | "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck")) |
447 | (patch-flags (list "-p1" "--directory=binutils")))) | |
2d7c9213 | 448 | (arguments |
791cfa67 | 449 | `(;; FIXME: For some reason there are many test failures. It's not |
2d7c9213 RW |
450 | ;; obvious how to fix the failures. |
451 | #:tests? #f | |
452 | #:phases | |
453 | (modify-phases %standard-phases | |
791cfa67 RW |
454 | (add-after 'unpack 'chdir |
455 | (lambda _ (chdir "binutils") #t))) | |
456 | ,@(substitute-keyword-arguments (package-arguments xbinutils) | |
457 | ((#:configure-flags flags) | |
458 | `(cons "--disable-werror" ,flags))))) | |
2d7c9213 RW |
459 | (native-inputs |
460 | `(("bison" ,bison) | |
5e54f4ad | 461 | ("flex" ,flex) |
2d7c9213 RW |
462 | ("texinfo" ,texinfo) |
463 | ("dejagnu" ,dejagnu) | |
464 | ,@(package-native-inputs xbinutils)))))) | |
465 | ||
bb19b2eb | 466 | (define-public propeller-gcc-6 |
68cb2784 | 467 | (let ((xgcc (cross-gcc "propeller-elf" |
7b3318e3 | 468 | #:xbinutils propeller-binutils)) |
68cb2784 RW |
469 | (commit "b4f45a4725e0b6d0af59e594c4e3e35ca4105867") |
470 | (revision "1")) | |
471 | (package (inherit xgcc) | |
472 | (name "propeller-gcc") | |
473 | (version (string-append "6.0.0-" revision "." (string-take commit 9))) | |
474 | (source (origin | |
475 | (method git-fetch) | |
476 | (uri (git-reference | |
477 | (url "https://github.com/totalspectrum/gcc-propeller.git") | |
478 | (commit commit))) | |
479 | (file-name (string-append name "-" commit "-checkout")) | |
480 | (sha256 | |
481 | (base32 | |
482 | "0d9kdxm2fzanjqa7q5850kzbsfl0fqyaahxn74h6nkxxacwa11zb")) | |
483 | (patches | |
484 | (append | |
485 | (origin-patches (package-source gcc-6)) | |
486 | (search-patches "gcc-cross-environment-variables.patch"))))) | |
487 | (native-inputs | |
488 | `(("flex" ,flex) | |
489 | ,@(package-native-inputs xgcc))) | |
490 | ;; All headers and cross libraries of the propeller toolchain are | |
491 | ;; installed under the "propeller-elf" prefix. | |
492 | (native-search-paths | |
493 | (list (search-path-specification | |
494 | (variable "CROSS_C_INCLUDE_PATH") | |
495 | (files '("propeller-elf/include"))) | |
496 | (search-path-specification | |
497 | (variable "CROSS_LIBRARY_PATH") | |
498 | (files '("propeller-elf/lib"))))) | |
499 | (home-page "https://github.com/totalspectrum/gcc-propeller") | |
500 | (synopsis "GCC for the Parallax Propeller")))) | |
501 | ||
db90eb8c | 502 | (define-public propeller-gcc-4 |
bb19b2eb | 503 | (let ((xgcc propeller-gcc-6) |
791cfa67 RW |
504 | (commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3") |
505 | (revision "2")) | |
db90eb8c RW |
506 | (package (inherit xgcc) |
507 | (name "propeller-gcc") | |
508 | (version (string-append "4.6.1-" revision "." (string-take commit 9))) | |
509 | (source (origin | |
510 | (method git-fetch) | |
511 | (uri (git-reference | |
791cfa67 | 512 | (url "https://github.com/parallaxinc/propgcc.git") |
db90eb8c RW |
513 | (commit commit))) |
514 | (file-name (string-append name "-" commit "-checkout")) | |
515 | (sha256 | |
516 | (base32 | |
791cfa67 RW |
517 | "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck")) |
518 | (patch-flags (list "-p1" "--directory=gcc")) | |
db90eb8c RW |
519 | (patches |
520 | (append | |
521 | (origin-patches (package-source gcc-4.7)) | |
1d3be5d9 RW |
522 | (search-patches "gcc-4.6-gnu-inline.patch" |
523 | "gcc-cross-environment-variables.patch"))))) | |
791cfa67 RW |
524 | (arguments |
525 | (substitute-keyword-arguments (package-arguments propeller-gcc-6) | |
526 | ((#:phases phases) | |
527 | `(modify-phases ,phases | |
528 | (add-after 'unpack 'chdir | |
529 | (lambda _ (chdir "gcc") #t)))))) | |
8226304b RW |
530 | (native-inputs |
531 | `(("gcc-4" ,gcc-4.9) | |
532 | ,@(package-native-inputs propeller-gcc-6))) | |
791cfa67 | 533 | (home-page "https://github.com/parallaxinc/propgcc") |
57e96e48 | 534 | (supported-systems (delete "aarch64-linux" %supported-systems))))) |
db90eb8c | 535 | |
bb19b2eb RW |
536 | ;; Version 6 is experimental and may not work correctly. This is why we |
537 | ;; default to version 4, which is also used in the binary toolchain bundle | |
538 | ;; provided by Parallax Inc. | |
539 | (define-public propeller-gcc propeller-gcc-4) | |
540 | ||
791cfa67 RW |
541 | |
542 | ;; FIXME: We do not build the tiny library because that would require C++ | |
543 | ;; headers, which are not available. This may require adding a propeller-elf | |
544 | ;; variant of the libstdc++ package. | |
0d0079b2 | 545 | (define-public proplib |
791cfa67 RW |
546 | (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3") |
547 | (revision "2")) | |
0d0079b2 RW |
548 | (package |
549 | (name "proplib") | |
550 | (version (string-append "0.0.0-" revision "." (string-take commit 9))) | |
551 | (source (origin | |
552 | (method git-fetch) | |
553 | (uri (git-reference | |
791cfa67 | 554 | (url "https://github.com/parallaxinc/propgcc.git") |
0d0079b2 RW |
555 | (commit commit))) |
556 | (file-name (string-append name "-" commit "-checkout")) | |
557 | (sha256 | |
558 | (base32 | |
791cfa67 | 559 | "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck")))) |
0d0079b2 RW |
560 | (build-system gnu-build-system) |
561 | (arguments | |
562 | `(#:tests? #f ; no tests | |
563 | #:make-flags | |
564 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
565 | (string-append "BUILD=" (getcwd) "/build")) | |
566 | #:phases | |
567 | (modify-phases %standard-phases | |
568 | (delete 'configure) | |
791cfa67 RW |
569 | (add-after 'unpack 'chdir |
570 | (lambda _ (chdir "lib") #t)) | |
571 | (add-after 'chdir 'fix-Makefile | |
0d0079b2 RW |
572 | (lambda _ |
573 | (substitute* "Makefile" | |
0d0079b2 RW |
574 | ;; Control the installation time of the headers. |
575 | ((" install-includes") "")) | |
576 | #t)) | |
577 | ;; The Makefile does not separate building from installation, so we | |
578 | ;; have to create the target directories at build time. | |
579 | (add-before 'build 'create-target-directories | |
580 | (lambda* (#:key make-flags #:allow-other-keys) | |
581 | (zero? (apply system* "make" "install-dirs" make-flags)))) | |
582 | (add-before 'build 'set-cross-environment-variables | |
583 | (lambda* (#:key outputs #:allow-other-keys) | |
584 | (setenv "CROSS_LIBRARY_PATH" | |
585 | (string-append (assoc-ref outputs "out") | |
586 | "/propeller-elf/lib:" | |
587 | (or (getenv "CROSS_LIBRARY_PATH") ""))) | |
588 | (setenv "CROSS_C_INCLUDE_PATH" | |
589 | (string-append (assoc-ref outputs "out") | |
590 | "/propeller-elf/include:" | |
591 | (or (getenv "CROSS_C_INCLUDE_PATH") ""))) | |
592 | #t)) | |
791cfa67 | 593 | (add-before 'install 'install-includes |
0d0079b2 | 594 | (lambda* (#:key make-flags #:allow-other-keys) |
791cfa67 | 595 | (zero? (apply system* "make" "install-includes" make-flags))))))) |
0d0079b2 RW |
596 | (native-inputs |
597 | `(("propeller-gcc" ,propeller-gcc) | |
598 | ("propeller-binutils" ,propeller-binutils) | |
599 | ("perl" ,perl))) | |
791cfa67 | 600 | (home-page "https://github.com/parallaxinc/propgcc") |
0d0079b2 RW |
601 | (synopsis "C library for the Parallax Propeller") |
602 | (description "This is a C library for the Parallax Propeller | |
603 | micro-controller.") | |
604 | ;; Most of the code is released under the Expat license. Some of the | |
605 | ;; included code is public domain and some changes are BSD licensed. | |
606 | (license license:expat)))) | |
607 | ||
eb88fbaf RW |
608 | (define-public propeller-toolchain |
609 | (package | |
610 | (name "propeller-toolchain") | |
611 | (version (package-version propeller-gcc)) | |
612 | (source #f) | |
613 | (build-system trivial-build-system) | |
e3cfef22 | 614 | (arguments '(#:builder (begin (mkdir %output) #t))) |
eb88fbaf RW |
615 | (propagated-inputs |
616 | `(("binutils" ,propeller-binutils) | |
617 | ("libc" ,proplib) | |
618 | ("gcc" ,propeller-gcc))) | |
619 | (synopsis "Complete GCC tool chain for Propeller micro-controllers") | |
620 | (description "This package provides a complete GCC tool chain for | |
621 | Propeller micro-controller development.") | |
622 | (home-page (package-home-page propeller-gcc)) | |
623 | (license (package-license propeller-gcc)))) | |
624 | ||
150e0a1e RW |
625 | (define-public openspin |
626 | (package | |
627 | (name "openspin") | |
628 | (version "1.00.78") | |
629 | (source (origin | |
630 | (method url-fetch) | |
631 | (uri (string-append "https://github.com/parallaxinc/" | |
632 | "OpenSpin/archive/" version ".tar.gz")) | |
633 | (file-name (string-append name "-" version ".tar.gz")) | |
634 | (sha256 | |
635 | (base32 | |
636 | "1k2dbz1v604g4r2d9qhckg2m8dnhiya760mbsqfsg4waxal87yb7")))) | |
637 | (build-system gnu-build-system) | |
638 | (arguments | |
639 | `(#:tests? #f ; no tests | |
640 | #:phases | |
641 | (modify-phases %standard-phases | |
642 | (delete 'configure) | |
643 | (add-after 'unpack 'remove-timestamp | |
644 | (lambda _ | |
645 | (substitute* "SpinSource/openspin.cpp" | |
646 | ((" Compiled on.*$") "\\n\");")) | |
647 | #t)) | |
648 | ;; Makefile does not include "install" target | |
649 | (replace 'install | |
650 | (lambda* (#:key outputs #:allow-other-keys) | |
651 | (let ((bin (string-append (assoc-ref outputs "out") | |
652 | "/bin"))) | |
653 | (mkdir-p bin) | |
654 | (install-file "build/openspin" bin) | |
655 | #t)))))) | |
656 | (home-page "https://github.com/parallaxinc/OpenSpin") | |
657 | (synopsis "Spin/PASM compiler for the Parallax Propeller") | |
658 | (description "OpenSpin is a compiler for the Spin/PASM language of the | |
659 | Parallax Propeller. It was ported from Chip Gracey's original x86 assembler | |
660 | code.") | |
661 | (license license:expat))) | |
662 | ||
c6b96af7 | 663 | (define-public propeller-load |
791cfa67 RW |
664 | (let ((commit "4c46ecbe79ffbecd2ce918497ace5b956736b5a3") |
665 | (revision "2")) | |
c6b96af7 RW |
666 | (package |
667 | (name "propeller-load") | |
668 | (version "3.4.0") | |
669 | (source (origin | |
670 | (method git-fetch) | |
671 | (uri (git-reference | |
791cfa67 | 672 | (url "https://github.com/parallaxinc/propgcc.git") |
c6b96af7 RW |
673 | (commit commit))) |
674 | (file-name (string-append name "-" commit "-checkout")) | |
675 | (sha256 | |
676 | (base32 | |
791cfa67 | 677 | "0w0dff3s7wv2d9m78a4jhckiik58q38wx6wpbba5hzbs4yxz35ck")))) |
c6b96af7 RW |
678 | (build-system gnu-build-system) |
679 | (arguments | |
680 | `(#:tests? #f ; no tests | |
681 | #:make-flags | |
682 | (list "OS=linux" | |
683 | (string-append "TARGET=" (assoc-ref %outputs "out"))) | |
684 | #:phases | |
685 | (modify-phases %standard-phases | |
791cfa67 RW |
686 | (add-after 'unpack 'chdir |
687 | (lambda _ (chdir "loader") #t)) | |
c6b96af7 RW |
688 | (delete 'configure)))) |
689 | (native-inputs | |
690 | `(("openspin" ,openspin) | |
691 | ("propeller-toolchain" ,propeller-toolchain))) | |
791cfa67 | 692 | (home-page "https://github.com/parallaxinc/propgcc") |
c6b96af7 RW |
693 | (synopsis "Loader for Parallax Propeller micro-controllers") |
694 | (description "This package provides the tool @code{propeller-load} to | |
695 | upload binaries to a Parallax Propeller micro-controller.") | |
696 | (license license:expat)))) | |
697 | ||
0a7860c4 RW |
698 | (define-public spin2cpp |
699 | (package | |
700 | (name "spin2cpp") | |
4886d5b2 | 701 | (version "3.6.4") |
0a7860c4 RW |
702 | (source (origin |
703 | (method url-fetch) | |
704 | (uri (string-append "https://github.com/totalspectrum/spin2cpp/" | |
705 | "archive/v" version ".tar.gz")) | |
706 | (file-name (string-append name "-" version ".tar.gz")) | |
707 | (sha256 | |
708 | (base32 | |
4886d5b2 | 709 | "05qak187sn0xg7vhrxw27b19xhmid1b8ab8kax3gv0faavzablfw")))) |
0a7860c4 RW |
710 | (build-system gnu-build-system) |
711 | (arguments | |
712 | `(#:tests? #f ;; The tests assume that a micro-controller is connected. | |
713 | #:phases | |
714 | (modify-phases %standard-phases | |
715 | (delete 'configure) | |
716 | (add-before 'build 'set-cross-environment-variables | |
717 | (lambda* (#:key inputs #:allow-other-keys) | |
718 | (setenv "CROSS_LIBRARY_PATH" | |
719 | (string-append (assoc-ref inputs "propeller-toolchain") | |
720 | "/propeller-elf/lib")) | |
721 | (setenv "CROSS_C_INCLUDE_PATH" | |
722 | (string-append (assoc-ref inputs "propeller-toolchain") | |
723 | "/propeller-elf/include")) | |
724 | #t)) | |
725 | (replace 'install | |
726 | (lambda* (#:key outputs #:allow-other-keys) | |
727 | (let ((bin (string-append (assoc-ref outputs "out") | |
728 | "/bin"))) | |
729 | (for-each (lambda (file) | |
730 | (install-file (string-append "build/" file) | |
731 | bin)) | |
732 | '("testlex" "spin2cpp" "fastspin"))) | |
733 | #t))))) | |
734 | (native-inputs | |
735 | `(("bison" ,bison) | |
736 | ("propeller-load" ,propeller-load) | |
737 | ("propeller-toolchain" ,propeller-toolchain))) | |
738 | (home-page "https://github.com/totalspectrum/spin2cpp") | |
739 | (synopsis "Convert Spin code to C, C++, or PASM code") | |
740 | (description "This is a set of tools for converting the Spin language for | |
741 | the Parallax Propeller micro-controller into C or C++ code, into PASM, or even | |
742 | directly into an executable binary. The binaries produced use LMM PASM, so | |
743 | they are much faster than regular Spin bytecodes (but also quite a bit | |
744 | larger).") | |
745 | (license license:expat))) | |
746 | ||
3ebc86d9 RW |
747 | (define-public spinsim |
748 | (let ((commit "66915a7ad1a3a2cf990a725bb341fab8d11eb620") | |
749 | (revision "1")) | |
750 | (package | |
751 | (name "spinsim") | |
752 | (version (string-append "0.75-" revision "." (string-take commit 9))) | |
753 | (source (origin | |
754 | (method git-fetch) | |
755 | (uri (git-reference | |
756 | (url "https://github.com/parallaxinc/spinsim.git") | |
757 | (commit commit))) | |
758 | (file-name (string-append name "-" commit "-checkout")) | |
759 | (sha256 | |
760 | (base32 | |
761 | "1n9kdhlxsdx7bz6c80w8dhi96zp633gd6qs0x9i4ii8qv4i7sj5k")))) | |
762 | (build-system gnu-build-system) | |
763 | (arguments | |
764 | `(#:tests? #f ; no tests | |
765 | #:phases | |
766 | (modify-phases %standard-phases | |
767 | (delete 'configure) | |
768 | (replace 'install | |
769 | (lambda* (#:key outputs #:allow-other-keys) | |
770 | (let ((bin (string-append (assoc-ref outputs "out") | |
771 | "/bin"))) | |
772 | (install-file "build/spinsim" bin)) | |
773 | #t))))) | |
774 | (home-page "https://github.com/parallaxinc/spinsim") | |
775 | (synopsis "Spin simulator") | |
776 | (description "This package provides the tool @code{spinsim}, a simulator | |
777 | and simple debugger for Spin programs written for a Parallax Propeller | |
778 | micro-controller. Spinsim supports execution from cog memory and hub | |
779 | execution, but it does not support multi-tasking. It supports about | |
780 | two-thirds of the opcodes in the P2 instruction set.") | |
781 | (license license:expat)))) | |
782 | ||
395bbfdb RW |
783 | (define-public propeller-development-suite |
784 | (package | |
785 | (name "propeller-development-suite") | |
786 | (version (package-version propeller-gcc)) | |
787 | (source #f) | |
788 | (build-system trivial-build-system) | |
e3cfef22 | 789 | (arguments '(#:builder (begin (mkdir %output) #t))) |
395bbfdb RW |
790 | (propagated-inputs |
791 | `(("toolchain" ,propeller-toolchain) | |
792 | ("openspin" ,openspin) | |
793 | ("propeller-load" ,propeller-load) | |
794 | ("spin2cpp" ,spin2cpp) | |
795 | ("spinsim" ,spinsim))) | |
796 | (synopsis "Complete development suite for Propeller micro-controllers") | |
797 | (description "This meta-package provides a complete environment for the | |
798 | development with Parallax Propeller micro-controllers. It includes the GCC | |
799 | toolchain, the loader, the Openspin compiler, the Spin2cpp tool, and the Spin | |
800 | simulator.") | |
801 | (home-page (package-home-page propeller-gcc)) | |
802 | (license (package-license propeller-gcc)))) | |
8ea42482 DM |
803 | |
804 | (define-public binutils-vc4 | |
805 | (let ((commit "708acc851880dbeda1dd18aca4fd0a95b2573b36")) | |
806 | (package | |
807 | (name "binutils-vc4") | |
808 | (version (string-append "2.23.51-0." (string-take commit 7))) | |
809 | (source (origin | |
810 | (method git-fetch) | |
811 | (uri (git-reference | |
812 | (url "https://github.com/puppeh/binutils-vc4.git") | |
813 | (commit commit))) | |
493ae57e | 814 | (file-name (string-append name "-" version "-checkout")) |
8ea42482 DM |
815 | (sha256 |
816 | (base32 | |
817 | "1kdrz6fki55lm15rwwamn74fnqpy0zlafsida2zymk76n3656c63")))) | |
818 | (build-system gnu-build-system) | |
819 | (arguments | |
820 | `(#:configure-flags '("--target=vc4-elf" | |
821 | "--disable-werror" | |
822 | "--enable-cgen-maint") | |
823 | #:phases | |
824 | (modify-phases %standard-phases | |
825 | (add-after 'unpack 'unpack-cgen | |
826 | (lambda* (#:key inputs #:allow-other-keys) | |
827 | (copy-recursively (string-append (assoc-ref inputs "cgen") | |
828 | "/cgen") "cgen") | |
829 | #t)) | |
830 | (add-after 'unpack-cgen 'fix-cgen-guile | |
831 | (lambda _ | |
832 | (substitute* "opcodes/Makefile.in" | |
833 | (("guile\\{,-\\}1.8") "guile")) | |
25e25d8f | 834 | (invoke "which" "guile")))))) |
8ea42482 DM |
835 | (native-inputs |
836 | `(("cgen" | |
837 | ,(origin | |
838 | (method git-fetch) | |
839 | (uri (git-reference | |
840 | (url "https://github.com/puppeh/cgen.git") | |
841 | (commit "d8e2a9eb70425f180fdd5bfd032884b0855f2032"))) | |
842 | (sha256 | |
843 | (base32 | |
844 | "14b3h2ji740s8zq5vwm4qdcxs4aa4wxi6wb9di3bv1h39x14nyr9")))) | |
845 | ("texinfo" ,texinfo) | |
5e54f4ad | 846 | ("flex" ,flex) |
8ea42482 DM |
847 | ("bison" ,bison) |
848 | ("guile-1.8" ,guile-1.8) | |
849 | ("which" ,base:which))) | |
850 | (synopsis "Binutils for VC4") | |
851 | (description "This package provides @code{binutils} for VideoCore IV, | |
852 | the Raspberry Pi chip.") | |
853 | (license license:gpl3+) | |
854 | (home-page "https://github.com/puppeh/vc4-toolchain/")))) | |
7cf06d62 DM |
855 | |
856 | (define-public gcc-vc4 | |
857 | (let ((commit "165f6d0e11d2e76ee799533bb45bd5c92bf60dc2") | |
7b3318e3 | 858 | (xgcc (cross-gcc "vc4-elf" #:xbinutils binutils-vc4))) |
7cf06d62 DM |
859 | (package (inherit xgcc) |
860 | (name "gcc-vc4") | |
861 | (source (origin | |
862 | (method git-fetch) | |
863 | (uri (git-reference | |
864 | (url "https://github.com/puppeh/gcc-vc4.git") | |
865 | (commit commit))) | |
866 | (file-name (string-append name | |
867 | "-" | |
868 | (package-version xgcc) | |
869 | "-checkout")) | |
870 | (sha256 | |
871 | (base32 | |
872 | "13h30qjcwnlz6lfma1d82nnvfmjnhh7abkagip4vly6vm5fpnvf2")))) | |
873 | (native-inputs | |
874 | `(("flex" ,flex) | |
875 | ,@(package-native-inputs xgcc))) | |
876 | (synopsis "GCC for VC4") | |
877 | (description "This package provides @code{gcc} for VideoCore IV, | |
878 | the Raspberry Pi chip.")))) | |
1a6497de DM |
879 | |
880 | (define-public python2-libmpsse | |
881 | (package | |
882 | (name "python2-libmpsse") | |
883 | (version "1.3") | |
884 | (source | |
885 | (origin | |
886 | (method url-fetch) | |
887 | (uri (string-append "https://storage.googleapis.com/" | |
888 | "google-code-archive-downloads/v2/" | |
889 | "code.google.com/libmpsse/" | |
890 | "libmpsse-" version ".tar.gz")) | |
891 | (sha256 | |
892 | (base32 | |
893 | "0jq7nhqq3na8675jnpfcar3pd3dp3adhhc4lw900swkla01a1wh8")))) | |
894 | (build-system gnu-build-system) | |
895 | (inputs | |
896 | `(("libftdi" ,libftdi) | |
897 | ("python" ,python-2))) | |
898 | (native-inputs | |
899 | `(("pkg-config" ,pkg-config) | |
900 | ("swig" ,swig) | |
901 | ("which" ,base:which))) | |
902 | (arguments | |
903 | `(#:tests? #f ; No tests exist. | |
904 | #:make-flags | |
905 | (list (string-append "CFLAGS=-Wall -fPIC -fno-strict-aliasing -g -O2 " | |
906 | "$(shell pkg-config --cflags libftdi1)")) | |
907 | #:phases | |
908 | (modify-phases %standard-phases | |
909 | (add-after 'unpack 'set-environment-up | |
910 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
911 | (chdir "src") | |
912 | (setenv "PYDEV" (string-append (assoc-ref inputs "python") | |
913 | "/include/python2.7")) | |
914 | #t)) | |
915 | (add-after 'unpack 'patch-global-variable | |
916 | (lambda _ | |
917 | ;; fast_rw_buf was defined in a header file which was making | |
918 | ;; the build not reproducible. | |
919 | (substitute* "src/fast.c" | |
920 | (("^int fast_build_block_buffer") " | |
921 | ||
922 | unsigned char fast_rw_buf[SPI_RW_SIZE + CMD_SIZE]; | |
923 | int fast_build_block_buffer")) | |
924 | (substitute* "src/mpsse.h" | |
925 | (("unsigned char fast_rw_buf.*") " | |
926 | ")) | |
927 | #t)) | |
928 | (replace 'install | |
929 | (lambda* (#:key outputs make-flags #:allow-other-keys #:rest args) | |
930 | (let* ((out (assoc-ref outputs "out")) | |
931 | (out-python (string-append out | |
932 | "/lib/python2.7/site-packages")) | |
933 | (install (assoc-ref %standard-phases 'install))) | |
934 | (install #:make-flags (cons (string-append "PYLIB=" out-python) | |
935 | make-flags)))))))) | |
936 | (home-page "https://code.google.com/archive/p/libmpsse/") | |
937 | (synopsis "Python library for MPSSE SPI I2C JTAG adapter by FTDI") | |
938 | (description "This package provides a library in order to support the | |
939 | MPSSE (Multi-Protocol Synchronous Serial Engine) adapter by FTDI that can do | |
940 | SPI, I2C, JTAG.") | |
941 | (license license:gpl2+))) | |
981bccf1 DM |
942 | |
943 | (define-public picprog | |
944 | (package | |
945 | (name "picprog") | |
946 | (version "1.9.1") | |
947 | (source (origin | |
948 | (method url-fetch) | |
949 | (uri (string-append "http://www.iki.fi/hyvatti/pic/picprog-" | |
950 | version ".tar.gz")) | |
951 | (file-name (string-append name "-" version ".tar.gz")) | |
952 | (sha256 | |
953 | (base32 | |
316fd29f EF |
954 | "1r04hg1n3v2jf915qr05la3q9cxy7a5jnh9cc98j04lh6c9p4x85")) |
955 | (patches (search-patches "picprog-non-intel-support.patch")))) | |
981bccf1 DM |
956 | (build-system gnu-build-system) |
957 | (arguments | |
958 | `(#:tests? #f ; No tests exist. | |
959 | #:phases | |
960 | (modify-phases %standard-phases | |
961 | (add-after 'unpack 'patch-paths | |
962 | (lambda* (#:key outputs #:allow-other-keys) | |
963 | (substitute* "Makefile" | |
964 | (("/usr/local") (assoc-ref outputs "out")) | |
316fd29f EF |
965 | ((" -o 0 -g 0 ") " ") |
966 | (("testport") "")) | |
981bccf1 DM |
967 | #t)) |
968 | (add-before 'install 'mkdir | |
969 | (lambda* (#:key outputs #:allow-other-keys) | |
970 | (let ((out (assoc-ref outputs "out"))) | |
971 | (mkdir-p (string-append out "/bin")) | |
972 | (mkdir-p (string-append out "/man/man1")) | |
973 | #t))) | |
974 | (delete 'configure)))) | |
975 | (synopsis "Programs Microchip's PIC microcontrollers") | |
976 | (description "This program programs Microchip's PIC microcontrollers.") | |
977 | (home-page "http://hyvatti.iki.fi/~jaakko/pic/picprog.html") | |
978 | (license license:gpl3+))) | |
cc8d346b DM |
979 | |
980 | (define-public fc-host-tools | |
981 | (package | |
982 | (name "fc-host-tools") | |
c35d9830 | 983 | (version "8") |
cc8d346b DM |
984 | (source (origin |
985 | (method url-fetch) | |
986 | (uri (string-append "ftp://ftp.freecalypso.org/pub/GSM/" | |
987 | "FreeCalypso/fc-host-tools-r" version ".tar.bz2")) | |
988 | (sha256 | |
989 | (base32 | |
c35d9830 | 990 | "00kl9442maaxnsjvl5qc4c6fzjkgr3hac9ax1z2k6ry6byfknj6z")))) |
cc8d346b DM |
991 | (build-system gnu-build-system) |
992 | (arguments | |
993 | `(#:tests? #f ; No tests exist. | |
994 | #:make-flags | |
995 | (list (string-append "INSTBIN=" %output "/bin") | |
996 | (string-append "INCLUDE_INSTALL_DIR=" %output "include/rvinterf")) | |
997 | #:phases | |
998 | (modify-phases %standard-phases | |
999 | (delete 'configure) | |
1000 | (add-after 'unpack 'handle-tarbomb | |
1001 | (lambda _ | |
1002 | (chdir "..") ; url-fetch/tarbomb doesn't work for some reason. | |
1003 | #t)) | |
1004 | (add-after 'handle-tarbomb 'patch-installation-paths | |
1005 | (lambda* (#:key outputs #:allow-other-keys) | |
1006 | (substitute* '("Makefile" | |
1007 | "rvinterf/libasync/launchrvif.c" | |
1008 | "loadtools/defpath.c" | |
1009 | "loadtools/Makefile" | |
1010 | "miscutil/c139explore" | |
1dec2691 DM |
1011 | "miscutil/pirexplore" |
1012 | "ffstools/tiffs-wrappers/installpath.c" | |
1013 | "rvinterf/rvtat/launchrvif.c" | |
1014 | "rvinterf/etmsync/launchrvif.c" | |
1015 | "rvinterf/libasync/launchrvif.c" | |
1016 | "uptools/atcmd/atinterf.c") | |
cc8d346b DM |
1017 | (("/opt/freecalypso/loadtools") |
1018 | (string-append (assoc-ref outputs "out") "/lib/freecalypso/loadtools")) | |
1019 | (("/opt/freecalypso") | |
1020 | (assoc-ref outputs "out"))) | |
1021 | #t))))) | |
1022 | (inputs | |
1023 | `(("libx11" ,libx11))) | |
1024 | (synopsis "Freecalypso host tools") | |
1025 | (description "This package provides some tools for debugging Freecalypso phones. | |
1026 | ||
1027 | @enumerate | |
1028 | @item fc-e1decode: Decodes a binary Melody E1 file into an ASCII source file. | |
1029 | @item fc-e1gen: Encodes an ASCII Melody E1 file into a binary Melody E1 file. | |
1030 | @item fc-fr2tch: Converts a GSM 06.10 speech recording from libgsm to hex | |
1031 | strings of TCH bits to be fed to the GSM 05.03 channel encoder of a TI | |
1032 | Calypso GSM device. | |
1033 | @item fc-tch2fr: Converts hex strings of TCH bits to libgsm. | |
1034 | @item fc-gsm2vm: utility converts a GSM 06.10 speech sample from the libgsm | |
1035 | source format into a voice memo file that can be uploaded into the FFS of a | |
1036 | FreeCalypso device and played with the audio_vm_play_start() API or the | |
1037 | AT@@VMP command that invokes the latter. | |
1038 | @item fc-rgbconv: Convers RGB 5:6:5 to RGB 8:8:8 and vice versa. | |
1039 | @item rvinterf: Communicates with a TI Calypso GSM device via RVTMUX. | |
1040 | @item rvtdump: produces a human-readable dump of all output emitted by a | |
1041 | TI-based GSM fw on the RVTMUX binary packet interface. | |
1042 | @item fc-shell: FreeCalypso firmwares have a feature of our own invention | |
1043 | (not present in any pre-existing ones) to accept AT commands over the RVTMUX | |
1044 | interface. It is useful when no second UART is available for a dedicated | |
1045 | standard AT command interface. fc-shell is the tool that allows you to send | |
1046 | AT commands to the firmware in this manner. | |
1047 | @item fc-memdump: Captures a memory dump from a GSM device. | |
1048 | @item fc-serterm: Trivial serial terminal. Escapes binary chars. | |
1049 | @item fc-fsio: Going through rvinterf, this tool connects to GSM devices and | |
1050 | allows you to manipulate the device's flash file system. | |
1051 | @item tiaud-compile: Compiles an audio mode configuration table for TI's | |
1052 | Audio Service from our own ASCII source format into the binary format for | |
1053 | uploading into FreeCalypso GSM device FFS with fc-fsio. | |
1054 | @item tiaud-decomp: Decodes TI's audio mode configuration files read out of | |
1055 | FFS into our own ASCII format. | |
1056 | @item tiaud-mkvol: Generates the *.vol binary files which need to accompany | |
1057 | the main *.cfg ones. | |
1058 | @item fc-compalram: Allows running programs on the device without writing | |
1059 | them to flash storage. | |
1060 | @item fc-xram: Allows running programs on the device without writing them | |
1061 | to flash storage. | |
1062 | @item fc-iram: Allows running programs on the device without writing them | |
1063 | to flash storage. | |
1064 | @item fc-loadtool: Writes programs to the device's flash storage. | |
1065 | @item pirffs: Allows listing and extracting FFS content captured as a raw | |
1066 | flash image from Pirelli phones. | |
1067 | @item mokoffs: Allows listing and extracting FFS content captured as a raw | |
1068 | flash image from OpenMoko phones. | |
1069 | @item tiffs: Allows listing and extracting FFS content captured as a raw | |
1070 | flash image from TI phones. | |
1071 | @item c139explore: Run-from-RAM program for C139 phones that | |
1072 | exercises their peripheral hardware: LCD, keypad backlight, buzzer, vibrator. | |
1073 | @item pirexplore: Run-from-RAM program for Pirelli DP-L10 phones that | |
1074 | exercises their peripheral hardware, primarily their LCD. | |
1075 | @item tfc139: Breaks into Mot C1xx phones via shellcode injection, allowing | |
1076 | you to reflash locked phones with new firmware with fc-loadtool. | |
1077 | @item ctracedec: GSM firmwares built in TI's Windows environment have a | |
1078 | compressed trace misfeature whereby many of the ASCII strings | |
1079 | in debug trace messages get replaced with numeric indices at | |
1080 | build time, and these numeric indices are all that gets emitted | |
1081 | on the RVTMUX serial channel. This tools decodes these numeric indices | |
1082 | back to strings in trace output. | |
1083 | @item fc-cal2text: This utility takes a dump of TI's /gsm/rf flash file system | |
1084 | directory subtree as input (either extracted in vitro with tiffs | |
1085 | or read out in vivo with fc-fsio) and converts all RF tables | |
1086 | found therein into a readable ASCII format. | |
1087 | @item imei-luhn: Computes or verifies the Luhn check digit of an IMEI number. | |
1088 | @item fc-dspapidump: Reads and dumps the contents of the DSP API RAM in a | |
1089 | target Calypso GSM device. | |
1090 | @item fc-vm2hex: Converts the old-fashioned (non-AMR) voice memo files read | |
1091 | out of FFS into hex strings. | |
1092 | @item fc-buzplay: Plays piezoelectic buzzer melodies on an actual | |
1093 | Calypso device equipped with such a buzzer (Mot C1xx, TI's D-Sample board, | |
1094 | our planned future HSMBP) by loading a buzplayer agent onto the target and | |
1095 | feeding melodies to be played to it. | |
1096 | @item fc-tmsh: TI-based GSM firmwares provide a rich set of Test Mode commands | |
1097 | that can be issued through the RVTMUX (debug trace) serial channel. | |
1098 | This program is our test mode shell for sending Test Mode commands to targets | |
1099 | and displaying decoded target responses. | |
469cc535 DM |
1100 | @item fcup-smsend Send a short message via SMS |
1101 | @item fcup-smsendmult Send multiple short messages via SMS in one go | |
1102 | @item fcup-smsendpdu Send multiple short messages given in PDU format via SMS | |
1103 | @item sms-pdu-decode Decode PDU format messages | |
cc8d346b DM |
1104 | @end enumerate") |
1105 | (home-page "https://www.freecalypso.org/") | |
1106 | (license license:public-domain))) |