projects/guix·blob ruby-team · refs

824 lines · 32.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 nasm
213 (package
214 (name "nasm")
215 (version "2.15.05")
216 (source (origin
217 (method url-fetch)
218 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
219 version "/nasm-" version ".tar.xz"))
220 (sha256
221 (base32
222 "0gqand86b0r86k3h46dh560lykxmxqqywz5m55kgjfq7q4lngbrw"))))
223 (build-system gnu-build-system)
224 (native-inputs (list perl ;for doc and test target
225 texinfo))
226 (arguments
227 `(#:test-target "test"
228 #:phases
229 (modify-phases %standard-phases
230 (add-after 'unpack 'dont-build-ps-pdf-outputs
231 (lambda _
232 (substitute* "doc/Makefile.in"
233 (("html nasmdoc.txt nasmdoc.pdf \\$\\(XZFILES\\)")
234 "html nasmdoc.txt")
235 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
236 "$(INSTALL_DATA)"))))
237 (add-after 'install 'install-info
238 (lambda _
239 (invoke "make" "install_doc"))))))
240 (home-page "https://www.nasm.us/")
241 (synopsis "80x86 and x86-64 assembler")
242 (description
243 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
244for portability and modularity. It supports a range of object file formats,
245including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
246Windows32 and Windows64. It will also output plain binary files. Its syntax
247is designed to be simple and easy to understand, similar to Intel's but less
248complex. It supports all currently known x86 architectural extensions, and
249has strong support for macros.")
250 (license license:bsd-2)))
251
252(define* (maybe-nasm #:optional
253 (system (or (%current-target-system)
254 (%current-system))))
255 ;; For some packages nasm is only needed when compiling to/for x86/x86_64.
256 (if (target-x86? system)
257 (list nasm)
258 '()))
259
260(export maybe-nasm)
261
262(define-public yasm
263 (package
264 (name "yasm")
265 (version "1.3.0")
266 (source (origin
267 (method url-fetch)
268 (uri (string-append
269 "http://www.tortall.net/projects/yasm/releases/yasm-"
270 version ".tar.gz"))
271 (sha256
272 (base32
273 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
274 (build-system gnu-build-system)
275 (arguments
276 '(#:parallel-tests? #f)) ; Some tests fail
277 ; non-deterministically when run in
278 ; parallel
279 (inputs (list python-wrapper xmlto))
280 (home-page "https://yasm.tortall.net/")
281 (synopsis "Rewrite of the NASM assembler")
282 (description
283 "Yasm is a complete rewrite of the NASM assembler.
284
285Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
286and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
287Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
288debugging information in STABS, DWARF 2, and CodeView 8 formats.")
289 (license (license:non-copyleft "file://COPYING"
290 "See COPYING in the distribution."))))
291
292(define-public lightning
293 (package
294 (name "lightning")
295 (version "2.2.3")
296 (source (origin
297 (method url-fetch)
298 (uri (string-append "mirror://gnu/lightning/lightning-"
299 version ".tar.gz"))
300 (sha256
301 (base32
302 "0ab89k0xn1mdgabrbfk2993jx6835i8glrhhn7zgpbq07aiwfif0"))))
303 (build-system gnu-build-system)
304 (native-inputs (list zlib))
305 (arguments
306 `(#:configure-flags
307 (list "--disable-static")
308 ;; Some tests fail when run in parallel.
309 #:parallel-tests? #f))
310 (synopsis "Library for generating assembly code at runtime")
311 (description
312 "GNU Lightning is a library that generates assembly language code at
313run-time. Thus, it is useful in creating Just-In-Time compilers. It
314abstracts over the target CPU by exposing a standardized RISC instruction set
315to the clients.")
316 (home-page "https://www.gnu.org/software/lightning/")
317 (license license:gpl3+)))
318
319(define-public simde
320 (package
321 (name "simde")
322 (version "0.8.2")
323 (source
324 (origin
325 (method git-fetch)
326 (uri (git-reference
327 (url "https://github.com/simd-everywhere/simde")
328 (commit (string-append "v" version))))
329 (file-name (git-file-name name version))
330 (sha256
331 (base32 "0giijq5n3q1nv8c5skfq2dar70rgbsm7yk0gdj22wpsa58fc624a"))))
332 (build-system meson-build-system)
333 ;; We really want this for the headers, and the tests require a bundled library.
334 (arguments '(#:configure-flags '("-Dtests=false")))
335 (synopsis "Implementations of SIMD instruction sets for foreign systems")
336 (description "The SIMDe header-only library provides fast, portable
337implementations of SIMD intrinsics on hardware which doesn't natively support
338them, such as calling SSE functions on ARM. There is no performance penalty if
339the hardware supports the native implementation (e.g., SSE/AVX runs at full
340speed on x86, NEON on ARM, etc.).")
341 (home-page "https://simd-everywhere.github.io/blog/")
342 (license license:expat)))
343
344(define-public fasm
345 (package
346 (name "fasm")
347 (version "1.73.31")
348 (source
349 (origin
350 (method url-fetch)
351 (uri (string-append "https://flatassembler.net/fasm-"
352 version ".tgz"))
353 (sha256
354 (base32 "1qqg1czr9dr73l4gwrwim85mjs65al7vv8b292jipywimhhwnf4g"))))
355 (build-system gnu-build-system)
356 (arguments
357 `(#:tests? #f ; no tests exist
358 #:strip-binaries? #f ; fasm has no sections
359 #:phases
360 (modify-phases %standard-phases
361 (delete 'configure) ; no "configure" script
362 (replace 'build
363 (lambda _
364 (chdir "source/Linux/")
365 (if (string=? ,(%current-system) "x86_64-linux")
366 ;; Use pre-compiled binaries in top-level directory to build
367 ;; fasm.
368 (invoke "../../fasm.x64" "fasm.asm")
369 (invoke "../../fasm" "fasm.asm"))))
370 (replace 'install
371 (lambda _
372 (let ((out (assoc-ref %outputs "out")))
373 (install-file "fasm" (string-append out "/bin"))))))))
374 (supported-systems '("x86_64-linux" "i686-linux"))
375 (synopsis "Assembler for x86 processors")
376 (description
377 "@acronym{FASM, the Flat ASseMbler} is an assembler that supports x86 and
378IA-64 Intel architectures. It does multiple passes to optimize machine code.
379It has macro abilities and focuses on operating system portability.")
380 (home-page "https://flatassembler.net/")
381 (license license:bsd-2)))
382
383(define-public dev86
384 (package
385 (name "dev86")
386 (version "1.0.1")
387 (source (origin
388 (method git-fetch)
389 (uri (git-reference
390 (url "https://codeberg.org/jbruchon/dev86.git")
391 (commit (string-append "v" version))))
392 (file-name (git-file-name name version))
393 (sha256
394 (base32
395 "1g2zsa1cj6h7n33hjpr9xbvsxihkhya3aa92b1cv8prl4w8svqy5"))))
396 (build-system gnu-build-system)
397 (arguments
398 `(#:parallel-build? #f ; They use submakes wrong
399 #:make-flags (list ,(string-append "CC=" (cc-for-target))
400 ,(string-append "VERSION=" version)
401 (string-append "PREFIX="
402 (assoc-ref %outputs "out")))
403 #:tests? #f ; No tests exist
404 #:phases
405 (modify-phases %standard-phases
406 (delete 'configure))))
407 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
408linker")
409 (description "This package provides a Intel 8086 (primarily 16-bit)
410assembler, a C compiler and a linker. The assembler uses Intel syntax
411(also Intel order of operands).")
412 (home-page "https://codeberg.org/jbruchon/dev86")
413 (license license:gpl2+)))
414
415(define-public libjit
416 (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226"))
417 (package
418 (name "libjit")
419 (version "0.1.4")
420 (source (origin
421 (method git-fetch)
422 (uri (git-reference
423 (url "https://git.savannah.gnu.org/r/libjit.git")
424 (commit commit)))
425 (file-name (git-file-name name version))
426 (sha256
427 (base32
428 "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd"))))
429 (build-system gnu-build-system)
430 (native-inputs
431 (list autoconf
432 automake
433 bison
434 flex
435 help2man
436 gettext-minimal
437 libtool
438 texinfo
439 pkg-config))
440 (home-page "https://www.gnu.org/software/libjit/")
441 (synopsis "Just-In-Time compilation library")
442 (description
443 "GNU libjit is a library that provides generic Just-In-Time compiler
444functionality independent of any particular bytecode, language, or
445runtime")
446 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
447 (license license:lgpl2.1+))))
448
449(define-public rgbds
450 (package
451 (name "rgbds")
452 (version "0.7.0")
453 (source (origin
454 (method git-fetch)
455 (uri (git-reference
456 (url "https://github.com/gbdev/rgbds")
457 (commit (string-append "v" version))))
458 (file-name (git-file-name name version))
459 (sha256
460 (base32
461 "1gy75q0ikx0ki1wsrq97hxj9dw9436fcys2w91ipm90pbhk4ljva"))))
462 (build-system gnu-build-system)
463 (arguments
464 `(#:phases
465 (modify-phases %standard-phases
466 (delete 'configure)
467 (add-after 'unpack 'patch-pkg-config
468 (lambda _
469 (substitute* "Makefile"
470 (("pkg-config")
471 (or (which "pkg-config")
472 (string-append ,(%current-target-system)
473 "-pkg-config"))))))
474 (replace 'check
475 (lambda _
476 (with-directory-excursion "test/asm"
477 (invoke "./test.sh"))
478 (with-directory-excursion "test/link"
479 (invoke "./test.sh")))))
480 #:make-flags `(,(string-append "CC=" ,(cc-for-target))
481 ,(string-append "PREFIX="
482 (assoc-ref %outputs "out")))))
483 (native-inputs
484 (list bison flex pkg-config util-linux))
485 (inputs
486 (list libpng))
487 (home-page "https://github.com/gbdev/rgbds")
488 (synopsis "Rednex Game Boy Development System")
489 (description
490 "RGBDS (Rednex Game Boy Development System) is an assembler/linker
491package for the Game Boy and Game Boy Color. It consists of:
492@itemize @bullet
493@item rgbasm (assembler)
494@item rgblink (linker)
495@item rgbfix (checksum/header fixer)
496@item rgbgfx (PNG-to-Game Boy graphics converter)
497@end itemize")
498 (license license:expat)))
499
500(define-public wla-dx
501 (package
502 (name "wla-dx")
503 (version "10.5")
504 (source (origin
505 (method git-fetch)
506 (uri (git-reference
507 (url "https://github.com/vhelin/wla-dx")
508 (commit (string-append "v" version))))
509 (file-name (git-file-name name version))
510 (sha256
511 (base32
512 "1h6apmhaks4772s2cja34ck488p8yhb3nscbxjw5061ml2046zqq"))))
513 (build-system cmake-build-system)
514 (native-inputs (list python-sphinx)) ; to generate man pages
515 (arguments
516 (list
517 #:phases
518 #~(modify-phases %standard-phases
519 (add-before 'check 'copy-tests-to-build-directory
520 (lambda _
521 (copy-recursively "../source/tests" "tests")))
522 (replace 'check
523 (lambda* (#:key tests? #:allow-other-keys)
524 (let ((sh (which "sh")))
525 (when tests?
526 (invoke sh "../source/run_tests.sh"))))))))
527 (home-page "https://github.com/vhelin/wla-dx")
528 (synopsis "Assemblers for various processors")
529 (description "WLA DX is a set of tools to assemble assembly files to
530object or library files (@code{wla-ARCH}) and link them together (@code{wlalink}).
531Supported architectures are:
532
533@itemize @bullet
534@item z80
535@item gb (z80-gb)
536@item 6502
537@item 65c02
538@item 6510
539@item 65816
540@item 6800
541@item 6801
542@item 6809
543@item 8008
544@item 8080
545@item huc6280
546@item spc700
547@end itemize")
548 (license license:gpl2)))
549
550(define-public xa
551 (package
552 (name "xa")
553 (version "2.4.1")
554 (source (origin
555 (method url-fetch)
556 (uri (string-append "https://www.floodgap.com/retrotech/xa"
557 "/dists/xa-" version ".tar.gz"))
558 (sha256
559 (base32
560 "1hrspv9hxgk2nkbbh24g84hn0rglfwj8p7849zrn9qx869m2mhb3"))))
561 (build-system gnu-build-system)
562 (arguments
563 (list
564 #:test-target "test"
565 #:phases
566 #~(modify-phases %standard-phases
567 (delete 'configure)) ; no "configure" script
568 #:make-flags
569 #~(list (string-append "CC=" #$(cc-for-target))
570 (string-append "LD=" #$(cc-for-target))
571 (string-append "DESTDIR=" #$output)))) ; no $prefix support
572 (native-inputs (list perl))
573 (home-page "https://www.floodgap.com/retrotech/xa/")
574 (synopsis "Two-pass portable cross-assembler")
575 (description
576 "xa is a high-speed, two-pass portable cross-assembler.
577It understands mnemonics and generates code for NMOS 6502s (such
578as 6502A, 6504, 6507, 6510, 7501, 8500, 8501, 8502 ...),
579 CMOS 6502s (65C02 and Rockwell R65C02) and the 65816.")
580 (license license:gpl2)))
581
582(define-public armips
583 (let ((commit "6719edebaae03330ee5441d9b28280672edf00d5")
584 (revision "1"))
585 (package
586 (name "armips")
587 (version "0.11.0")
588 (source
589 (origin
590 (method git-fetch)
591 (uri (git-reference
592 (url "https://github.com/Kingcom/armips")
593 (commit commit)))
594 (file-name (git-file-name name version))
595 (sha256
596 (base32 "1a85h2b3r3hy9hm07v8drvkklp4qfdq3i3zwb3cgk011s0njdfvz"))
597 (modules '((guix build utils)))
598 (snippet
599 #~(begin
600 (substitute* "Core/Types.h"
601 (("#include <string>" all)
602 (string-append all "\n"
603 "#include <string_view>")))))))
604 (build-system cmake-build-system)
605 (arguments
606 `(#:configure-flags '("-DARMIPS_USE_STD_FILESYSTEM=ON")
607 #:phases
608 (modify-phases %standard-phases
609 (replace 'check
610 (lambda* (#:key inputs #:allow-other-keys)
611 (invoke "./armipstests" "../source/Tests")))
612 (replace 'install
613 (lambda* (#:key outputs #:allow-other-keys)
614 (install-file "armips" (string-append (assoc-ref outputs "out")
615 "/bin"))
616 #t)))))
617 (home-page "https://github.com/Kingcom/armips")
618 (synopsis "Assembler for various ARM and MIPS platforms")
619 (description
620 "armips is an assembler with full support for the MIPS R3000, MIPS R4000,
621Allegrex and RSP instruction sets, partial support for the EmotionEngine
622instruction set, as well as complete support for the ARM7 and ARM9 instruction
623sets, both THUMB and ARM mode.")
624 (license license:expat))))
625
626(define-public intel-xed
627 (package
628 (name "intel-xed")
629 (version "2025.03.02")
630 (source
631 (origin
632 (method git-fetch)
633 (uri (git-reference
634 (url "https://github.com/intelxed/xed")
635 (commit (string-append "v" version))))
636 (sha256 (base32 "1h1q1rq96mh0jaqsg5pwmxwrcbpb83i79kblzfqszlq2nn0ih55j"))
637 (file-name (git-file-name name version))))
638 (build-system gnu-build-system)
639 (native-inputs
640 `(("python" ,python-wrapper)
641 ;; As of the time of writing this comment, mbuild does not exist in the
642 ;; Python Package Index and seems to only be used by intel-xed, so we
643 ;; opt to include it here instead of packaging separately. Note also
644 ;; that the git repository contains no version tags, so we directly
645 ;; reference the "version" variable from setup.py instead.
646 ("mbuild"
647 ,(let ((name "mbuild")
648 (version "2022.07.28"))
649 (origin
650 (method git-fetch)
651 (uri (git-reference
652 (url "https://github.com/intelxed/mbuild")
653 (commit (string-append "v" version))))
654 (sha256
655 (base32
656 "0rc9xp202yqw42bwgylwxvfvjr1crdl50qvv8vzfczyvlf4wflcx"))
657 (file-name (git-file-name name version)))))))
658 (outputs '("out" "lib"))
659 (arguments
660 `(#:phases
661 ;; Upstream uses the custom Python build tool `mbuild', so we munge
662 ;; gnu-build-system to fit. The build process for this package is
663 ;; documented at https://intelxed.github.io/build-manual/.
664 (let* ((build-dir "build")
665 (kit-dir "kit"))
666 (modify-phases %standard-phases
667 (delete 'configure)
668 (replace 'build
669 (lambda* (#:key inputs #:allow-other-keys)
670 (let ((mbuild (assoc-ref inputs "mbuild")))
671 (setenv "PYTHONPATH" mbuild)
672 (invoke "./mfile.py"
673 (string-append "--build-dir=" build-dir)
674 (string-append "--install-dir=" kit-dir)
675 "examples"
676 "doc"
677 "install"))))
678 (replace 'check
679 (lambda _
680 ;; Skip broken test group `tests/tests-avx512pf'.
681 (invoke "tests/run-cmd.py"
682 (string-append "--build-dir=" kit-dir "/bin")
683 "--tests" "tests/tests-base"
684 "--tests" "tests/tests-avx512"
685 "--tests" "tests/tests-cet"
686 "--tests" "tests/tests-via"
687 "--tests" "tests/tests-syntax"
688 "--tests" "tests/tests-xop")))
689 (replace 'install
690 (lambda* (#:key outputs #:allow-other-keys)
691 (let* ((out (assoc-ref outputs "out"))
692 (lib (assoc-ref outputs "lib")))
693 (copy-recursively (string-append kit-dir "/bin")
694 (string-append out "/bin"))
695 (copy-recursively (string-append kit-dir "/include")
696 (string-append lib "/include"))
697 (copy-recursively (string-append kit-dir "/lib")
698 (string-append lib "/lib")))))))))
699 (home-page "https://intelxed.github.io/")
700 (synopsis "Encoder and decoder for x86 (IA32 and Intel64) instructions")
701 (description "The Intel X86 Encoder Decoder (XED) is a software library and
702for encoding and decoding X86 (IA32 and Intel64) instructions. The decoder
703takes sequences of 1-15 bytes along with machine mode information and produces
704a data structure describing the opcode, operands, and flags. The encoder takes
705a similar data structure and produces a sequence of 1 to 15 bytes. Disassembly
706is essentially a printing pass on the data structure.
707
708The library and development files are under the @code{lib} output, with a
709family of command line utility wrappers in the default output. Each of the cli
710tools is named like @code{xed*}. Documentation for the cli tools is sparse, so
711this is a case where ``the code is the documentation.''")
712 (license license:asl2.0)))
713
714(define-public neon2sse
715 (let ((commit "097a5ecacd527d5b5c3006e360fb9cb1c1c48a1f")
716 (version "0")
717 (revision "1"))
718 (package
719 (name "neon2sse")
720 (version (git-version version revision commit))
721 (source (origin
722 (method git-fetch)
723 (uri (git-reference
724 (url "https://github.com/intel/ARM_NEON_2_x86_SSE")
725 (commit commit)))
726 (file-name (git-file-name name version))
727 (sha256
728 (base32
729 "17mf788b8asrvjl6dnyzrm5xrz20wx9j5f8n6drgc6qgwqxpx4hv"))))
730 (build-system cmake-build-system)
731 (arguments
732 (list #:tests? #f)) ;no tests
733 (home-page "https://github.com/intel/ARM_NEON_2_x86_SSE")
734 (synopsis "Header file to simplify ARM->IA32 porting")
735 (description
736 "The @file{NEON_2_SSE.h} file is intended to simplify ARM-to-IA32
737porting. It makes the correspondence (or a real porting) of ARM NEON
738intrinsics as defined in the @file{arm_neon.h} header and x86 SSE (up to
739SSE4.2) intrinsic functions as defined in corresponding x86 compilers headers
740files.")
741 (license license:bsd-2))))
742
743(define-public cpu-features
744 (package
745 (name "cpu-features")
746 (version "0.9.0")
747 (source
748 (origin
749 (method git-fetch)
750 (uri (git-reference
751 (url "https://github.com/google/cpu_features")
752 (commit (string-append "v" version))))
753 (sha256
754 (base32 "0297li3408zm1dqnibaasrb51vs7n7iscnxsji3b78g0pir7jwxr"))
755 (file-name (git-file-name name version))))
756 (build-system cmake-build-system)
757 (arguments
758 (list
759 #:tests? #f ;; XXX: insists on using bundled googletest
760 #:configure-flags
761 #~(list "-DBUILD_SHARED_LIBS=ON")))
762 (home-page "https://github.com/google/cpu_features")
763 (synopsis "Cross platform C99 library to get cpu features at runtime")
764 (description
765 "Cpu_features is a cross-platform C library to retrieve CPU features
766(such as available instructions) at runtime, and supports these CPU architectures
767@itemize
768@item x86-64
769@item AArch64
770@item ARM
771@item MIPS
772@item POWER
773@item RISC-V
774@item LoongArch
775@item S390x
776@end itemize")
777 (license license:asl2.0)))
778
779
780(define-public blinkenlights
781 (package
782 (name "blinkenlights")
783 (version "1.1.0")
784 (source (origin
785 (method git-fetch)
786 (uri (git-reference
787 (url "https://github.com/jart/blink")
788 (commit version)))
789 (sha256
790 (base32
791 "0wlp1hqccbh9jl4h0vyv9kqbff4ccls6kgzz62gnsqnfsmz06273"))
792 (file-name (git-file-name name version))))
793 (build-system gnu-build-system)
794 (arguments
795 (list #:tests? #f ;Tests require network access
796 #:phases
797 #~(modify-phases %standard-phases
798 ;; Make build reproducible and -v message somewhat nicer
799 (add-before 'configure 'make-reproducible
800 (lambda _
801 (substitute* "Makefile"
802 (("shell LC_ALL=C TZ=UTC date" date)
803 (string-append date " -d \"@$(SOURCE_DATE_EPOCH)\""))
804 ;; BLINK_COMMITS and BLINK_GITSHA fall back
805 ;; to *_UNKNOWN with a compiler warning.
806 (("^BLINK_COMMITS := .*") "")
807 (("^BLINK_GITSHA := .*") ""))
808 (substitute* '("Makefile" "configure")
809 (("hostname") "echo guix"))))
810 ;; Call ./configure without --enable-fast-install argument, which
811 ;; causes the script to fail with an "unsupported option" error.
812 (replace 'configure
813 (lambda* (#:key inputs outputs #:allow-other-keys)
814 (invoke "./configure"
815 (string-append "CC=" #$(cc-for-target))
816 (string-append "--prefix=" #$output)))))))
817 (native-inputs (list python-wrapper))
818 (home-page "https://justine.lol/blinkenlights/")
819 (synopsis "Emulator for x86_64-linux programs with a text user interface")
820 (description
821 "Blinkenlights is a command-line debugger that focuses on visualizing how
822software changes memory. It can emulate statically-linked i8086 and
823x86_64-pc-linux-gnu programs.")
824 (license license:isc)))