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 gnu)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages admin)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages bison)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages flex)
39 #:use-module (gnu packages gettext)
40 #:use-module (gnu packages image)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages man)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages texinfo)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages xml)
48 #:use-module ((guix utils)
49 #:select (%current-system)))
57 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
58 version "/nasm-" version ".tar.xz"))
61 "1xg8dfr49py15vbwk1rzcjc3zpqydmr49ahlijm56wlgj8zdwjp2"))))
62 (build-system gnu-build-system)
63 (native-inputs `(("perl" ,perl) ;for doc and test target
64 ("texinfo" ,texinfo)))
66 `(#:test-target "test"
68 (modify-phases %standard-phases
69 (add-after 'unpack 'dont-build-ps-pdf-outputs
71 (substitute* "doc/Makefile.in"
72 (("html nasmdoc.txt nasmdoc.pdf")
74 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
77 (add-after 'install 'install-info
79 (invoke "make" "install_doc"))))))
80 (home-page "https://www.nasm.us/")
81 (synopsis "80x86 and x86-64 assembler")
83 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
84 for portability and modularity. It supports a range of object file formats,
85 including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
86 Windows32 and Windows64. It will also output plain binary files. Its syntax
87 is designed to be simple and easy to understand, similar to Intel's but less
88 complex. It supports all currently known x86 architectural extensions, and
89 has strong support for macros.")
90 (license license:bsd-2)))
99 "http://www.tortall.net/projects/yasm/releases/yasm-"
103 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
104 (build-system gnu-build-system)
106 '(#:parallel-tests? #f)) ; Some tests fail
107 ; non-deterministically when run in
110 `(("python" ,python-wrapper)
112 (home-page "http://yasm.tortall.net/")
113 (synopsis "Rewrite of the NASM assembler")
115 "Yasm is a complete rewrite of the NASM assembler.
117 Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
118 and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
119 Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
120 debugging information in STABS, DWARF 2, and CodeView 8 formats.")
121 (license (license:non-copyleft "file://COPYING"
122 "See COPYING in the distribution."))))
124 (define-public lightning
130 (uri (string-append "mirror://gnu/lightning/lightning-"
134 "1jgxbq2cm51dzi3zhz38mmgwdcgs328mfl8iviw8dxn6dn36p1gd"))))
135 (build-system gnu-build-system)
136 (native-inputs `(("zlib" ,zlib)))
137 (synopsis "Library for generating assembly code at runtime")
139 "GNU Lightning is a library that generates assembly language code at
140 run-time. Thus, it is useful in creating Just-In-Time compilers. It
141 abstracts over the target CPU by exposing a standardized RISC instruction set
143 (home-page "https://www.gnu.org/software/lightning/")
144 (license license:gpl3+)))
153 (uri (string-append "https://flatassembler.net/fasm-"
156 (base32 "143zh7x3q0r2kclshh8n5w4i5pw4lh60si7rspvc725xxjpjkvcv"))))
157 (build-system gnu-build-system)
159 `(#:tests? #f ; no tests exist
160 #:strip-binaries? #f ; fasm has no sections
162 (modify-phases %standard-phases
163 (delete 'configure) ; no "configure" script
166 (chdir "source/Linux/")
167 (if (string=? ,(%current-system) "x86_64-linux")
168 ;; Use pre-compiled binaries in top-level directory to build
170 (invoke "../../fasm.x64" "fasm.asm")
171 (invoke "../../fasm" "fasm.asm"))))
174 (let ((out (assoc-ref %outputs "out")))
175 (install-file "fasm" (string-append out "/bin")))
177 (supported-systems '("x86_64-linux" "i686-linux"))
178 (synopsis "Assembler for x86 processors")
180 "@acronym{FASM, the Flat ASseMbler} is an assembler that supports x86 and
181 IA-64 Intel architectures. It does multiple passes to optimize machine code.
182 It has macro abilities and focuses on operating system portability.")
183 (home-page "https://flatassembler.net/")
184 (license license:bsd-2)))
192 (uri (string-append "http://v3.sk/~lkundrak/dev86/Dev86src-"
196 "154dyr2ph4n0kwi8yx0n78j128kw29rk9r9f7s2gddzrdl712jr3"))))
197 (build-system gnu-build-system)
199 `(#:parallel-build? #f ; They use submakes wrong
200 #:make-flags (list "CC=gcc"
201 (string-append "PREFIX="
202 (assoc-ref %outputs "out")))
203 #:system "i686-linux" ; Standalone ld86 had problems otherwise
204 #:tests? #f ; No tests exist
206 (modify-phases %standard-phases
208 (add-before 'install 'mkdir
209 (lambda* (#:key outputs #:allow-other-keys)
210 (let ((out (assoc-ref outputs "out")))
211 (mkdir-p (string-append out "/bin"))
212 (mkdir-p (string-append out "/man/man1"))
214 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
216 (description "This package provides a Intel 8086 (primarily 16-bit)
217 assembler, a C compiler and a linker. The assembler uses Intel syntax
218 (also Intel order of operands).")
219 (home-page "https://github.com/jbruchon/dev86")
220 (supported-systems '("i686-linux" "x86_64-linux"))
221 (license license:gpl2+)))
223 (define-public libjit
224 (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226"))
231 (url "https://git.savannah.gnu.org/r/libjit.git")
233 (file-name (string-append name "-" version "-checkout"))
236 "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd"))))
237 (build-system gnu-build-system)
239 `(("autoconf" ,autoconf)
240 ("automake" ,automake)
243 ("help2man" ,help2man)
244 ("gettext" ,gettext-minimal)
246 ("makeinfo" ,texinfo)
247 ("pkg-config" ,pkg-config)))
248 (home-page "https://www.gnu.org/software/libjit/")
249 (synopsis "Just-In-Time compilation library")
251 "GNU libjit is a library that provides generic Just-In-Time compiler
252 functionality independent of any particular bytecode, language, or
254 (license license:lgpl2.1+))))
263 (url "https://github.com/rednex/rgbds.git")
264 (commit (string-append "v" version))))
265 (file-name (git-file-name name version))
268 "0pzd9ig3ahpgq7jbj82grllxx1v01d620insr2m8h0c6jj25n5hv"))))
269 (build-system gnu-build-system)
272 (modify-phases %standard-phases
276 (with-directory-excursion "test/asm"
277 (invoke "./test.sh"))
278 (with-directory-excursion "test/link"
279 (invoke "./test.sh")))))
280 #:make-flags `("CC=gcc"
281 ,(string-append "PREFIX="
282 (assoc-ref %outputs "out")))))
286 ("pkg-config" ,pkg-config)
287 ("util-linux" ,util-linux)))
289 `(("libpng" ,libpng)))
290 (home-page "https://github.com/rednex/rgbds")
291 (synopsis "Rednex Game Boy Development System")
293 "RGBDS (Rednex Game Boy Development System) is an assembler/linker
294 package for the Game Boy and Game Boy Color. It consists of:
296 @item rgbasm (assembler)
297 @item rgblink (linker)
298 @item rgbfix (checksum/header fixer)
299 @item rgbgfx (PNG-to-Game Boy graphics converter)
301 (license license:expat)))