Commit | Line | Data |
---|---|---|
4acd5c0f | 1 | ;;; GNU Guix --- Functional package management for GNU |
eff5f452 | 2 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> |
4acd5c0f | 3 | ;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com> |
af3166c3 HG |
4 | ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com> |
5 | ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org> | |
7526edb9 | 6 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
4acd5c0f MR |
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 | ||
eff5f452 | 23 | (define-module (gnu packages flashing-tools) |
4acd5c0f MR |
24 | #:use-module (guix licenses) |
25 | #:use-module (guix download) | |
7526edb9 | 26 | #:use-module (guix git-download) |
4acd5c0f MR |
27 | #:use-module (guix packages) |
28 | #:use-module (gnu packages) | |
29 | #:use-module (guix build-system gnu) | |
30 | #:use-module (gnu packages bison) | |
31 | #:use-module (gnu packages flex) | |
32 | #:use-module (gnu packages elf) | |
eff5f452 | 33 | #:use-module (gnu packages pkg-config) |
4acd5c0f | 34 | #:use-module (gnu packages libusb) |
eff5f452 MR |
35 | #:use-module (gnu packages libftdi) |
36 | #:use-module (gnu packages pciutils) | |
af3166c3 | 37 | #:use-module (gnu packages autotools) |
eff5f452 MR |
38 | #:use-module (gnu packages admin)) |
39 | ||
40 | (define-public flashrom | |
41 | (package | |
42 | (name "flashrom") | |
03ddad84 | 43 | (version "0.9.9") |
eff5f452 MR |
44 | (source (origin |
45 | (method url-fetch) | |
46 | (uri (string-append | |
03ddad84 | 47 | "https://download.flashrom.org/releases/flashrom-" |
eff5f452 MR |
48 | version ".tar.bz2")) |
49 | (sha256 | |
50 | (base32 | |
03ddad84 | 51 | "0i9wg1lyfg99bld7d00zqjm9f0lk6m0q3h3n9c195c9yysq5ccfb")))) |
eff5f452 MR |
52 | (build-system gnu-build-system) |
53 | (inputs `(("dmidecode" ,dmidecode) | |
54 | ("pciutils" ,pciutils) | |
55 | ("libusb" ,libusb) | |
56 | ("libftdi" ,libftdi))) | |
57 | (native-inputs `(("pkg-config" ,pkg-config))) | |
58 | (arguments | |
03ddad84 DM |
59 | '(#:make-flags (list "CC=gcc" |
60 | (string-append "PREFIX=" %output) | |
61 | "CONFIG_ENABLE_LIBUSB0_PROGRAMMERS=no") | |
eff5f452 MR |
62 | #:tests? #f ; no 'check' target |
63 | #:phases | |
64 | (alist-delete | |
65 | 'configure | |
66 | (alist-cons-before | |
67 | 'build 'patch-exec-paths | |
68 | (lambda* (#:key inputs #:allow-other-keys) | |
69 | (substitute* "dmi.c" | |
70 | (("\"dmidecode\"") | |
71 | (format #f "~S" | |
72 | (string-append (assoc-ref inputs "dmidecode") | |
73 | "/sbin/dmidecode"))))) | |
74 | %standard-phases)))) | |
75 | (home-page "http://flashrom.org/") | |
76 | (synopsis "Identify, read, write, erase, and verify ROM/flash chips") | |
77 | (description | |
78 | "flashrom is a utility for identifying, reading, writing, | |
79 | verifying and erasing flash chips. It is designed to flash | |
80 | BIOS/EFI/coreboot/firmware/optionROM images on mainboards, | |
81 | network/graphics/storage controller cards, and various other | |
82 | programmer devices.") | |
83 | (license gpl2))) | |
4acd5c0f MR |
84 | |
85 | (define-public avrdude | |
86 | (package | |
87 | (name "avrdude") | |
88 | (version "6.1") | |
89 | (source | |
90 | (origin | |
91 | (method url-fetch) | |
92 | (uri (string-append "mirror://savannah/avrdude/avrdude-" | |
93 | version ".tar.gz")) | |
94 | (sha256 | |
95 | (base32 | |
b0069a67 | 96 | "0frxg0q09nrm95z7ymzddx7ysl77ilfbdix1m81d9jjpiv5bm64y")))) |
4acd5c0f MR |
97 | (build-system gnu-build-system) |
98 | (inputs | |
99 | `(("libelf" ,libelf) | |
b0069a67 | 100 | ("libusb" ,libusb-compat) |
4acd5c0f MR |
101 | ("libftdi" ,libftdi))) |
102 | (native-inputs | |
103 | `(("bison" ,bison) | |
104 | ("flex" ,flex))) | |
105 | (home-page "http://www.nongnu.org/avrdude/") | |
106 | (synopsis "AVR downloader and uploader") | |
107 | (description | |
108 | "AVRDUDE is a utility to download/upload/manipulate the ROM and | |
109 | EEPROM contents of AVR microcontrollers using the in-system programming | |
110 | technique (ISP).") | |
111 | (license gpl2+))) | |
2a9a4fb8 MR |
112 | |
113 | (define-public dfu-programmer | |
114 | (package | |
115 | (name "dfu-programmer") | |
702675c5 | 116 | (version "0.7.2") |
2a9a4fb8 MR |
117 | (source |
118 | (origin | |
119 | (method url-fetch) | |
de67e922 LF |
120 | (uri (string-append "mirror://sourceforge/dfu-programmer/dfu-programmer/" |
121 | version "/dfu-programmer-" version ".tar.gz")) | |
2a9a4fb8 MR |
122 | (sha256 |
123 | (base32 | |
702675c5 | 124 | "15gr99y1z9vbvhrkd25zqhnzhg6zjmaam3vfjzf2mazd39mx7d0x")) |
fc1adab1 | 125 | (patches (search-patches "dfu-programmer-fix-libusb.patch")))) |
2a9a4fb8 | 126 | (build-system gnu-build-system) |
702675c5 DT |
127 | (native-inputs |
128 | `(("pkg-config" ,pkg-config))) | |
2a9a4fb8 MR |
129 | (inputs |
130 | `(("libusb" ,libusb))) | |
131 | (home-page "http://dfu-programmer.github.io/") | |
132 | (synopsis "Device firmware update programmer for Atmel chips") | |
133 | (description | |
7c125ce0 AK |
134 | "Dfu-programmer is a multi-platform command-line programmer for |
135 | Atmel (8051, AVR, XMEGA & AVR32) chips with a USB bootloader supporting | |
136 | ISP.") | |
2a9a4fb8 | 137 | (license gpl2+))) |
af3166c3 HG |
138 | |
139 | (define-public dfu-util | |
140 | (package | |
141 | (name "dfu-util") | |
142 | (version "0.9") | |
143 | (source (origin | |
144 | (method url-fetch) | |
145 | (uri (string-append | |
146 | "http://dfu-util.sourceforge.net/releases/dfu-util-" | |
147 | version ".tar.gz")) | |
148 | (sha256 | |
149 | (base32 | |
150 | "0czq73m92ngf30asdzrfkzraag95hlrr74imbanqq25kdim8qhin")))) | |
151 | (build-system gnu-build-system) | |
152 | (inputs | |
153 | `(("libusb" ,libusb))) | |
154 | (native-inputs | |
155 | `(("pkg-config" ,pkg-config))) | |
156 | (synopsis "Host side of the USB Device Firmware Upgrade (DFU) protocol") | |
157 | (description | |
158 | "The DFU (Universal Serial Bus Device Firmware Upgrade) protocol is | |
159 | intended to download and upload firmware to devices connected over USB. It | |
160 | ranges from small devices like micro-controller boards up to mobile phones. | |
161 | With dfu-util you are able to download firmware to your device or upload | |
162 | firmware from it.") | |
163 | (home-page "http://dfu-util.sourceforge.net/") | |
164 | (license gpl2+))) | |
d3a858cb HG |
165 | |
166 | (define-public teensy-loader-cli | |
167 | ;; The repo does not tag versions nor does it use releases, but a commit | |
168 | ;; message says "Importing 2.1", while the sourcce still says "2.0". So pin | |
169 | ;; to a fixed commit. | |
170 | (let ((commit "f289b7a2e5627464044249f0e5742830e052e360")) | |
171 | (package | |
172 | (name "teensy-loader-cli") | |
173 | (version (string-append "2.1-1." (string-take commit 7))) | |
174 | (source | |
175 | (origin | |
176 | (method url-fetch) | |
177 | (uri (string-append "https://github.com/PaulStoffregen/" | |
178 | "teensy_loader_cli/archive/" commit ".tar.gz")) | |
179 | (sha256 (base32 "17wqc2q4fa473cy7f5m2yiyb9nq0qw7xal2kzrxzaikgm9rabsw8")) | |
180 | (file-name (string-append "teensy-loader-cli-" version ".tar.gz" )) | |
181 | (modules '((guix build utils))) | |
182 | (snippet | |
183 | `(begin | |
184 | ;; Remove example flash files and teensy rebooter flash binaries. | |
185 | (for-each delete-file (find-files "." "\\.(elf|hex)$")) | |
186 | ;; Fix the version | |
187 | (substitute* "teensy_loader_cli.c" | |
188 | (("Teensy Loader, Command Line, Version 2.0\\\\n") | |
189 | (string-append "Teensy Loader, Command Line, " ,version "\\n"))) | |
190 | #t)) | |
191 | (patches (search-patches "teensy-loader-cli-help.patch")))) | |
192 | (build-system gnu-build-system) | |
193 | (arguments | |
194 | '(#:tests? #f ;; Makefile has no test target | |
195 | #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output)) | |
196 | #:phases | |
197 | (modify-phases %standard-phases | |
198 | (delete 'configure) | |
199 | (replace 'install | |
200 | (lambda* (#:key outputs #:allow-other-keys) | |
201 | (let* ((out (assoc-ref outputs "out")) | |
202 | (bin (string-append out "/bin"))) | |
203 | (install-file "teensy_loader_cli" bin) | |
204 | #t)))))) | |
205 | (inputs | |
206 | `(("libusb-compat" ,libusb-compat))) | |
207 | (synopsis "Command line firmware uploader for Teensy development boards") | |
208 | (description | |
209 | "The Teensy loader program communicates with your Teensy board when the | |
210 | HalfKay bootloader is running, so you can upload new programs and run them. | |
211 | ||
212 | You need to add the udev rules to make the Teensy update available for | |
213 | non-root users.") | |
214 | (home-page "https://www.pjrc.com/teensy/loader_cli.html") | |
215 | (license gpl3)))) | |
7526edb9 EF |
216 | |
217 | (define-public rkflashtool | |
218 | (let ((commit "094bd6410cb016e487e2ccb1050c59eeac2e6dd1") | |
219 | (revision "1")) | |
220 | (package | |
221 | (name "rkflashtool") | |
222 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
223 | (source | |
224 | (origin | |
225 | (method git-fetch) | |
226 | (uri (git-reference | |
227 | (url "https://github.com/linux-rockchip/rkflashtool.git") | |
228 | (commit commit))) | |
229 | (file-name (string-append name "-" version "-checkout")) | |
230 | (sha256 | |
231 | (base32 | |
232 | "1zkd8zxir3rfg3sy9r20bcnxclnplryn583gqpcr3iad0k3xbah7")))) | |
233 | (build-system gnu-build-system) | |
234 | (arguments | |
235 | '(#:phases | |
236 | (modify-phases %standard-phases | |
237 | (delete 'configure)) ; no configure | |
238 | #:make-flags (list (string-append "PREFIX=" %output)) | |
239 | #:tests? #f)) ; no tests | |
240 | (native-inputs | |
241 | `(("pkg-config" ,pkg-config))) | |
242 | (inputs | |
243 | `(("libusb" ,libusb))) | |
244 | (home-page "https://github.com/linux-rockchip/rkflashtool") | |
245 | (synopsis "Tools for flashing Rockchip devices") | |
246 | (description "Allows flashing of Rockchip based embedded linux devices. | |
247 | The list of currently supported devices is: RK2818, RK2918, RK2928, RK3026, | |
248 | RK3036, RK3066, RK312X, RK3168, RK3188, RK3288, RK3368.") | |
249 | (license bsd-2)))) |