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> |
29ac89a6 | 7 | ;;; Copyright © 2017 Jonathan Brielmaier <jonathan.brielmaier@web.de> |
f282aa53 | 8 | ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> |
4acd5c0f MR |
9 | ;;; |
10 | ;;; This file is part of GNU Guix. | |
11 | ;;; | |
12 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
13 | ;;; under the terms of the GNU General Public License as published by | |
14 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
15 | ;;; your option) any later version. | |
16 | ;;; | |
17 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
18 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;;; GNU General Public License for more details. | |
21 | ;;; | |
22 | ;;; You should have received a copy of the GNU General Public License | |
23 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
24 | ||
eff5f452 | 25 | (define-module (gnu packages flashing-tools) |
f282aa53 | 26 | #:use-module ((guix licenses) #:prefix license:) |
4acd5c0f | 27 | #:use-module (guix download) |
7526edb9 | 28 | #:use-module (guix git-download) |
4acd5c0f MR |
29 | #:use-module (guix packages) |
30 | #:use-module (gnu packages) | |
f282aa53 | 31 | #:use-module (guix build-system cmake) |
4acd5c0f MR |
32 | #:use-module (guix build-system gnu) |
33 | #:use-module (gnu packages bison) | |
f282aa53 | 34 | #:use-module (gnu packages compression) |
4acd5c0f MR |
35 | #:use-module (gnu packages flex) |
36 | #:use-module (gnu packages elf) | |
eff5f452 | 37 | #:use-module (gnu packages pkg-config) |
4acd5c0f | 38 | #:use-module (gnu packages libusb) |
eff5f452 MR |
39 | #:use-module (gnu packages libftdi) |
40 | #:use-module (gnu packages pciutils) | |
f282aa53 | 41 | #:use-module (gnu packages qt) |
af3166c3 | 42 | #:use-module (gnu packages autotools) |
eff5f452 MR |
43 | #:use-module (gnu packages admin)) |
44 | ||
45 | (define-public flashrom | |
46 | (package | |
47 | (name "flashrom") | |
03ddad84 | 48 | (version "0.9.9") |
eff5f452 MR |
49 | (source (origin |
50 | (method url-fetch) | |
51 | (uri (string-append | |
03ddad84 | 52 | "https://download.flashrom.org/releases/flashrom-" |
eff5f452 MR |
53 | version ".tar.bz2")) |
54 | (sha256 | |
55 | (base32 | |
03ddad84 | 56 | "0i9wg1lyfg99bld7d00zqjm9f0lk6m0q3h3n9c195c9yysq5ccfb")))) |
eff5f452 MR |
57 | (build-system gnu-build-system) |
58 | (inputs `(("dmidecode" ,dmidecode) | |
59 | ("pciutils" ,pciutils) | |
60 | ("libusb" ,libusb) | |
61 | ("libftdi" ,libftdi))) | |
62 | (native-inputs `(("pkg-config" ,pkg-config))) | |
63 | (arguments | |
03ddad84 DM |
64 | '(#:make-flags (list "CC=gcc" |
65 | (string-append "PREFIX=" %output) | |
66 | "CONFIG_ENABLE_LIBUSB0_PROGRAMMERS=no") | |
eff5f452 MR |
67 | #:tests? #f ; no 'check' target |
68 | #:phases | |
dc1d3cde KK |
69 | (modify-phases %standard-phases |
70 | (delete 'configure) | |
71 | (add-before 'build 'patch-exec-paths | |
72 | (lambda* (#:key inputs #:allow-other-keys) | |
73 | (substitute* "dmi.c" | |
74 | (("\"dmidecode\"") | |
75 | (format #f "~S" | |
76 | (string-append (assoc-ref inputs "dmidecode") | |
77 | "/sbin/dmidecode")))) | |
78 | #t))))) | |
eff5f452 MR |
79 | (home-page "http://flashrom.org/") |
80 | (synopsis "Identify, read, write, erase, and verify ROM/flash chips") | |
81 | (description | |
82 | "flashrom is a utility for identifying, reading, writing, | |
83 | verifying and erasing flash chips. It is designed to flash | |
84 | BIOS/EFI/coreboot/firmware/optionROM images on mainboards, | |
85 | network/graphics/storage controller cards, and various other | |
86 | programmer devices.") | |
f282aa53 | 87 | (license license:gpl2))) |
4acd5c0f | 88 | |
29ac89a6 JB |
89 | (define-public 0xffff |
90 | (package | |
91 | (name "0xffff") | |
92 | (version "0.7") | |
93 | (source | |
94 | (origin | |
95 | (method url-fetch) | |
96 | (uri (string-append "https://github.com/pali/0xffff/archive/" | |
97 | version ".tar.gz")) | |
98 | (file-name (string-append "0xFFFF" version ".tar.gz" )) | |
99 | (sha256 | |
100 | (base32 | |
101 | "1g4032c81wkk37wvbg1dxcqq6mnd76y9x7f2crmzqi6z4q9jcxmj")))) | |
102 | (build-system gnu-build-system) | |
103 | (inputs | |
104 | `(("libusb",libusb-0.1))) ; doesn't work with libusb-compat | |
105 | (arguments | |
106 | '(#:phases | |
107 | (modify-phases %standard-phases | |
108 | (delete 'configure)) ; no configure | |
109 | #:make-flags (list (string-append "PREFIX=" %output)) | |
110 | #:tests? #f)) ; no 'check' target | |
111 | (home-page "https://github.com/pali/0xFFFF") | |
112 | (synopsis "Flash FIASCO images on Maemo devices") | |
113 | (description | |
114 | "The Open Free Fiasco Firmware Flasher (0xFFFF) is a flashing tool | |
115 | for FIASCO images. It supports generating, unpacking, editing and | |
116 | flashing of FIASCO images for Maemo devices. Use it with care. It can | |
117 | brick your device.") | |
f282aa53 | 118 | (license license:gpl3+))) |
29ac89a6 | 119 | |
4acd5c0f MR |
120 | (define-public avrdude |
121 | (package | |
122 | (name "avrdude") | |
123 | (version "6.1") | |
124 | (source | |
125 | (origin | |
126 | (method url-fetch) | |
127 | (uri (string-append "mirror://savannah/avrdude/avrdude-" | |
128 | version ".tar.gz")) | |
129 | (sha256 | |
130 | (base32 | |
b0069a67 | 131 | "0frxg0q09nrm95z7ymzddx7ysl77ilfbdix1m81d9jjpiv5bm64y")))) |
4acd5c0f MR |
132 | (build-system gnu-build-system) |
133 | (inputs | |
134 | `(("libelf" ,libelf) | |
b0069a67 | 135 | ("libusb" ,libusb-compat) |
4acd5c0f MR |
136 | ("libftdi" ,libftdi))) |
137 | (native-inputs | |
138 | `(("bison" ,bison) | |
139 | ("flex" ,flex))) | |
140 | (home-page "http://www.nongnu.org/avrdude/") | |
141 | (synopsis "AVR downloader and uploader") | |
142 | (description | |
143 | "AVRDUDE is a utility to download/upload/manipulate the ROM and | |
144 | EEPROM contents of AVR microcontrollers using the in-system programming | |
145 | technique (ISP).") | |
f282aa53 | 146 | (license license:gpl2+))) |
2a9a4fb8 MR |
147 | |
148 | (define-public dfu-programmer | |
149 | (package | |
150 | (name "dfu-programmer") | |
702675c5 | 151 | (version "0.7.2") |
2a9a4fb8 MR |
152 | (source |
153 | (origin | |
154 | (method url-fetch) | |
de67e922 LF |
155 | (uri (string-append "mirror://sourceforge/dfu-programmer/dfu-programmer/" |
156 | version "/dfu-programmer-" version ".tar.gz")) | |
2a9a4fb8 MR |
157 | (sha256 |
158 | (base32 | |
702675c5 | 159 | "15gr99y1z9vbvhrkd25zqhnzhg6zjmaam3vfjzf2mazd39mx7d0x")) |
fc1adab1 | 160 | (patches (search-patches "dfu-programmer-fix-libusb.patch")))) |
2a9a4fb8 | 161 | (build-system gnu-build-system) |
702675c5 DT |
162 | (native-inputs |
163 | `(("pkg-config" ,pkg-config))) | |
2a9a4fb8 MR |
164 | (inputs |
165 | `(("libusb" ,libusb))) | |
166 | (home-page "http://dfu-programmer.github.io/") | |
167 | (synopsis "Device firmware update programmer for Atmel chips") | |
168 | (description | |
7c125ce0 AK |
169 | "Dfu-programmer is a multi-platform command-line programmer for |
170 | Atmel (8051, AVR, XMEGA & AVR32) chips with a USB bootloader supporting | |
171 | ISP.") | |
f282aa53 | 172 | (license license:gpl2+))) |
af3166c3 HG |
173 | |
174 | (define-public dfu-util | |
175 | (package | |
176 | (name "dfu-util") | |
177 | (version "0.9") | |
178 | (source (origin | |
179 | (method url-fetch) | |
180 | (uri (string-append | |
181 | "http://dfu-util.sourceforge.net/releases/dfu-util-" | |
182 | version ".tar.gz")) | |
183 | (sha256 | |
184 | (base32 | |
185 | "0czq73m92ngf30asdzrfkzraag95hlrr74imbanqq25kdim8qhin")))) | |
186 | (build-system gnu-build-system) | |
187 | (inputs | |
188 | `(("libusb" ,libusb))) | |
189 | (native-inputs | |
190 | `(("pkg-config" ,pkg-config))) | |
191 | (synopsis "Host side of the USB Device Firmware Upgrade (DFU) protocol") | |
192 | (description | |
193 | "The DFU (Universal Serial Bus Device Firmware Upgrade) protocol is | |
194 | intended to download and upload firmware to devices connected over USB. It | |
195 | ranges from small devices like micro-controller boards up to mobile phones. | |
196 | With dfu-util you are able to download firmware to your device or upload | |
197 | firmware from it.") | |
198 | (home-page "http://dfu-util.sourceforge.net/") | |
f282aa53 | 199 | (license license:gpl2+))) |
d3a858cb HG |
200 | |
201 | (define-public teensy-loader-cli | |
202 | ;; The repo does not tag versions nor does it use releases, but a commit | |
203 | ;; message says "Importing 2.1", while the sourcce still says "2.0". So pin | |
204 | ;; to a fixed commit. | |
205 | (let ((commit "f289b7a2e5627464044249f0e5742830e052e360")) | |
206 | (package | |
207 | (name "teensy-loader-cli") | |
208 | (version (string-append "2.1-1." (string-take commit 7))) | |
209 | (source | |
210 | (origin | |
211 | (method url-fetch) | |
212 | (uri (string-append "https://github.com/PaulStoffregen/" | |
213 | "teensy_loader_cli/archive/" commit ".tar.gz")) | |
214 | (sha256 (base32 "17wqc2q4fa473cy7f5m2yiyb9nq0qw7xal2kzrxzaikgm9rabsw8")) | |
215 | (file-name (string-append "teensy-loader-cli-" version ".tar.gz" )) | |
216 | (modules '((guix build utils))) | |
217 | (snippet | |
218 | `(begin | |
219 | ;; Remove example flash files and teensy rebooter flash binaries. | |
220 | (for-each delete-file (find-files "." "\\.(elf|hex)$")) | |
221 | ;; Fix the version | |
222 | (substitute* "teensy_loader_cli.c" | |
223 | (("Teensy Loader, Command Line, Version 2.0\\\\n") | |
224 | (string-append "Teensy Loader, Command Line, " ,version "\\n"))) | |
225 | #t)) | |
226 | (patches (search-patches "teensy-loader-cli-help.patch")))) | |
227 | (build-system gnu-build-system) | |
228 | (arguments | |
229 | '(#:tests? #f ;; Makefile has no test target | |
230 | #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output)) | |
231 | #:phases | |
232 | (modify-phases %standard-phases | |
233 | (delete 'configure) | |
234 | (replace 'install | |
235 | (lambda* (#:key outputs #:allow-other-keys) | |
236 | (let* ((out (assoc-ref outputs "out")) | |
237 | (bin (string-append out "/bin"))) | |
238 | (install-file "teensy_loader_cli" bin) | |
239 | #t)))))) | |
240 | (inputs | |
241 | `(("libusb-compat" ,libusb-compat))) | |
242 | (synopsis "Command line firmware uploader for Teensy development boards") | |
243 | (description | |
244 | "The Teensy loader program communicates with your Teensy board when the | |
245 | HalfKay bootloader is running, so you can upload new programs and run them. | |
246 | ||
247 | You need to add the udev rules to make the Teensy update available for | |
248 | non-root users.") | |
249 | (home-page "https://www.pjrc.com/teensy/loader_cli.html") | |
f282aa53 | 250 | (license license:gpl3)))) |
7526edb9 EF |
251 | |
252 | (define-public rkflashtool | |
253 | (let ((commit "094bd6410cb016e487e2ccb1050c59eeac2e6dd1") | |
254 | (revision "1")) | |
255 | (package | |
256 | (name "rkflashtool") | |
257 | (version (string-append "0.0.0-" revision "." (string-take commit 7))) | |
258 | (source | |
259 | (origin | |
260 | (method git-fetch) | |
261 | (uri (git-reference | |
262 | (url "https://github.com/linux-rockchip/rkflashtool.git") | |
263 | (commit commit))) | |
264 | (file-name (string-append name "-" version "-checkout")) | |
265 | (sha256 | |
266 | (base32 | |
267 | "1zkd8zxir3rfg3sy9r20bcnxclnplryn583gqpcr3iad0k3xbah7")))) | |
268 | (build-system gnu-build-system) | |
269 | (arguments | |
270 | '(#:phases | |
271 | (modify-phases %standard-phases | |
272 | (delete 'configure)) ; no configure | |
273 | #:make-flags (list (string-append "PREFIX=" %output)) | |
274 | #:tests? #f)) ; no tests | |
275 | (native-inputs | |
276 | `(("pkg-config" ,pkg-config))) | |
277 | (inputs | |
278 | `(("libusb" ,libusb))) | |
279 | (home-page "https://github.com/linux-rockchip/rkflashtool") | |
280 | (synopsis "Tools for flashing Rockchip devices") | |
281 | (description "Allows flashing of Rockchip based embedded linux devices. | |
282 | The list of currently supported devices is: RK2818, RK2918, RK2928, RK3026, | |
283 | RK3036, RK3066, RK312X, RK3168, RK3188, RK3288, RK3368.") | |
f282aa53 JL |
284 | (license license:bsd-2)))) |
285 | ||
286 | (define-public heimdall | |
287 | (package | |
288 | (name "heimdall") | |
289 | (version "1.4.2") | |
290 | (source (origin | |
291 | (method url-fetch) | |
292 | (uri (string-append "https://github.com/Benjamin-Dobell/Heimdall" | |
293 | "/archive/v" version ".tar.gz")) | |
294 | (file-name (string-append name "-" version ".tar.gz")) | |
295 | (sha256 | |
296 | (base32 | |
297 | "1y7gwg3lipyp2zcysm2vid1qg5nwin9bxbvgzs28lz2rya4fz6sq")))) | |
298 | (build-system cmake-build-system) | |
299 | (arguments | |
300 | `(#:configure-flags '("-DCMAKE_BUILD_TYPE=Release") | |
301 | #:tests? #f; no tests | |
302 | #:phases | |
303 | (modify-phases %standard-phases | |
304 | (add-after 'unpack 'patch-invocations | |
305 | (lambda* (#:key outputs #:allow-other-keys) | |
306 | (substitute* '("heimdall-frontend/source/aboutform.cpp" | |
307 | "heimdall-frontend/source/mainwindow.cpp") | |
308 | (("start[(]\"heimdall\"") | |
309 | (string-append "start(\"" (assoc-ref outputs "out") | |
310 | "/bin/heimdall\""))) | |
311 | #t)) | |
312 | (replace 'install | |
313 | (lambda* (#:key outputs #:allow-other-keys) | |
314 | (let ((bin (string-append (assoc-ref outputs "out") "/bin")) | |
315 | (lib (string-append (assoc-ref outputs "out") "/lib"))) | |
316 | (install-file "bin/heimdall" bin) | |
317 | (install-file "bin/heimdall-frontend" bin) | |
318 | (install-file "libpit/libpit.a" lib) | |
319 | #t)))))) | |
320 | (inputs | |
321 | `(("libusb" ,libusb) | |
322 | ("qtbase" ,qtbase) | |
323 | ("zlib" ,zlib))) | |
324 | (home-page "http://glassechidna.com.au/heimdall/") | |
325 | (synopsis "Flash firmware onto Samsung mobile devices") | |
326 | (description "@command{heimdall} is a tool suite used to flash firmware (aka | |
327 | ROMs) onto Samsung mobile devices. Heimdall connects to a mobile device over | |
328 | USB and interacts with low-level software running on the device, known as Loke. | |
329 | Loke and Heimdall communicate via the custom Samsung-developed protocol typically | |
330 | referred to as the \"Odin 3 protocol\".") | |
331 | (license license:expat))) |