gnu: mrustc: Clean up.
[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
LC
4;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
5;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
8a66b9aa 6;;; Copyright © 2017, 2018, 2019, 2020 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>
8472bdec
JN
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages assembly)
8273188c 27 #:use-module (guix build-system cmake)
8472bdec
JN
28 #:use-module (guix build-system gnu)
29 #:use-module (guix download)
43675ac7 30 #:use-module (guix git-download)
8472bdec
JN
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
a837997c 33 #:use-module (gnu packages)
43675ac7
AT
34 #:use-module (gnu packages admin)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bison)
b6e08049 38 #:use-module (gnu packages compression)
43675ac7
AT
39 #:use-module (gnu packages flex)
40 #:use-module (gnu packages gettext)
1c006805
JK
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages linux)
43675ac7 43 #:use-module (gnu packages man)
8472bdec 44 #:use-module (gnu packages perl)
43675ac7 45 #:use-module (gnu packages pkg-config)
15a3fffc
LC
46 #:use-module (gnu packages texinfo)
47 #:use-module (gnu packages python)
8273188c 48 #:use-module (gnu packages sphinx)
9a2e4c5d 49 #:use-module (gnu packages xml)
50 #:use-module ((guix utils)
51 #:select (%current-system)))
8472bdec
JN
52
53(define-public nasm
54 (package
55 (name "nasm")
9ded89fd 56 (version "2.14.02")
8472bdec
JN
57 (source (origin
58 (method url-fetch)
59 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
1de52650 60 version "/nasm-" version ".tar.xz"))
8472bdec
JN
61 (sha256
62 (base32
9ded89fd 63 "1xg8dfr49py15vbwk1rzcjc3zpqydmr49ahlijm56wlgj8zdwjp2"))))
8472bdec 64 (build-system gnu-build-system)
a837997c 65 (native-inputs `(("perl" ,perl) ;for doc and test target
8472bdec
JN
66 ("texinfo" ,texinfo)))
67 (arguments
68 `(#:test-target "test"
161fb9be
EF
69 #:phases
70 (modify-phases %standard-phases
71 (add-after 'unpack 'dont-build-ps-pdf-outputs
72 (lambda _
73 (substitute* "doc/Makefile.in"
3f56740d
MB
74 (("html nasmdoc.txt nasmdoc.pdf")
75 "html nasmdoc.txt")
76 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
77 "$(INSTALL_DATA)"))
161fb9be
EF
78 #t))
79 (add-after 'install 'install-info
80 (lambda _
4792cc86 81 (invoke "make" "install_doc"))))))
80459f5a 82 (home-page "https://www.nasm.us/")
8472bdec
JN
83 (synopsis "80x86 and x86-64 assembler")
84 (description
85 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
86for portability and modularity. It supports a range of object file formats,
87including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
88Windows32 and Windows64. It will also output plain binary files. Its syntax
89is designed to be simple and easy to understand, similar to Intel's but less
90complex. It supports all currently known x86 architectural extensions, and
91has strong support for macros.")
1d7fbe09 92 (license license:bsd-2)))
15a3fffc
LC
93
94(define-public yasm
95 (package
96 (name "yasm")
97 (version "1.3.0")
98 (source (origin
99 (method url-fetch)
100 (uri (string-append
101 "http://www.tortall.net/projects/yasm/releases/yasm-"
102 version ".tar.gz"))
103 (sha256
104 (base32
105 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
106 (build-system gnu-build-system)
e9d48bda
CB
107 (arguments
108 '(#:parallel-tests? #f)) ; Some tests fail
109 ; non-deterministically when run in
110 ; parallel
15a3fffc
LC
111 (inputs
112 `(("python" ,python-wrapper)
113 ("xmlto" ,xmlto)))
114 (home-page "http://yasm.tortall.net/")
115 (synopsis "Rewrite of the NASM assembler")
116 (description
117 "Yasm is a complete rewrite of the NASM assembler.
118
119Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
120and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
121Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
122debugging information in STABS, DWARF 2, and CodeView 8 formats.")
123 (license (license:non-copyleft "file://COPYING"
124 "See COPYING in the distribution."))))
c283b22e
AK
125
126(define-public lightning
127 (package
128 (name "lightning")
bae08e22 129 (version "2.1.3")
c283b22e
AK
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "mirror://gnu/lightning/lightning-"
133 version ".tar.gz"))
134 (sha256
135 (base32
bae08e22 136 "1jgxbq2cm51dzi3zhz38mmgwdcgs328mfl8iviw8dxn6dn36p1gd"))))
c283b22e 137 (build-system gnu-build-system)
b6e08049 138 (native-inputs `(("zlib" ,zlib)))
c283b22e
AK
139 (synopsis "Library for generating assembly code at runtime")
140 (description
141 "GNU Lightning is a library that generates assembly language code at
142run-time. Thus, it is useful in creating Just-In-Time compilers. It
143abstracts over the target CPU by exposing a standardized RISC instruction set
144to the clients.")
6fd52309 145 (home-page "https://www.gnu.org/software/lightning/")
da0cef6a 146 (license license:gpl3+)))
9a2e4c5d 147
148(define-public fasm
149 (package
150 (name "fasm")
8a66b9aa 151 (version "1.73.21")
9a2e4c5d 152 (source
153 (origin
154 (method url-fetch)
155 (uri (string-append "https://flatassembler.net/fasm-"
156 version ".tgz"))
157 (sha256
8a66b9aa 158 (base32 "143zh7x3q0r2kclshh8n5w4i5pw4lh60si7rspvc725xxjpjkvcv"))))
9a2e4c5d 159 (build-system gnu-build-system)
160 (arguments
bf38c192
TGR
161 `(#:tests? #f ; no tests exist
162 #:strip-binaries? #f ; fasm has no sections
9a2e4c5d 163 #:phases
164 (modify-phases %standard-phases
bf38c192 165 (delete 'configure) ; no "configure" script
9a2e4c5d 166 (replace 'build
167 (lambda _
9a2e4c5d 168 (chdir "source/Linux/")
169 (if (string=? ,(%current-system) "x86_64-linux")
f73b7bf6
DM
170 ;; Use pre-compiled binaries in top-level directory to build
171 ;; fasm.
9a2e4c5d 172 (invoke "../../fasm.x64" "fasm.asm")
173 (invoke "../../fasm" "fasm.asm"))))
174 (replace 'install
175 (lambda _
176 (let ((out (assoc-ref %outputs "out")))
177 (install-file "fasm" (string-append out "/bin")))
178 #t)))))
9a2e4c5d 179 (supported-systems '("x86_64-linux" "i686-linux"))
180 (synopsis "Assembler for x86 processors")
181 (description
caa66bde
TGR
182 "@acronym{FASM, the Flat ASseMbler} is an assembler that supports x86 and
183IA-64 Intel architectures. It does multiple passes to optimize machine code.
184It has macro abilities and focuses on operating system portability.")
9a2e4c5d 185 (home-page "https://flatassembler.net/")
186 (license license:bsd-2)))
1bde3d2c
DM
187
188(define-public dev86
189 (package
190 (name "dev86")
191 (version "0.16.21")
192 (source (origin
193 (method url-fetch)
194 (uri (string-append "http://v3.sk/~lkundrak/dev86/Dev86src-"
195 version ".tar.gz"))
196 (sha256
197 (base32
198 "154dyr2ph4n0kwi8yx0n78j128kw29rk9r9f7s2gddzrdl712jr3"))))
199 (build-system gnu-build-system)
200 (arguments
201 `(#:parallel-build? #f ; They use submakes wrong
202 #:make-flags (list "CC=gcc"
203 (string-append "PREFIX="
204 (assoc-ref %outputs "out")))
205 #:system "i686-linux" ; Standalone ld86 had problems otherwise
206 #:tests? #f ; No tests exist
207 #:phases
208 (modify-phases %standard-phases
209 (delete 'configure)
210 (add-before 'install 'mkdir
211 (lambda* (#:key outputs #:allow-other-keys)
212 (let ((out (assoc-ref outputs "out")))
213 (mkdir-p (string-append out "/bin"))
214 (mkdir-p (string-append out "/man/man1"))
215 #t))))))
216 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
217linker")
218 (description "This package provides a Intel 8086 (primarily 16-bit)
219assembler, a C compiler and a linker. The assembler uses Intel syntax
220(also Intel order of operands).")
221 (home-page "https://github.com/jbruchon/dev86")
222 (supported-systems '("i686-linux" "x86_64-linux"))
223 (license license:gpl2+)))
43675ac7
AT
224
225(define-public libjit
226 (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226"))
227 (package
228 (name "libjit")
229 (version "0.1.4")
230 (source (origin
231 (method git-fetch)
232 (uri (git-reference
233 (url "https://git.savannah.gnu.org/r/libjit.git")
234 (commit commit)))
235 (file-name (string-append name "-" version "-checkout"))
236 (sha256
237 (base32
238 "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd"))))
239 (build-system gnu-build-system)
240 (native-inputs
241 `(("autoconf" ,autoconf)
242 ("automake" ,automake)
243 ("bison" ,bison)
244 ("flex" ,flex)
245 ("help2man" ,help2man)
246 ("gettext" ,gettext-minimal)
247 ("libtool" ,libtool)
248 ("makeinfo" ,texinfo)
249 ("pkg-config" ,pkg-config)))
250 (home-page "https://www.gnu.org/software/libjit/")
251 (synopsis "Just-In-Time compilation library")
252 (description
253 "GNU libjit is a library that provides generic Just-In-Time compiler
254functionality independent of any particular bytecode, language, or
255runtime")
256 (license license:lgpl2.1+))))
1c006805
JK
257
258(define-public rgbds
259 (package
260 (name "rgbds")
261 (version "0.3.9")
262 (source (origin
263 (method git-fetch)
264 (uri (git-reference
265 (url "https://github.com/rednex/rgbds.git")
266 (commit (string-append "v" version))))
267 (file-name (git-file-name name version))
268 (sha256
269 (base32
270 "0pzd9ig3ahpgq7jbj82grllxx1v01d620insr2m8h0c6jj25n5hv"))))
271 (build-system gnu-build-system)
272 (arguments
273 `(#:phases
274 (modify-phases %standard-phases
275 (delete 'configure)
276 (replace 'check
277 (lambda _
278 (with-directory-excursion "test/asm"
279 (invoke "./test.sh"))
280 (with-directory-excursion "test/link"
281 (invoke "./test.sh")))))
282 #:make-flags `("CC=gcc"
283 ,(string-append "PREFIX="
284 (assoc-ref %outputs "out")))))
285 (native-inputs
286 `(("bison" ,bison)
287 ("flex" ,flex)
288 ("pkg-config" ,pkg-config)
289 ("util-linux" ,util-linux)))
290 (inputs
291 `(("libpng" ,libpng)))
292 (home-page "https://github.com/rednex/rgbds")
293 (synopsis "Rednex Game Boy Development System")
294 (description
295 "RGBDS (Rednex Game Boy Development System) is an assembler/linker
296package for the Game Boy and Game Boy Color. It consists of:
297@itemize @bullet
298@item rgbasm (assembler)
299@item rgblink (linker)
300@item rgbfix (checksum/header fixer)
301@item rgbgfx (PNG-to-Game Boy graphics converter)
302@end itemize")
303 (license license:expat)))
8273188c
JK
304
305(define-public wla-dx
306 (package
307 (name "wla-dx")
308 (version "9.10")
309 (source (origin
310 (method git-fetch)
311 (uri (git-reference
312 (url "https://github.com/vhelin/wla-dx.git")
313 (commit (string-append "v" version))))
314 (file-name (git-file-name name version))
315 (sha256
316 (base32
317 "022isf7s9q5i0j4xj69zpp0lgw8p9n37sn7ii25v68r15zaahk2w"))))
318 (build-system cmake-build-system)
319 (native-inputs
320 `(("sphinx" ,python-sphinx))) ; to generate man pages
321 (arguments
322 `(#:tests? #f)) ; no tests
323 (home-page "https://github.com/vhelin/wla-dx")
324 (synopsis "Assemblers for various processors")
325 (description "WLA DX is a set of tools to assemble assembly files to
326object or library files (@code{wla-ARCH}) and link them together (@code{wlalink}).
327Supported architectures are:
328
329@itemize @bullet
330@item z80
331@item gb (z80-gb)
332@item 6502
333@item 65c02
334@item 6510
335@item 65816
336@item 6800
337@item 6801
338@item 6809
339@item 8008
340@item 8080
341@item huc6280
342@item spc700
343@end itemize")
344 (license license:gpl2)))