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