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>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
26 (define-module (gnu packages assembly)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages admin)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
37 #:use-module (gnu packages bison)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages flex)
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages man)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages pkg-config)
46 #:use-module (gnu packages texinfo)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages sphinx)
49 #:use-module (gnu packages xml)
50 #:use-module ((guix utils)
51 #:select (%current-system)))
59 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
60 version "/nasm-" version ".tar.xz"))
63 "1xg8dfr49py15vbwk1rzcjc3zpqydmr49ahlijm56wlgj8zdwjp2"))))
64 (build-system gnu-build-system)
65 (native-inputs `(("perl" ,perl) ;for doc and test target
66 ("texinfo" ,texinfo)))
68 `(#:test-target "test"
70 (modify-phases %standard-phases
71 (add-after 'unpack 'dont-build-ps-pdf-outputs
73 (substitute* "doc/Makefile.in"
74 (("html nasmdoc.txt nasmdoc.pdf")
76 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
79 (add-after 'install 'install-info
81 (invoke "make" "install_doc"))))))
82 (home-page "https://www.nasm.us/")
83 (synopsis "80x86 and x86-64 assembler")
85 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
86 for portability and modularity. It supports a range of object file formats,
87 including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
88 Windows32 and Windows64. It will also output plain binary files. Its syntax
89 is designed to be simple and easy to understand, similar to Intel's but less
90 complex. It supports all currently known x86 architectural extensions, and
91 has strong support for macros.")
92 (license license:bsd-2)))
101 "http://www.tortall.net/projects/yasm/releases/yasm-"
105 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
106 (build-system gnu-build-system)
108 '(#:parallel-tests? #f)) ; Some tests fail
109 ; non-deterministically when run in
112 `(("python" ,python-wrapper)
114 (home-page "http://yasm.tortall.net/")
115 (synopsis "Rewrite of the NASM assembler")
117 "Yasm is a complete rewrite of the NASM assembler.
119 Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
120 and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
121 Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
122 debugging information in STABS, DWARF 2, and CodeView 8 formats.")
123 (license (license:non-copyleft "file://COPYING"
124 "See COPYING in the distribution."))))
126 (define-public lightning
132 (uri (string-append "mirror://gnu/lightning/lightning-"
136 "1jgxbq2cm51dzi3zhz38mmgwdcgs328mfl8iviw8dxn6dn36p1gd"))))
137 (build-system gnu-build-system)
138 (native-inputs `(("zlib" ,zlib)))
139 (synopsis "Library for generating assembly code at runtime")
141 "GNU Lightning is a library that generates assembly language code at
142 run-time. Thus, it is useful in creating Just-In-Time compilers. It
143 abstracts over the target CPU by exposing a standardized RISC instruction set
145 (home-page "https://www.gnu.org/software/lightning/")
146 (license license:gpl3+)))
155 (uri (string-append "https://flatassembler.net/fasm-"
158 (base32 "143zh7x3q0r2kclshh8n5w4i5pw4lh60si7rspvc725xxjpjkvcv"))))
159 (build-system gnu-build-system)
161 `(#:tests? #f ; no tests exist
162 #:strip-binaries? #f ; fasm has no sections
164 (modify-phases %standard-phases
165 (delete 'configure) ; no "configure" script
168 (chdir "source/Linux/")
169 (if (string=? ,(%current-system) "x86_64-linux")
170 ;; Use pre-compiled binaries in top-level directory to build
172 (invoke "../../fasm.x64" "fasm.asm")
173 (invoke "../../fasm" "fasm.asm"))))
176 (let ((out (assoc-ref %outputs "out")))
177 (install-file "fasm" (string-append out "/bin")))
179 (supported-systems '("x86_64-linux" "i686-linux"))
180 (synopsis "Assembler for x86 processors")
182 "@acronym{FASM, the Flat ASseMbler} is an assembler that supports x86 and
183 IA-64 Intel architectures. It does multiple passes to optimize machine code.
184 It has macro abilities and focuses on operating system portability.")
185 (home-page "https://flatassembler.net/")
186 (license license:bsd-2)))
194 (uri (string-append "http://v3.sk/~lkundrak/dev86/Dev86src-"
198 "154dyr2ph4n0kwi8yx0n78j128kw29rk9r9f7s2gddzrdl712jr3"))))
199 (build-system gnu-build-system)
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
208 (modify-phases %standard-phases
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"))
216 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
218 (description "This package provides a Intel 8086 (primarily 16-bit)
219 assembler, 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+)))
225 (define-public libjit
226 (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226"))
233 (url "https://git.savannah.gnu.org/r/libjit.git")
235 (file-name (string-append name "-" version "-checkout"))
238 "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd"))))
239 (build-system gnu-build-system)
241 `(("autoconf" ,autoconf)
242 ("automake" ,automake)
245 ("help2man" ,help2man)
246 ("gettext" ,gettext-minimal)
248 ("makeinfo" ,texinfo)
249 ("pkg-config" ,pkg-config)))
250 (home-page "https://www.gnu.org/software/libjit/")
251 (synopsis "Just-In-Time compilation library")
253 "GNU libjit is a library that provides generic Just-In-Time compiler
254 functionality independent of any particular bytecode, language, or
256 (license license:lgpl2.1+))))
265 (url "https://github.com/rednex/rgbds.git")
266 (commit (string-append "v" version))))
267 (file-name (git-file-name name version))
270 "0pzd9ig3ahpgq7jbj82grllxx1v01d620insr2m8h0c6jj25n5hv"))))
271 (build-system gnu-build-system)
274 (modify-phases %standard-phases
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")))))
288 ("pkg-config" ,pkg-config)
289 ("util-linux" ,util-linux)))
291 `(("libpng" ,libpng)))
292 (home-page "https://github.com/rednex/rgbds")
293 (synopsis "Rednex Game Boy Development System")
295 "RGBDS (Rednex Game Boy Development System) is an assembler/linker
296 package for the Game Boy and Game Boy Color. It consists of:
298 @item rgbasm (assembler)
299 @item rgblink (linker)
300 @item rgbfix (checksum/header fixer)
301 @item rgbgfx (PNG-to-Game Boy graphics converter)
303 (license license:expat)))
305 (define-public wla-dx
312 (url "https://github.com/vhelin/wla-dx.git")
313 (commit (string-append "v" version))))
314 (file-name (git-file-name name version))
317 "022isf7s9q5i0j4xj69zpp0lgw8p9n37sn7ii25v68r15zaahk2w"))))
318 (build-system cmake-build-system)
320 `(("sphinx" ,python-sphinx))) ; to generate man pages
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
326 object or library files (@code{wla-ARCH}) and link them together (@code{wlalink}).
327 Supported architectures are:
344 (license license:gpl2)))