Commit | Line | Data |
---|---|---|
8472bdec JN |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> | |
c283b22e | 3 | ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org> |
15a3fffc | 4 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> |
3d6c5560 | 5 | ;;; Copyright © 2016, 2020, 2021 Efraim Flashner <efraim@flashner.co.il> |
1b61c75f | 6 | ;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <me@tobias.gr> |
9a2e4c5d | 7 | ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com> |
43675ac7 | 8 | ;;; Copyright © 2019 Andy Tai <atai@atai.org> |
1c006805 | 9 | ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> |
94551439 | 10 | ;;; Copyright © 2020 Christine Lemmer-Webber <cwebber@dustycloud.org> |
f3130c66 | 11 | ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com> |
3016f1f2 | 12 | ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
b56e01cb | 13 | ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net> |
3d1b2bc7 | 14 | ;;; Copyright © 2022 Felix Gruber <felgru@posteo.net> |
8472bdec JN |
15 | ;;; |
16 | ;;; This file is part of GNU Guix. | |
17 | ;;; | |
18 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
19 | ;;; under the terms of the GNU General Public License as published by | |
20 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
21 | ;;; your option) any later version. | |
22 | ;;; | |
23 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
24 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
26 | ;;; GNU General Public License for more details. | |
27 | ;;; | |
28 | ;;; You should have received a copy of the GNU General Public License | |
29 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
30 | ||
31 | (define-module (gnu packages assembly) | |
3d6c5560 | 32 | #:use-module (guix build-system meson) |
8273188c | 33 | #:use-module (guix build-system cmake) |
8472bdec JN |
34 | #:use-module (guix build-system gnu) |
35 | #:use-module (guix download) | |
43675ac7 | 36 | #:use-module (guix git-download) |
8472bdec JN |
37 | #:use-module ((guix licenses) #:prefix license:) |
38 | #:use-module (guix packages) | |
a837997c | 39 | #:use-module (gnu packages) |
43675ac7 AT |
40 | #:use-module (gnu packages admin) |
41 | #:use-module (gnu packages autotools) | |
42 | #:use-module (gnu packages base) | |
43 | #:use-module (gnu packages bison) | |
b6e08049 | 44 | #:use-module (gnu packages compression) |
43675ac7 AT |
45 | #:use-module (gnu packages flex) |
46 | #:use-module (gnu packages gettext) | |
1c006805 JK |
47 | #:use-module (gnu packages image) |
48 | #:use-module (gnu packages linux) | |
43675ac7 | 49 | #:use-module (gnu packages man) |
8472bdec | 50 | #:use-module (gnu packages perl) |
43675ac7 | 51 | #:use-module (gnu packages pkg-config) |
15a3fffc LC |
52 | #:use-module (gnu packages texinfo) |
53 | #:use-module (gnu packages python) | |
8273188c | 54 | #:use-module (gnu packages sphinx) |
f3130c66 | 55 | #:use-module (gnu packages shells) |
9a2e4c5d | 56 | #:use-module (gnu packages xml) |
57 | #:use-module ((guix utils) | |
59775c1c | 58 | #:select (%current-system cc-for-target))) |
8472bdec JN |
59 | |
60 | (define-public nasm | |
61 | (package | |
62 | (name "nasm") | |
5d547f74 | 63 | (version "2.15.05") |
8472bdec JN |
64 | (source (origin |
65 | (method url-fetch) | |
66 | (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/" | |
1de52650 | 67 | version "/nasm-" version ".tar.xz")) |
8472bdec JN |
68 | (sha256 |
69 | (base32 | |
5d547f74 | 70 | "0gqand86b0r86k3h46dh560lykxmxqqywz5m55kgjfq7q4lngbrw")))) |
8472bdec | 71 | (build-system gnu-build-system) |
8394619b LC |
72 | (native-inputs (list perl ;for doc and test target |
73 | texinfo)) | |
8472bdec JN |
74 | (arguments |
75 | `(#:test-target "test" | |
161fb9be EF |
76 | #:phases |
77 | (modify-phases %standard-phases | |
78 | (add-after 'unpack 'dont-build-ps-pdf-outputs | |
79 | (lambda _ | |
80 | (substitute* "doc/Makefile.in" | |
5d547f74 | 81 | (("html nasmdoc.txt nasmdoc.pdf \\$\\(XZFILES\\)") |
3f56740d MB |
82 | "html nasmdoc.txt") |
83 | (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf") | |
5d547f74 | 84 | "$(INSTALL_DATA)")))) |
161fb9be EF |
85 | (add-after 'install 'install-info |
86 | (lambda _ | |
4792cc86 | 87 | (invoke "make" "install_doc")))))) |
80459f5a | 88 | (home-page "https://www.nasm.us/") |
8472bdec JN |
89 | (synopsis "80x86 and x86-64 assembler") |
90 | (description | |
91 | "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed | |
92 | for portability and modularity. It supports a range of object file formats, | |
93 | including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ, | |
94 | Windows32 and Windows64. It will also output plain binary files. Its syntax | |
95 | is designed to be simple and easy to understand, similar to Intel's but less | |
96 | complex. It supports all currently known x86 architectural extensions, and | |
97 | has strong support for macros.") | |
1d7fbe09 | 98 | (license license:bsd-2))) |
15a3fffc LC |
99 | |
100 | (define-public yasm | |
101 | (package | |
102 | (name "yasm") | |
103 | (version "1.3.0") | |
104 | (source (origin | |
105 | (method url-fetch) | |
106 | (uri (string-append | |
107 | "http://www.tortall.net/projects/yasm/releases/yasm-" | |
108 | version ".tar.gz")) | |
109 | (sha256 | |
110 | (base32 | |
111 | "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix")))) | |
112 | (build-system gnu-build-system) | |
e9d48bda CB |
113 | (arguments |
114 | '(#:parallel-tests? #f)) ; Some tests fail | |
115 | ; non-deterministically when run in | |
116 | ; parallel | |
15a3fffc LC |
117 | (inputs |
118 | `(("python" ,python-wrapper) | |
119 | ("xmlto" ,xmlto))) | |
b2ce10e3 | 120 | (home-page "https://yasm.tortall.net/") |
15a3fffc LC |
121 | (synopsis "Rewrite of the NASM assembler") |
122 | (description | |
123 | "Yasm is a complete rewrite of the NASM assembler. | |
124 | ||
125 | Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM | |
126 | and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit | |
127 | Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source | |
128 | debugging information in STABS, DWARF 2, and CodeView 8 formats.") | |
129 | (license (license:non-copyleft "file://COPYING" | |
130 | "See COPYING in the distribution.")))) | |
c283b22e AK |
131 | |
132 | (define-public lightning | |
133 | (package | |
134 | (name "lightning") | |
bae08e22 | 135 | (version "2.1.3") |
c283b22e AK |
136 | (source (origin |
137 | (method url-fetch) | |
138 | (uri (string-append "mirror://gnu/lightning/lightning-" | |
139 | version ".tar.gz")) | |
140 | (sha256 | |
141 | (base32 | |
bae08e22 | 142 | "1jgxbq2cm51dzi3zhz38mmgwdcgs328mfl8iviw8dxn6dn36p1gd")))) |
c283b22e | 143 | (build-system gnu-build-system) |
8394619b | 144 | (native-inputs (list zlib)) |
b56e01cb GLV |
145 | (arguments |
146 | ;; Some tests fail when run in parallel. | |
147 | `(#:parallel-tests? #f)) | |
c283b22e AK |
148 | (synopsis "Library for generating assembly code at runtime") |
149 | (description | |
150 | "GNU Lightning is a library that generates assembly language code at | |
151 | run-time. Thus, it is useful in creating Just-In-Time compilers. It | |
152 | abstracts over the target CPU by exposing a standardized RISC instruction set | |
153 | to the clients.") | |
6fd52309 | 154 | (home-page "https://www.gnu.org/software/lightning/") |
da0cef6a | 155 | (license license:gpl3+))) |
9a2e4c5d | 156 | |
3d6c5560 EF |
157 | (define-public simde |
158 | (package | |
159 | (name "simde") | |
2e142b1c TGR |
160 | (version "0.7.2") |
161 | (source | |
162 | (origin | |
163 | (method git-fetch) | |
164 | (uri (git-reference | |
165 | (url "https://github.com/simd-everywhere/simde") | |
166 | (commit (string-append "v" version)))) | |
167 | (file-name (git-file-name name version)) | |
168 | (sha256 | |
169 | (base32 "0xkf21gbkgz6zlxabkmgwvy7py6cdnfqx9aplj90gz25gzrr1mkb")))) | |
3d6c5560 EF |
170 | (build-system meson-build-system) |
171 | ;; We really want this for the headers, and the tests require a bundled library. | |
172 | (arguments '(#:configure-flags '("-Dtests=false"))) | |
173 | (synopsis "Implementations of SIMD instruction sets for foreign systems") | |
174 | (description "The SIMDe header-only library provides fast, portable | |
175 | implementations of SIMD intrinsics on hardware which doesn't natively support | |
176 | them, such as calling SSE functions on ARM. There is no performance penalty if | |
177 | the hardware supports the native implementation (e.g., SSE/AVX runs at full | |
178 | speed on x86, NEON on ARM, etc.).") | |
179 | (home-page "https://simd-everywhere.github.io/blog/") | |
180 | (license license:expat))) | |
181 | ||
9a2e4c5d | 182 | (define-public fasm |
183 | (package | |
184 | (name "fasm") | |
1b61c75f | 185 | (version "1.73.30") |
9a2e4c5d | 186 | (source |
187 | (origin | |
188 | (method url-fetch) | |
189 | (uri (string-append "https://flatassembler.net/fasm-" | |
190 | version ".tgz")) | |
191 | (sha256 | |
1b61c75f | 192 | (base32 "00giqb94z8cxhv20yiyk8axkd2kzjcg1c0841yzbn7c8lm8m06bm")))) |
9a2e4c5d | 193 | (build-system gnu-build-system) |
194 | (arguments | |
bf38c192 TGR |
195 | `(#:tests? #f ; no tests exist |
196 | #:strip-binaries? #f ; fasm has no sections | |
9a2e4c5d | 197 | #:phases |
198 | (modify-phases %standard-phases | |
bf38c192 | 199 | (delete 'configure) ; no "configure" script |
9a2e4c5d | 200 | (replace 'build |
201 | (lambda _ | |
9a2e4c5d | 202 | (chdir "source/Linux/") |
203 | (if (string=? ,(%current-system) "x86_64-linux") | |
f73b7bf6 DM |
204 | ;; Use pre-compiled binaries in top-level directory to build |
205 | ;; fasm. | |
9a2e4c5d | 206 | (invoke "../../fasm.x64" "fasm.asm") |
207 | (invoke "../../fasm" "fasm.asm")))) | |
208 | (replace 'install | |
209 | (lambda _ | |
210 | (let ((out (assoc-ref %outputs "out"))) | |
4a1f79da | 211 | (install-file "fasm" (string-append out "/bin")))))))) |
9a2e4c5d | 212 | (supported-systems '("x86_64-linux" "i686-linux")) |
213 | (synopsis "Assembler for x86 processors") | |
214 | (description | |
caa66bde TGR |
215 | "@acronym{FASM, the Flat ASseMbler} is an assembler that supports x86 and |
216 | IA-64 Intel architectures. It does multiple passes to optimize machine code. | |
217 | It has macro abilities and focuses on operating system portability.") | |
9a2e4c5d | 218 | (home-page "https://flatassembler.net/") |
219 | (license license:bsd-2))) | |
1bde3d2c DM |
220 | |
221 | (define-public dev86 | |
222 | (package | |
223 | (name "dev86") | |
224 | (version "0.16.21") | |
225 | (source (origin | |
226 | (method url-fetch) | |
227 | (uri (string-append "http://v3.sk/~lkundrak/dev86/Dev86src-" | |
228 | version ".tar.gz")) | |
229 | (sha256 | |
230 | (base32 | |
231 | "154dyr2ph4n0kwi8yx0n78j128kw29rk9r9f7s2gddzrdl712jr3")))) | |
232 | (build-system gnu-build-system) | |
233 | (arguments | |
234 | `(#:parallel-build? #f ; They use submakes wrong | |
9c44af6b | 235 | #:make-flags (list ,(string-append "CC=" (cc-for-target)) |
1bde3d2c DM |
236 | (string-append "PREFIX=" |
237 | (assoc-ref %outputs "out"))) | |
238 | #:system "i686-linux" ; Standalone ld86 had problems otherwise | |
239 | #:tests? #f ; No tests exist | |
240 | #:phases | |
241 | (modify-phases %standard-phases | |
242 | (delete 'configure) | |
243 | (add-before 'install 'mkdir | |
244 | (lambda* (#:key outputs #:allow-other-keys) | |
245 | (let ((out (assoc-ref outputs "out"))) | |
246 | (mkdir-p (string-append out "/bin")) | |
247 | (mkdir-p (string-append out "/man/man1")) | |
248 | #t)))))) | |
249 | (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and | |
250 | linker") | |
251 | (description "This package provides a Intel 8086 (primarily 16-bit) | |
252 | assembler, a C compiler and a linker. The assembler uses Intel syntax | |
253 | (also Intel order of operands).") | |
254 | (home-page "https://github.com/jbruchon/dev86") | |
255 | (supported-systems '("i686-linux" "x86_64-linux")) | |
256 | (license license:gpl2+))) | |
43675ac7 AT |
257 | |
258 | (define-public libjit | |
259 | (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226")) | |
260 | (package | |
261 | (name "libjit") | |
262 | (version "0.1.4") | |
263 | (source (origin | |
264 | (method git-fetch) | |
265 | (uri (git-reference | |
266 | (url "https://git.savannah.gnu.org/r/libjit.git") | |
267 | (commit commit))) | |
779ce96f | 268 | (file-name (git-file-name name version)) |
43675ac7 AT |
269 | (sha256 |
270 | (base32 | |
271 | "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd")))) | |
272 | (build-system gnu-build-system) | |
273 | (native-inputs | |
e3196755 LC |
274 | (list autoconf |
275 | automake | |
276 | bison | |
277 | flex | |
278 | help2man | |
279 | gettext-minimal | |
280 | libtool | |
281 | texinfo | |
282 | pkg-config)) | |
43675ac7 AT |
283 | (home-page "https://www.gnu.org/software/libjit/") |
284 | (synopsis "Just-In-Time compilation library") | |
285 | (description | |
286 | "GNU libjit is a library that provides generic Just-In-Time compiler | |
287 | functionality independent of any particular bytecode, language, or | |
288 | runtime") | |
289 | (license license:lgpl2.1+)))) | |
1c006805 JK |
290 | |
291 | (define-public rgbds | |
292 | (package | |
293 | (name "rgbds") | |
eb38d49b | 294 | (version "0.5.2") |
1c006805 JK |
295 | (source (origin |
296 | (method git-fetch) | |
297 | (uri (git-reference | |
465ef8f1 | 298 | (url "https://github.com/gbdev/rgbds") |
1c006805 JK |
299 | (commit (string-append "v" version)))) |
300 | (file-name (git-file-name name version)) | |
301 | (sha256 | |
302 | (base32 | |
eb38d49b | 303 | "13zy05xzh2yxyvzf78a5h59pabwrfr6qs5m453pfbdyd3msg2s7w")))) |
1c006805 JK |
304 | (build-system gnu-build-system) |
305 | (arguments | |
306 | `(#:phases | |
307 | (modify-phases %standard-phases | |
308 | (delete 'configure) | |
59775c1c EF |
309 | (add-after 'unpack 'patch-pkg-config |
310 | (lambda _ | |
311 | (substitute* "Makefile" | |
312 | (("pkg-config") | |
313 | (or (which "pkg-config") | |
314 | (string-append ,(%current-target-system) | |
eb38d49b | 315 | "-pkg-config")))))) |
1c006805 JK |
316 | (replace 'check |
317 | (lambda _ | |
318 | (with-directory-excursion "test/asm" | |
319 | (invoke "./test.sh")) | |
320 | (with-directory-excursion "test/link" | |
321 | (invoke "./test.sh"))))) | |
59775c1c | 322 | #:make-flags `(,(string-append "CC=" ,(cc-for-target)) |
1c006805 JK |
323 | ,(string-append "PREFIX=" |
324 | (assoc-ref %outputs "out"))))) | |
325 | (native-inputs | |
8394619b | 326 | (list bison flex pkg-config util-linux)) |
1c006805 | 327 | (inputs |
8394619b | 328 | (list libpng)) |
465ef8f1 | 329 | (home-page "https://github.com/gbdev/rgbds") |
1c006805 JK |
330 | (synopsis "Rednex Game Boy Development System") |
331 | (description | |
332 | "RGBDS (Rednex Game Boy Development System) is an assembler/linker | |
333 | package for the Game Boy and Game Boy Color. It consists of: | |
334 | @itemize @bullet | |
335 | @item rgbasm (assembler) | |
336 | @item rgblink (linker) | |
337 | @item rgbfix (checksum/header fixer) | |
338 | @item rgbgfx (PNG-to-Game Boy graphics converter) | |
339 | @end itemize") | |
340 | (license license:expat))) | |
8273188c JK |
341 | |
342 | (define-public wla-dx | |
343 | (package | |
344 | (name "wla-dx") | |
3d1b2bc7 | 345 | (version "10.1") |
8273188c JK |
346 | (source (origin |
347 | (method git-fetch) | |
348 | (uri (git-reference | |
b0e7b699 | 349 | (url "https://github.com/vhelin/wla-dx") |
8273188c JK |
350 | (commit (string-append "v" version)))) |
351 | (file-name (git-file-name name version)) | |
352 | (sha256 | |
353 | (base32 | |
3d1b2bc7 | 354 | "1nh2k2xn5fj389gq68f3fxgrxakgn8c6dw2ffqay86s3706hac9w")))) |
8273188c | 355 | (build-system cmake-build-system) |
3d1b2bc7 | 356 | (native-inputs (list python-sphinx)) ; to generate man pages |
8273188c | 357 | (arguments |
3d1b2bc7 FG |
358 | `(#:phases |
359 | (modify-phases %standard-phases | |
360 | (add-before 'check 'copy-tests-to-build-directory | |
361 | (lambda _ | |
362 | (copy-recursively "../source/tests" "tests"))) | |
363 | (replace 'check | |
364 | (lambda* (#:key tests? #:allow-other-keys) | |
365 | (let ((sh (which "sh"))) | |
366 | (when tests? | |
367 | (invoke sh "../source/run_tests.sh")))))))) | |
8273188c JK |
368 | (home-page "https://github.com/vhelin/wla-dx") |
369 | (synopsis "Assemblers for various processors") | |
370 | (description "WLA DX is a set of tools to assemble assembly files to | |
371 | object or library files (@code{wla-ARCH}) and link them together (@code{wlalink}). | |
372 | Supported architectures are: | |
373 | ||
374 | @itemize @bullet | |
375 | @item z80 | |
376 | @item gb (z80-gb) | |
377 | @item 6502 | |
378 | @item 65c02 | |
379 | @item 6510 | |
380 | @item 65816 | |
381 | @item 6800 | |
382 | @item 6801 | |
383 | @item 6809 | |
384 | @item 8008 | |
385 | @item 8080 | |
386 | @item huc6280 | |
387 | @item spc700 | |
388 | @end itemize") | |
389 | (license license:gpl2))) | |
dfe15d99 CLW |
390 | |
391 | (define-public xa | |
392 | (package | |
393 | (name "xa") | |
3848dafe | 394 | (version "2.3.12") |
dfe15d99 CLW |
395 | (source (origin |
396 | (method url-fetch) | |
397 | (uri (string-append "https://www.floodgap.com/retrotech/xa" | |
398 | "/dists/xa-" version ".tar.gz")) | |
399 | (sha256 | |
400 | (base32 | |
3848dafe | 401 | "0107zdwc2rzlp26pyx7gns4lqmiyg68nmpgwrg36yrrd04v1bzgq")))) |
dfe15d99 CLW |
402 | (build-system gnu-build-system) |
403 | (arguments | |
404 | `(#:tests? #f ; TODO: custom test harness, not sure how it works | |
405 | #:phases | |
406 | (modify-phases %standard-phases | |
407 | (delete 'configure)) ; no "configure" script | |
408 | #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))))) | |
8394619b | 409 | (native-inputs (list perl)) |
dfe15d99 CLW |
410 | (home-page "https://www.floodgap.com/retrotech/xa/") |
411 | (synopsis "Two-pass portable cross-assembler") | |
412 | (description | |
413 | "xa is a high-speed, two-pass portable cross-assembler. | |
414 | It understands mnemonics and generates code for NMOS 6502s (such | |
415 | as 6502A, 6504, 6507, 6510, 7501, 8500, 8501, 8502 ...), | |
416 | CMOS 6502s (65C02 and Rockwell R65C02) and the 65816.") | |
417 | (license license:gpl2))) | |
68a671ab LP |
418 | |
419 | (define-public armips | |
420 | (package | |
421 | (name "armips") | |
422 | (version "0.11.0") | |
423 | (source | |
424 | (origin | |
425 | (method git-fetch) | |
426 | (uri (git-reference | |
b0e7b699 | 427 | (url "https://github.com/Kingcom/armips") |
68a671ab | 428 | (commit (string-append "v" version)))) |
38c653bc | 429 | (file-name (git-file-name name version)) |
68a671ab LP |
430 | (sha256 |
431 | (base32 "1c4dhjkvynqn9xm2vcvwzymk7yg8h25alnawkz4z1dnn1z1k3r9g")))) | |
432 | (build-system cmake-build-system) | |
433 | (arguments | |
434 | `(#:phases | |
435 | (modify-phases %standard-phases | |
436 | (replace 'check | |
437 | (lambda* (#:key inputs #:allow-other-keys) | |
438 | (invoke "./armipstests" "../source/Tests"))) | |
439 | (replace 'install | |
440 | (lambda* (#:key outputs #:allow-other-keys) | |
441 | (install-file "armips" (string-append (assoc-ref outputs "out") | |
442 | "/bin")) | |
443 | #t))))) | |
444 | (home-page "https://github.com/Kingcom/armips") | |
445 | (synopsis "Assembler for various ARM and MIPS platforms") | |
446 | (description | |
447 | "armips is an assembler with full support for the MIPS R3000, MIPS R4000, | |
448 | Allegrex and RSP instruction sets, partial support for the EmotionEngine | |
449 | instruction set, as well as complete support for the ARM7 and ARM9 instruction | |
450 | sets, both THUMB and ARM mode.") | |
451 | (license license:expat))) | |
f3130c66 W |
452 | |
453 | (define-public intel-xed | |
454 | (package | |
455 | (name "intel-xed") | |
d7354701 | 456 | (version "12.0.1") |
f3130c66 W |
457 | (source |
458 | (origin | |
459 | (method git-fetch) | |
460 | (uri (git-reference | |
461 | (url "https://github.com/intelxed/xed") | |
462 | (commit version))) | |
d7354701 | 463 | (sha256 (base32 "07zfff8zf29c2n0wal87hiqfq3cwcjn80zz78mz0nyjfj09nd39f")) |
f3130c66 W |
464 | (file-name (git-file-name name version)) |
465 | (patches (search-patches "intel-xed-fix-nondeterminism.patch")))) | |
466 | (build-system gnu-build-system) | |
467 | (native-inputs | |
d7354701 | 468 | `(("python" ,python-wrapper) |
f3130c66 W |
469 | ("tcsh" ,tcsh) |
470 | ;; As of the time of writing this comment, mbuild does not exist in the | |
471 | ;; Python Package Index and seems to only be used by intel-xed, so we | |
472 | ;; opt to include it here instead of packaging separately. Note also | |
473 | ;; that the git repository contains no version tags, so we directly | |
474 | ;; reference the "version" variable from setup.py instead. | |
475 | ("mbuild" | |
476 | ,(let ((name "mbuild") | |
477 | (version "0.2496")) | |
478 | (origin | |
479 | (method git-fetch) | |
480 | (uri (git-reference | |
8ed4c468 | 481 | (url "https://github.com/intelxed/mbuild") |
d7354701 | 482 | (commit "3de3f0d753c11dbe634bec611d4cc13f74768e4f"))) |
f3130c66 W |
483 | (sha256 |
484 | (base32 | |
d7354701 | 485 | "0z8hdhpmk8y5c9429p2yns9daswnffbprni9czkq3vij8f58lkg4")) |
f3130c66 W |
486 | (file-name (git-file-name name version))))))) |
487 | (outputs '("out" "lib")) | |
488 | (arguments | |
489 | `(#:phases | |
490 | ;; Upstream uses the custom Python build tool `mbuild', so we munge | |
491 | ;; gnu-build-system to fit. The build process for this package is | |
492 | ;; documented at https://intelxed.github.io/build-manual/. | |
493 | (let* ((build-dir "build") | |
494 | (kit-dir "kit")) | |
495 | (modify-phases %standard-phases | |
496 | (delete 'configure) | |
497 | (replace 'build | |
498 | (lambda* (#:key inputs #:allow-other-keys) | |
499 | (let ((mbuild (assoc-ref inputs "mbuild"))) | |
3016f1f2 | 500 | (setenv "PYTHONPATH" mbuild) |
f3130c66 W |
501 | (invoke "./mfile.py" |
502 | (string-append "--build-dir=" build-dir) | |
503 | (string-append "--install-dir=" kit-dir) | |
504 | "examples" | |
505 | "doc" | |
506 | "install")))) | |
507 | (replace 'check | |
508 | (lambda _ | |
509 | ;; Skip broken test group `tests/tests-avx512pf'. | |
510 | (invoke "tests/run-cmd.py" | |
511 | (string-append "--build-dir=" kit-dir "/bin") | |
512 | "--tests" "tests/tests-base" | |
513 | "--tests" "tests/tests-avx512" | |
514 | "--tests" "tests/tests-cet" | |
515 | "--tests" "tests/tests-via" | |
516 | "--tests" "tests/tests-syntax" | |
517 | "--tests" "tests/tests-xop"))) | |
518 | (replace 'install | |
519 | (lambda* (#:key outputs #:allow-other-keys) | |
520 | (let* ((out (assoc-ref outputs "out")) | |
521 | (lib (assoc-ref outputs "lib"))) | |
522 | (copy-recursively (string-append kit-dir "/bin") | |
523 | (string-append out "/bin")) | |
524 | (copy-recursively (string-append kit-dir "/include") | |
525 | (string-append lib "/include")) | |
526 | (copy-recursively (string-append kit-dir "/lib") | |
3016f1f2 | 527 | (string-append lib "/lib"))))))))) |
f3130c66 W |
528 | (home-page "https://intelxed.github.io/") |
529 | (synopsis "Encoder and decoder for x86 (IA32 and Intel64) instructions") | |
530 | (description "The Intel X86 Encoder Decoder (XED) is a software library and | |
531 | for encoding and decoding X86 (IA32 and Intel64) instructions. The decoder | |
532 | takes sequences of 1-15 bytes along with machine mode information and produces | |
533 | a data structure describing the opcode, operands, and flags. The encoder takes | |
534 | a similar data structure and produces a sequence of 1 to 15 bytes. Disassembly | |
535 | is essentially a printing pass on the data structure. | |
536 | ||
537 | The library and development files are under the @code{lib} output, with a | |
538 | family of command line utility wrappers in the default output. Each of the cli | |
539 | tools is named like @code{xed*}. Documentation for the cli tools is sparse, so | |
540 | this is a case where ``the code is the documentation.''") | |
541 | (license license:asl2.0))) |