gnu: Remove ".git" from "https://github/…/….git".
[jackhill/guix/guix.git] / gnu / packages / assembly.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
3 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
8 ;;; Copyright © 2019 Andy Tai <atai@atai.org>
9 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
10 ;;; Copyright © 2020 Christopher Lemmer Webber <cwebber@dustycloud.org>
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)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages admin)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages flex)
41 #:use-module (gnu packages gettext)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages linux)
44 #:use-module (gnu packages man)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages texinfo)
48 #:use-module (gnu packages python)
49 #:use-module (gnu packages sphinx)
50 #:use-module (gnu packages xml)
51 #:use-module ((guix utils)
52 #:select (%current-system)))
53
54 (define-public nasm
55 (package
56 (name "nasm")
57 (version "2.14.02")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
61 version "/nasm-" version ".tar.xz"))
62 (sha256
63 (base32
64 "1xg8dfr49py15vbwk1rzcjc3zpqydmr49ahlijm56wlgj8zdwjp2"))))
65 (build-system gnu-build-system)
66 (native-inputs `(("perl" ,perl) ;for doc and test target
67 ("texinfo" ,texinfo)))
68 (arguments
69 `(#:test-target "test"
70 #:phases
71 (modify-phases %standard-phases
72 (add-after 'unpack 'dont-build-ps-pdf-outputs
73 (lambda _
74 (substitute* "doc/Makefile.in"
75 (("html nasmdoc.txt nasmdoc.pdf")
76 "html nasmdoc.txt")
77 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
78 "$(INSTALL_DATA)"))
79 #t))
80 (add-after 'install 'install-info
81 (lambda _
82 (invoke "make" "install_doc"))))))
83 (home-page "https://www.nasm.us/")
84 (synopsis "80x86 and x86-64 assembler")
85 (description
86 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
87 for portability and modularity. It supports a range of object file formats,
88 including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
89 Windows32 and Windows64. It will also output plain binary files. Its syntax
90 is designed to be simple and easy to understand, similar to Intel's but less
91 complex. It supports all currently known x86 architectural extensions, and
92 has strong support for macros.")
93 (license license:bsd-2)))
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)
108 (arguments
109 '(#:parallel-tests? #f)) ; Some tests fail
110 ; non-deterministically when run in
111 ; parallel
112 (inputs
113 `(("python" ,python-wrapper)
114 ("xmlto" ,xmlto)))
115 (home-page "https://yasm.tortall.net/")
116 (synopsis "Rewrite of the NASM assembler")
117 (description
118 "Yasm is a complete rewrite of the NASM assembler.
119
120 Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
121 and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
122 Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
123 debugging information in STABS, DWARF 2, and CodeView 8 formats.")
124 (license (license:non-copyleft "file://COPYING"
125 "See COPYING in the distribution."))))
126
127 (define-public lightning
128 (package
129 (name "lightning")
130 (version "2.1.3")
131 (source (origin
132 (method url-fetch)
133 (uri (string-append "mirror://gnu/lightning/lightning-"
134 version ".tar.gz"))
135 (sha256
136 (base32
137 "1jgxbq2cm51dzi3zhz38mmgwdcgs328mfl8iviw8dxn6dn36p1gd"))))
138 (build-system gnu-build-system)
139 (native-inputs `(("zlib" ,zlib)))
140 (synopsis "Library for generating assembly code at runtime")
141 (description
142 "GNU Lightning is a library that generates assembly language code at
143 run-time. Thus, it is useful in creating Just-In-Time compilers. It
144 abstracts over the target CPU by exposing a standardized RISC instruction set
145 to the clients.")
146 (home-page "https://www.gnu.org/software/lightning/")
147 (license license:gpl3+)))
148
149 (define-public fasm
150 (package
151 (name "fasm")
152 (version "1.73.24")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append "https://flatassembler.net/fasm-"
157 version ".tgz"))
158 (sha256
159 (base32 "142vxhs8mh8isvlzq7ir0asmqda410phzxmk9gk9b43dldskkj7k"))))
160 (build-system gnu-build-system)
161 (arguments
162 `(#:tests? #f ; no tests exist
163 #:strip-binaries? #f ; fasm has no sections
164 #:phases
165 (modify-phases %standard-phases
166 (delete 'configure) ; no "configure" script
167 (replace 'build
168 (lambda _
169 (chdir "source/Linux/")
170 (if (string=? ,(%current-system) "x86_64-linux")
171 ;; Use pre-compiled binaries in top-level directory to build
172 ;; fasm.
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)))))
180 (supported-systems '("x86_64-linux" "i686-linux"))
181 (synopsis "Assembler for x86 processors")
182 (description
183 "@acronym{FASM, the Flat ASseMbler} is an assembler that supports x86 and
184 IA-64 Intel architectures. It does multiple passes to optimize machine code.
185 It has macro abilities and focuses on operating system portability.")
186 (home-page "https://flatassembler.net/")
187 (license license:bsd-2)))
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
218 linker")
219 (description "This package provides a Intel 8086 (primarily 16-bit)
220 assembler, 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+)))
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)))
236 (file-name (git-file-name name version))
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
255 functionality independent of any particular bytecode, language, or
256 runtime")
257 (license license:lgpl2.1+))))
258
259 (define-public rgbds
260 (package
261 (name "rgbds")
262 (version "0.4.0")
263 (source (origin
264 (method git-fetch)
265 (uri (git-reference
266 (url "https://github.com/rednex/rgbds")
267 (commit (string-append "v" version))))
268 (file-name (git-file-name name version))
269 (sha256
270 (base32
271 "15680964nlsa83nqgxk7knxajn98lddz2hg6jnn8ffmnms5wdam7"))))
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
297 package 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)))
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
313 (url "https://github.com/vhelin/wla-dx")
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
327 object or library files (@code{wla-ARCH}) and link them together (@code{wlalink}).
328 Supported 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)))
346
347 (define-public xa
348 (package
349 (name "xa")
350 (version "2.3.11")
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
357 "0b81r7mvzqxgnbbmhixcnrf9nc72v1nqaw19k67221g3k561dwij"))))
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.
370 It understands mnemonics and generates code for NMOS 6502s (such
371 as 6502A, 6504, 6507, 6510, 7501, 8500, 8501, 8502 ...),
372 CMOS 6502s (65C02 and Rockwell R65C02) and the 65816.")
373 (license license:gpl2)))
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
383 (url "https://github.com/Kingcom/armips")
384 (commit (string-append "v" version))))
385 (file-name (git-file-name name version))
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,
404 Allegrex and RSP instruction sets, partial support for the EmotionEngine
405 instruction set, as well as complete support for the ARM7 and ARM9 instruction
406 sets, both THUMB and ARM mode.")
407 (license license:expat)))