projects/guix·blob javascript-team · refs

864 lines · 33.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Jan Nieuwenhuizen <[email protected]>
3;;; Copyright © 2013, 2015 Ludovic Courtès <[email protected]>
4;;; Copyright © 2013 Andreas Enge <[email protected]>
5;;; Copyright © 2016, 2020, 2021, 2025, 2026 Efraim Flashner <[email protected]>
6;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2019 Guy Fleury Iteriteka <[email protected]>
8;;; Copyright © 2019, 2022, 2024 Andy Tai <[email protected]>
9;;; Copyright © 2020 Jakub Kądziołka <[email protected]>
10;;; Copyright © 2020 Christine Lemmer-Webber <[email protected]>
11;;; Copyright © 2020 B. Wilson <[email protected]>
12;;; Copyright © 2021, 2024 Maxim Cournoyer <[email protected]>
13;;; Copyright © 2021 Guillaume Le Vaillant <[email protected]>
14;;; Copyright © 2022 Felix Gruber <[email protected]>
15;;; Copyright © 2023 Simon South <[email protected]>
16;;; Copyright © 2023 B. Wilson <[email protected]>
17;;; Copyright © 2024 Zheng Junjie <[email protected]>
18;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
19;;;
20;;; This file is part of GNU Guix.
21;;;
22;;; GNU Guix is free software; you can redistribute it and/or modify it
23;;; under the terms of the GNU General Public License as published by
24;;; the Free Software Foundation; either version 3 of the License, or (at
25;;; your option) any later version.
26;;;
27;;; GNU Guix is distributed in the hope that it will be useful, but
28;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30;;; GNU General Public License for more details.
31;;;
32;;; You should have received a copy of the GNU General Public License
33;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35(define-module (gnu packages assembly)
36 #:use-module (guix build-system meson)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu)
39 #:use-module ((guix build utils) #:select (parallel-job-count))
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix svn-download)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix gexp)
46 #:use-module (guix utils)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages admin)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages compiler-tools)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages image)
56 #:use-module (gnu packages linux)
57 #:use-module (gnu packages man)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages pkg-config)
60 #:use-module (gnu packages texinfo)
61 #:use-module (gnu packages python)
62 #:use-module (gnu packages sphinx)
63 #:use-module (gnu packages shells)
64 #:use-module (gnu packages tex)
65 #:use-module (gnu packages xml)
66 #:use-module ((guix utils)
67 #:select (%current-system cc-for-target)))
68
69(define-public acme
70 (package
71 (name "acme")
72 (version "0.97")
73 (source
74 (origin
75 (method svn-fetch)
76 (uri (svn-reference
77 (url "https://svn.code.sf.net/p/acme-crossass/code-0/trunk/")
78 (revision 274)))
79 (file-name (git-file-name name version))
80 (sha256
81 (base32 "1d0nh06vxxfgb6ki8c8l3j2735kdppkd1c0s3mv03pv58wivwngp"))
82 (modules '((guix build utils)))
83 ;; Public domain and no source code.
84 (snippet '(delete-file-recursively "ACME_Lib"))))
85 (build-system gnu-build-system)
86 (arguments
87 (list #:tests? #f ;Released version has no tests.
88 #:make-flags
89 #~(list (string-append "BINDIR=" #$output "/bin")
90 "-C" "src")
91 #:phases
92 #~(modify-phases %standard-phases
93 ;; No configure script.
94 (delete 'configure))))
95 (home-page "https://acme-crossass.sourceforge.io/")
96 (synopsis "Cross assembler for the 6502, 6510, 65c02 and 65816 processors")
97 (description
98 "ACME is a 6502, 6510, 65c02 and 65816 cross assembler that supports
99global/local/anonymous labels, offset assembly, conditional assembly and looping
100assembly. It can include other source files as well as binaries while
101assembling. Calculations can be done in integer or float mode.")
102 (license license:gpl2+)))
103
104(define-public asl
105 (let ((build "267"))
106 (package
107 (name "asl")
108 (version (string-append "1.42-beta-" build))
109 (source
110 (origin
111 (method url-fetch)
112 (uri (string-append
113 "http://john.ccac.rwth-aachen.de:8000/ftp/as/source/c_version/"
114 "asl-current-142-bld" build ".tar.bz2"))
115 (sha256
116 (base32 "13j2ccfgji4jiqbbqmcchhcps11ypz8aq8fq9vd83ngbhavh6c9s"))))
117 (build-system gnu-build-system)
118 (arguments
119 (list
120 #:make-flags #~(list "V=1") ; ensures output during "check" phase
121 #:phases
122 #~(modify-phases %standard-phases
123 (delete 'bootstrap)
124 (replace 'configure
125 (lambda* (#:key target #:allow-other-keys)
126 (copy-file "Makefile.def-samples/Makefile.def-unknown-linux"
127 "Makefile.def")
128
129 ;; Use the cross-compilation tools when cross-compiling.
130 (when #$(%current-target-system)
131 (substitute* "Makefile.def"
132 (("^(TARG_(CC|LD) = ).*" all prefix)
133 (string-append prefix target "-gcc\n"))))
134
135 ;; Set the output directories appropriately.
136 (substitute* "Makefile.def"
137 (("^(DOCDIR = ).*" all prefix)
138 (string-append prefix #$output:doc "/share/doc/" #$name))
139 (("/usr/local")
140 #$output))))
141 (add-after 'check 'build-doc
142 (lambda* (#:key parallel-build? #:allow-other-keys)
143 ;; Generating font shapes require a writable TEXMFVAR.
144 (setenv "TEXMFVAR" "/tmp")
145 (invoke "make"
146 "-j" (if parallel-build?
147 (number->string (parallel-job-count))
148 "1")
149 "docs"))))
150 #:test-target "test"))
151 (native-inputs
152 (list (texlive-local-tree (list texlive-german texlive-hyperref))))
153 (outputs '("out" "doc"))
154 (home-page "http://john.ccac.rwth-aachen.de:8000/as/")
155 (synopsis
156 "AS macro cross-assembler for microprocessors and microcontrollers")
157 (description
158 "AS is a portable macro cross-assembler targeting a wide range of
159microprocessors and microcontrollers, including devices from Intel, Motorola,
160MOS Technology, Hitachi, Fujitsu, NEC, Texas Instruments, Zilog and many other
161manufacturers.")
162 (license (list license:gpl2 license:gpl3)))))
163
164(define-public asm6f
165 (package
166 (name "asm6f")
167 (version "1.6_freem02")
168 (source (origin
169 (method git-fetch)
170 (uri (git-reference
171 (url "https://github.com/freem/asm6f")
172 (commit (string-append "v" version))))
173 (file-name (git-file-name name version))
174 (sha256
175 (base32
176 "1vz2mbnnm71sns0f08qjlg5rsw2kykg2v6bah073hfi6zzkqw52p"))))
177 (build-system gnu-build-system)
178 (arguments
179 (list
180 #:tests? #f ;no substantial test suite
181 #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
182 #:phases
183 #~(modify-phases %standard-phases
184 (delete 'configure) ;no configure phase
185 (replace 'install
186 (lambda _
187 (install-file "asm6f" (string-append #$output "/bin"))))
188 (add-after 'install 'install-readme
189 (lambda _
190 (install-file "readme.txt"
191 (string-append #$output "/share/doc/asm6f/")))))))
192 (home-page "https://github.com/freem/asm6f")
193 (synopsis "ASM6 6502 assembler fork for NES/Famicom")
194 (description "ASM6f is a fork of ASM6, primarily targeted at NES/Famicom
195development.
196@itemize
197@item Support for some illegal/undocumented opcodes
198@item FCEUX-compatible @file{.nl} output files
199@item Output of Lua-compatible symbol files
200@item New @code{IGNORENL} and @code{ENDINL} directives
201@item Support for iNES original and 2.0 header insertion
202@item Output of @file{.cdl} files, for use with FCEUX/Mesen
203@item Output of Mesen-compatible symbol files (both old and new formats)
204@item Generic +/- labels do not break @@local scope
205@item Support for @code{a:} prefix to force absolute addressing for
206zero-page addresses.
207@end itemize")
208 ;; The license text reads: "This is free software. You may use, modify,
209 ;; and / or redistribute any part of this software in any fashion."
210 (license (license:non-copyleft "LICENSE.txt"))))
211
212(define-public avra
213 (package
214 (name "avra")
215 (version "1.4.2")
216 (source
217 (origin
218 (method git-fetch)
219 (uri (git-reference
220 (url "https://github.com/Ro5bert/avra")
221 (commit version)))
222 (file-name (git-file-name name version))
223 (sha256
224 (base32 "09h8lw7z9xl6vpsnsdvxf1rcx5wg8xaw7dfbgnwjixcrsprs70wf"))))
225 (build-system gnu-build-system)
226 (arguments
227 (list
228 #:make-flags
229 #~(list (string-append "PREFIX=" #$output)
230 (string-append "CC=" #$(cc-for-target)))
231 #:phases
232 #~(modify-phases %standard-phases
233 (delete 'configure))))
234 (home-page "https://github.com/Ro5bert/avra")
235 (synopsis "Atmel AVR (Arduino) assembler")
236 (description
237 "AVRA is an assembler targeting the Atmel AVR family of microcontrollers,
238best known for their use on the Arduino family of single-board microcontroller
239kits. It is near-compatible with Atmel's own assembler, AVRASM32.")
240 (license license:gpl2+)))
241
242(define-public nasm
243 (package
244 (name "nasm")
245 (version "2.16.03")
246 (source
247 (origin
248 (method url-fetch)
249 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
250 version "/nasm-" version ".tar.xz"))
251 (sha256
252 (base32 "0j31c6md9iiwyyvdsg56s0f67mpzg9jx3h5n4sq5vl5vc33s24hl"))))
253 (build-system gnu-build-system)
254 (arguments
255 (list
256 #:test-target "test"
257 #:phases
258 #~(modify-phases %standard-phases
259 (add-after 'unpack 'dont-build-ps-pdf-outputs
260 (lambda _
261 (substitute* "doc/Makefile.in"
262 (("(html nasmdoc.txt) nasmdoc.pdf \\$\\(XZFILES\\)" all keep)
263 keep)
264 (("(\\$\\(INSTALL_DATA\\)) nasmdoc.pdf" all keep)
265 keep))))
266 (add-after 'install 'install-info
267 (lambda _
268 (invoke "make" "install_doc"))))))
269 (native-inputs (list perl ;for doc and test targets.
270 texinfo))
271 (home-page "https://www.nasm.us/")
272 (synopsis "80x86 and x86-64 assembler")
273 (description
274 "@acronym{NASM,Netwide ASseMbler} is an 80x86 and x86-64 assembler
275designed for portability and modularity. It supports a range of object file
276formats, including:
277
278@itemize
279@item Linux and *BSD a.out;
280@item ELF;
281@item COFF;
282@item Mach-O;
283@item Microsoft 16-bit;
284@item plain binary files.
285@end itemize
286
287Its syntax is designed to be simple and easy to understand, similar to Intel's
288but less complex. It supports all currently known x86 architectural
289extensions, and has strong support for macros.")
290 (license license:bsd-2)))
291
292(define* (maybe-nasm #:optional
293 (system (or (%current-target-system)
294 (%current-system))))
295 ;; For some packages nasm is only needed when compiling to/for x86/x86_64.
296 (if (target-x86? system)
297 (list nasm)
298 '()))
299
300(export maybe-nasm)
301
302(define-public yasm
303 (package
304 (name "yasm")
305 (version "1.3.0")
306 (source (origin
307 (method url-fetch)
308 (uri (string-append
309 "http://www.tortall.net/projects/yasm/releases/yasm-"
310 version ".tar.gz"))
311 (sha256
312 (base32
313 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
314 (build-system gnu-build-system)
315 (arguments
316 '(#:parallel-tests? #f)) ; Some tests fail
317 ; non-deterministically when run in
318 ; parallel
319 (inputs (list python-wrapper xmlto))
320 (home-page "https://yasm.tortall.net/")
321 (synopsis "Rewrite of the NASM assembler")
322 (description
323 "Yasm is a complete rewrite of the NASM assembler.
324
325Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
326and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
327Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
328debugging information in STABS, DWARF 2, and CodeView 8 formats.")
329 (license (license:non-copyleft "file://COPYING"
330 "See COPYING in the distribution."))))
331
332(define-public lightning
333 (package
334 (name "lightning")
335 (version "2.2.3")
336 (source (origin
337 (method url-fetch)
338 (uri (string-append "mirror://gnu/lightning/lightning-"
339 version ".tar.gz"))
340 (sha256
341 (base32
342 "0ab89k0xn1mdgabrbfk2993jx6835i8glrhhn7zgpbq07aiwfif0"))))
343 (build-system gnu-build-system)
344 (native-inputs (list zlib))
345 (arguments
346 `(#:configure-flags
347 (list "--disable-static")
348 ;; Some tests fail when run in parallel.
349 #:parallel-tests? #f))
350 (synopsis "Library for generating assembly code at runtime")
351 (description
352 "GNU Lightning is a library that generates assembly language code at
353run-time. Thus, it is useful in creating Just-In-Time compilers. It
354abstracts over the target CPU by exposing a standardized RISC instruction set
355to the clients.")
356 (home-page "https://www.gnu.org/software/lightning/")
357 (license license:gpl3+)))
358
359(define-public simde
360 (package
361 (name "simde")
362 (version "0.8.2")
363 (source
364 (origin
365 (method git-fetch)
366 (uri (git-reference
367 (url "https://github.com/simd-everywhere/simde")
368 (commit (string-append "v" version))))
369 (file-name (git-file-name name version))
370 (sha256
371 (base32 "0giijq5n3q1nv8c5skfq2dar70rgbsm7yk0gdj22wpsa58fc624a"))))
372 (build-system meson-build-system)
373 ;; We really want this for the headers, and the tests require a bundled library.
374 (arguments '(#:configure-flags '("-Dtests=false")))
375 (synopsis "Implementations of SIMD instruction sets for foreign systems")
376 (description "The SIMDe header-only library provides fast, portable
377implementations of SIMD intrinsics on hardware which doesn't natively support
378them, such as calling SSE functions on ARM. There is no performance penalty if
379the hardware supports the native implementation (e.g., SSE/AVX runs at full
380speed on x86, NEON on ARM, etc.).")
381 (home-page "https://simd-everywhere.github.io/blog/")
382 (license license:expat)))
383
384(define-public fasm
385 (package
386 (name "fasm")
387 (version "1.73.31")
388 (source
389 (origin
390 (method url-fetch)
391 (uri (string-append "https://flatassembler.net/fasm-"
392 version ".tgz"))
393 (sha256
394 (base32 "1qqg1czr9dr73l4gwrwim85mjs65al7vv8b292jipywimhhwnf4g"))))
395 (build-system gnu-build-system)
396 (arguments
397 `(#:tests? #f ; no tests exist
398 #:strip-binaries? #f ; fasm has no sections
399 #:phases
400 (modify-phases %standard-phases
401 (delete 'configure) ; no "configure" script
402 (replace 'build
403 (lambda _
404 (chdir "source/Linux/")
405 (if (string=? ,(%current-system) "x86_64-linux")
406 ;; Use pre-compiled binaries in top-level directory to build
407 ;; fasm.
408 (invoke "../../fasm.x64" "fasm.asm")
409 (invoke "../../fasm" "fasm.asm"))))
410 (replace 'install
411 (lambda _
412 (let ((out (assoc-ref %outputs "out")))
413 (install-file "fasm" (string-append out "/bin"))))))))
414 (supported-systems '("x86_64-linux" "i686-linux"))
415 (synopsis "Assembler for x86 processors")
416 (description
417 "@acronym{FASM, the Flat ASseMbler} is an assembler that supports x86 and
418IA-64 Intel architectures. It does multiple passes to optimize machine code.
419It has macro abilities and focuses on operating system portability.")
420 (home-page "https://flatassembler.net/")
421 (license license:bsd-2)))
422
423(define-public dev86
424 (package
425 (name "dev86")
426 (version "1.0.1")
427 (source (origin
428 (method git-fetch)
429 (uri (git-reference
430 (url "https://codeberg.org/jbruchon/dev86.git")
431 (commit (string-append "v" version))))
432 (file-name (git-file-name name version))
433 (sha256
434 (base32
435 "1g2zsa1cj6h7n33hjpr9xbvsxihkhya3aa92b1cv8prl4w8svqy5"))))
436 (build-system gnu-build-system)
437 (arguments
438 `(#:parallel-build? #f ; They use submakes wrong
439 #:make-flags (list ,(string-append "CC=" (cc-for-target))
440 ,(string-append "VERSION=" version)
441 (string-append "PREFIX="
442 (assoc-ref %outputs "out")))
443 #:tests? #f ; No tests exist
444 #:phases
445 (modify-phases %standard-phases
446 (delete 'configure))))
447 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
448linker")
449 (description "This package provides a Intel 8086 (primarily 16-bit)
450assembler, a C compiler and a linker. The assembler uses Intel syntax
451(also Intel order of operands).")
452 (home-page "https://codeberg.org/jbruchon/dev86")
453 (license license:gpl2+)))
454
455(define-public libjit
456 (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226"))
457 (package
458 (name "libjit")
459 (version "0.1.4")
460 (source (origin
461 (method git-fetch)
462 (uri (git-reference
463 (url "https://git.savannah.gnu.org/r/libjit.git")
464 (commit commit)))
465 (file-name (git-file-name name version))
466 (sha256
467 (base32
468 "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd"))))
469 (build-system gnu-build-system)
470 (native-inputs
471 (list autoconf
472 automake
473 bison
474 flex
475 help2man
476 gettext-minimal
477 libtool
478 texinfo
479 pkg-config))
480 (home-page "https://www.gnu.org/software/libjit/")
481 (synopsis "Just-In-Time compilation library")
482 (description
483 "GNU libjit is a library that provides generic Just-In-Time compiler
484functionality independent of any particular bytecode, language, or
485runtime")
486 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
487 (license license:lgpl2.1+))))
488
489(define-public rgbds
490 (package
491 (name "rgbds")
492 (version "0.7.0")
493 (source (origin
494 (method git-fetch)
495 (uri (git-reference
496 (url "https://github.com/gbdev/rgbds")
497 (commit (string-append "v" version))))
498 (file-name (git-file-name name version))
499 (sha256
500 (base32
501 "1gy75q0ikx0ki1wsrq97hxj9dw9436fcys2w91ipm90pbhk4ljva"))))
502 (build-system gnu-build-system)
503 (arguments
504 `(#:phases
505 (modify-phases %standard-phases
506 (delete 'configure)
507 (add-after 'unpack 'patch-pkg-config
508 (lambda _
509 (substitute* "Makefile"
510 (("pkg-config")
511 (or (which "pkg-config")
512 (string-append ,(%current-target-system)
513 "-pkg-config"))))))
514 (replace 'check
515 (lambda _
516 (with-directory-excursion "test/asm"
517 (invoke "./test.sh"))
518 (with-directory-excursion "test/link"
519 (invoke "./test.sh")))))
520 #:make-flags `(,(string-append "CC=" ,(cc-for-target))
521 ,(string-append "PREFIX="
522 (assoc-ref %outputs "out")))))
523 (native-inputs
524 (list bison flex pkg-config util-linux))
525 (inputs
526 (list libpng))
527 (home-page "https://github.com/gbdev/rgbds")
528 (synopsis "Rednex Game Boy Development System")
529 (description
530 "RGBDS (Rednex Game Boy Development System) is an assembler/linker
531package for the Game Boy and Game Boy Color. It consists of:
532@itemize @bullet
533@item rgbasm (assembler)
534@item rgblink (linker)
535@item rgbfix (checksum/header fixer)
536@item rgbgfx (PNG-to-Game Boy graphics converter)
537@end itemize")
538 (license license:expat)))
539
540(define-public wla-dx
541 (package
542 (name "wla-dx")
543 (version "10.5")
544 (source (origin
545 (method git-fetch)
546 (uri (git-reference
547 (url "https://github.com/vhelin/wla-dx")
548 (commit (string-append "v" version))))
549 (file-name (git-file-name name version))
550 (sha256
551 (base32
552 "1h6apmhaks4772s2cja34ck488p8yhb3nscbxjw5061ml2046zqq"))))
553 (build-system cmake-build-system)
554 (native-inputs (list python-sphinx)) ; to generate man pages
555 (arguments
556 (list
557 #:phases
558 #~(modify-phases %standard-phases
559 (add-before 'check 'copy-tests-to-build-directory
560 (lambda _
561 (copy-recursively "../source/tests" "tests")))
562 (replace 'check
563 (lambda* (#:key tests? #:allow-other-keys)
564 (let ((sh (which "sh")))
565 (when tests?
566 (invoke sh "../source/run_tests.sh"))))))))
567 (home-page "https://github.com/vhelin/wla-dx")
568 (synopsis "Assemblers for various processors")
569 (description "WLA DX is a set of tools to assemble assembly files to
570object or library files (@code{wla-ARCH}) and link them together (@code{wlalink}).
571Supported architectures are:
572
573@itemize @bullet
574@item z80
575@item gb (z80-gb)
576@item 6502
577@item 65c02
578@item 6510
579@item 65816
580@item 6800
581@item 6801
582@item 6809
583@item 8008
584@item 8080
585@item huc6280
586@item spc700
587@end itemize")
588 (license license:gpl2)))
589
590(define-public xa
591 (package
592 (name "xa")
593 (version "2.4.1")
594 (source (origin
595 (method url-fetch)
596 (uri (string-append "https://www.floodgap.com/retrotech/xa"
597 "/dists/xa-" version ".tar.gz"))
598 (sha256
599 (base32
600 "1hrspv9hxgk2nkbbh24g84hn0rglfwj8p7849zrn9qx869m2mhb3"))))
601 (build-system gnu-build-system)
602 (arguments
603 (list
604 #:test-target "test"
605 #:phases
606 #~(modify-phases %standard-phases
607 (delete 'configure)) ; no "configure" script
608 #:make-flags
609 #~(list (string-append "CC=" #$(cc-for-target))
610 (string-append "LD=" #$(cc-for-target))
611 (string-append "DESTDIR=" #$output)))) ; no $prefix support
612 (native-inputs (list perl))
613 (home-page "https://www.floodgap.com/retrotech/xa/")
614 (synopsis "Two-pass portable cross-assembler")
615 (description
616 "xa is a high-speed, two-pass portable cross-assembler.
617It understands mnemonics and generates code for NMOS 6502s (such
618as 6502A, 6504, 6507, 6510, 7501, 8500, 8501, 8502 ...),
619 CMOS 6502s (65C02 and Rockwell R65C02) and the 65816.")
620 (license license:gpl2)))
621
622(define-public armips
623 (let ((commit "6719edebaae03330ee5441d9b28280672edf00d5")
624 (revision "1"))
625 (package
626 (name "armips")
627 (version "0.11.0")
628 (source
629 (origin
630 (method git-fetch)
631 (uri (git-reference
632 (url "https://github.com/Kingcom/armips")
633 (commit commit)))
634 (file-name (git-file-name name version))
635 (sha256
636 (base32 "1a85h2b3r3hy9hm07v8drvkklp4qfdq3i3zwb3cgk011s0njdfvz"))
637 (modules '((guix build utils)))
638 (snippet
639 #~(begin
640 (substitute* "Core/Types.h"
641 (("#include <string>" all)
642 (string-append all "\n"
643 "#include <string_view>")))))))
644 (build-system cmake-build-system)
645 (arguments
646 `(#:configure-flags '("-DARMIPS_USE_STD_FILESYSTEM=ON")
647 #:phases
648 (modify-phases %standard-phases
649 (replace 'check
650 (lambda* (#:key inputs #:allow-other-keys)
651 (invoke "./armipstests" "../source/Tests")))
652 (replace 'install
653 (lambda* (#:key outputs #:allow-other-keys)
654 (install-file "armips" (string-append (assoc-ref outputs "out")
655 "/bin"))
656 #t)))))
657 (home-page "https://github.com/Kingcom/armips")
658 (synopsis "Assembler for various ARM and MIPS platforms")
659 (description
660 "armips is an assembler with full support for the MIPS R3000, MIPS R4000,
661Allegrex and RSP instruction sets, partial support for the EmotionEngine
662instruction set, as well as complete support for the ARM7 and ARM9 instruction
663sets, both THUMB and ARM mode.")
664 (license license:expat))))
665
666(define-public intel-xed
667 (package
668 (name "intel-xed")
669 (version "2025.03.02")
670 (source
671 (origin
672 (method git-fetch)
673 (uri (git-reference
674 (url "https://github.com/intelxed/xed")
675 (commit (string-append "v" version))))
676 (sha256 (base32 "1h1q1rq96mh0jaqsg5pwmxwrcbpb83i79kblzfqszlq2nn0ih55j"))
677 (file-name (git-file-name name version))))
678 (build-system gnu-build-system)
679 (native-inputs
680 `(("python" ,python-wrapper)
681 ;; As of the time of writing this comment, mbuild does not exist in the
682 ;; Python Package Index and seems to only be used by intel-xed, so we
683 ;; opt to include it here instead of packaging separately. Note also
684 ;; that the git repository contains no version tags, so we directly
685 ;; reference the "version" variable from setup.py instead.
686 ("mbuild"
687 ,(let ((name "mbuild")
688 (version "2022.07.28"))
689 (origin
690 (method git-fetch)
691 (uri (git-reference
692 (url "https://github.com/intelxed/mbuild")
693 (commit (string-append "v" version))))
694 (sha256
695 (base32
696 "0rc9xp202yqw42bwgylwxvfvjr1crdl50qvv8vzfczyvlf4wflcx"))
697 (file-name (git-file-name name version)))))))
698 (outputs '("out" "lib"))
699 (arguments
700 `(#:phases
701 ;; Upstream uses the custom Python build tool `mbuild', so we munge
702 ;; gnu-build-system to fit. The build process for this package is
703 ;; documented at https://intelxed.github.io/build-manual/.
704 (let* ((build-dir "build")
705 (kit-dir "kit"))
706 (modify-phases %standard-phases
707 (delete 'configure)
708 (replace 'build
709 (lambda* (#:key inputs #:allow-other-keys)
710 (let ((mbuild (assoc-ref inputs "mbuild")))
711 (setenv "PYTHONPATH" mbuild)
712 (invoke "./mfile.py"
713 (string-append "--build-dir=" build-dir)
714 (string-append "--install-dir=" kit-dir)
715 "examples"
716 "doc"
717 "install"))))
718 (replace 'check
719 (lambda _
720 ;; Skip broken test group `tests/tests-avx512pf'.
721 (invoke "tests/run-cmd.py"
722 (string-append "--build-dir=" kit-dir "/bin")
723 "--tests" "tests/tests-base"
724 "--tests" "tests/tests-avx512"
725 "--tests" "tests/tests-cet"
726 "--tests" "tests/tests-via"
727 "--tests" "tests/tests-syntax"
728 "--tests" "tests/tests-xop")))
729 (replace 'install
730 (lambda* (#:key outputs #:allow-other-keys)
731 (let* ((out (assoc-ref outputs "out"))
732 (lib (assoc-ref outputs "lib")))
733 (copy-recursively (string-append kit-dir "/bin")
734 (string-append out "/bin"))
735 (copy-recursively (string-append kit-dir "/include")
736 (string-append lib "/include"))
737 (copy-recursively (string-append kit-dir "/lib")
738 (string-append lib "/lib")))))))))
739 (home-page "https://intelxed.github.io/")
740 (synopsis "Encoder and decoder for x86 (IA32 and Intel64) instructions")
741 (description "The Intel X86 Encoder Decoder (XED) is a software library and
742for encoding and decoding X86 (IA32 and Intel64) instructions. The decoder
743takes sequences of 1-15 bytes along with machine mode information and produces
744a data structure describing the opcode, operands, and flags. The encoder takes
745a similar data structure and produces a sequence of 1 to 15 bytes. Disassembly
746is essentially a printing pass on the data structure.
747
748The library and development files are under the @code{lib} output, with a
749family of command line utility wrappers in the default output. Each of the cli
750tools is named like @code{xed*}. Documentation for the cli tools is sparse, so
751this is a case where ``the code is the documentation.''")
752 (license license:asl2.0)))
753
754(define-public neon2sse
755 (let ((commit "097a5ecacd527d5b5c3006e360fb9cb1c1c48a1f")
756 (version "0")
757 (revision "1"))
758 (package
759 (name "neon2sse")
760 (version (git-version version revision commit))
761 (source (origin
762 (method git-fetch)
763 (uri (git-reference
764 (url "https://github.com/intel/ARM_NEON_2_x86_SSE")
765 (commit commit)))
766 (file-name (git-file-name name version))
767 (sha256
768 (base32
769 "17mf788b8asrvjl6dnyzrm5xrz20wx9j5f8n6drgc6qgwqxpx4hv"))))
770 (build-system cmake-build-system)
771 (arguments
772 (list #:tests? #f)) ;no tests
773 (home-page "https://github.com/intel/ARM_NEON_2_x86_SSE")
774 (synopsis "Header file to simplify ARM->IA32 porting")
775 (description
776 "The @file{NEON_2_SSE.h} file is intended to simplify ARM-to-IA32
777porting. It makes the correspondence (or a real porting) of ARM NEON
778intrinsics as defined in the @file{arm_neon.h} header and x86 SSE (up to
779SSE4.2) intrinsic functions as defined in corresponding x86 compilers headers
780files.")
781 (license license:bsd-2))))
782
783(define-public cpu-features
784 (package
785 (name "cpu-features")
786 (version "0.9.0")
787 (source
788 (origin
789 (method git-fetch)
790 (uri (git-reference
791 (url "https://github.com/google/cpu_features")
792 (commit (string-append "v" version))))
793 (sha256
794 (base32 "0297li3408zm1dqnibaasrb51vs7n7iscnxsji3b78g0pir7jwxr"))
795 (file-name (git-file-name name version))))
796 (build-system cmake-build-system)
797 (arguments
798 (list
799 #:tests? #f ;; XXX: insists on using bundled googletest
800 #:configure-flags
801 #~(list "-DBUILD_SHARED_LIBS=ON")))
802 (home-page "https://github.com/google/cpu_features")
803 (synopsis "Cross platform C99 library to get cpu features at runtime")
804 (description
805 "Cpu_features is a cross-platform C library to retrieve CPU features
806(such as available instructions) at runtime, and supports these CPU architectures
807@itemize
808@item x86-64
809@item AArch64
810@item ARM
811@item MIPS
812@item POWER
813@item RISC-V
814@item LoongArch
815@item S390x
816@end itemize")
817 (license license:asl2.0)))
818
819
820(define-public blinkenlights
821 (package
822 (name "blinkenlights")
823 (version "1.1.0")
824 (source (origin
825 (method git-fetch)
826 (uri (git-reference
827 (url "https://github.com/jart/blink")
828 (commit version)))
829 (sha256
830 (base32
831 "0wlp1hqccbh9jl4h0vyv9kqbff4ccls6kgzz62gnsqnfsmz06273"))
832 (file-name (git-file-name name version))))
833 (build-system gnu-build-system)
834 (arguments
835 (list #:tests? #f ;Tests require network access
836 #:phases
837 #~(modify-phases %standard-phases
838 ;; Make build reproducible and -v message somewhat nicer
839 (add-before 'configure 'make-reproducible
840 (lambda _
841 (substitute* "Makefile"
842 (("shell LC_ALL=C TZ=UTC date" date)
843 (string-append date " -d \"@$(SOURCE_DATE_EPOCH)\""))
844 ;; BLINK_COMMITS and BLINK_GITSHA fall back
845 ;; to *_UNKNOWN with a compiler warning.
846 (("^BLINK_COMMITS := .*") "")
847 (("^BLINK_GITSHA := .*") ""))
848 (substitute* '("Makefile" "configure")
849 (("hostname") "echo guix"))))
850 ;; Call ./configure without --enable-fast-install argument, which
851 ;; causes the script to fail with an "unsupported option" error.
852 (replace 'configure
853 (lambda* (#:key inputs outputs #:allow-other-keys)
854 (invoke "./configure"
855 (string-append "CC=" #$(cc-for-target))
856 (string-append "--prefix=" #$output)))))))
857 (native-inputs (list python-wrapper))
858 (home-page "https://justine.lol/blinkenlights/")
859 (synopsis "Emulator for x86_64-linux programs with a text user interface")
860 (description
861 "Blinkenlights is a command-line debugger that focuses on visualizing how
862software changes memory. It can emulate statically-linked i8086 and
863x86_64-pc-linux-gnu programs.")
864 (license license:isc)))