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