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 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
8 ;;; Copyright © 2019 Andy Tai <atai@atai.org>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages assembly)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages admin)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages bison)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages man)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages texinfo)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages xml)
45 #:use-module ((guix utils)
46 #:select (%current-system)))
54 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
55 version "/" name "-" version ".tar.xz"))
58 "0wr58pb2wnyihcl6635hlx98fnscx5yirxm8m84x8nxwvjqcybl1"))))
59 (build-system gnu-build-system)
60 (native-inputs `(("perl" ,perl) ;for doc and test target
61 ("texinfo" ,texinfo)))
63 `(#:test-target "test"
65 (modify-phases %standard-phases
66 (add-after 'unpack 'dont-build-ps-pdf-outputs
68 (substitute* "doc/Makefile.in"
69 (("html nasmdoc.txt nasmdoc.pdf")
71 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
74 (add-after 'install 'install-info
76 (invoke "make" "install_doc"))))))
77 (home-page "https://www.nasm.us/")
78 (synopsis "80x86 and x86-64 assembler")
80 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
81 for portability and modularity. It supports a range of object file formats,
82 including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
83 Windows32 and Windows64. It will also output plain binary files. Its syntax
84 is designed to be simple and easy to understand, similar to Intel's but less
85 complex. It supports all currently known x86 architectural extensions, and
86 has strong support for macros.")
87 (license license:bsd-2)))
96 "http://www.tortall.net/projects/yasm/releases/yasm-"
100 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
101 (build-system gnu-build-system)
103 `(("python" ,python-wrapper)
105 (home-page "http://yasm.tortall.net/")
106 (synopsis "Rewrite of the NASM assembler")
108 "Yasm is a complete rewrite of the NASM assembler.
110 Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
111 and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
112 Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
113 debugging information in STABS, DWARF 2, and CodeView 8 formats.")
114 (license (license:non-copyleft "file://COPYING"
115 "See COPYING in the distribution."))))
117 (define-public lightning
123 (uri (string-append "mirror://gnu/lightning/lightning-"
127 "0sbs2lm8b9in2m8d52zf0x9gpp40x6r7sl6sha92yq3pr78rwa4v"))))
128 (build-system gnu-build-system)
129 (native-inputs `(("zlib" ,zlib)))
130 (synopsis "Library for generating assembly code at runtime")
132 "GNU Lightning is a library that generates assembly language code at
133 run-time. Thus, it is useful in creating Just-In-Time compilers. It
134 abstracts over the target CPU by exposing a standardized RISC instruction set
136 (home-page "https://www.gnu.org/software/lightning/")
137 (license license:gpl3+)))
146 (uri (string-append "https://flatassembler.net/fasm-"
149 (base32 "1zhbs72qc8bw5158zh6mvzznfamcx5a1bsmbmq9ci0d7wb58sxmg"))))
150 (build-system gnu-build-system)
152 `(#:tests? #f ; no tests exist
153 #:strip-binaries? #f ; fasm has no sections
155 (modify-phases %standard-phases
156 (delete 'configure) ; no "configure" script
159 (chdir "source/Linux/")
160 (if (string=? ,(%current-system) "x86_64-linux")
161 ;; Use pre-compiled binaries in top-level directory to build
163 (invoke "../../fasm.x64" "fasm.asm")
164 (invoke "../../fasm" "fasm.asm"))))
167 (let ((out (assoc-ref %outputs "out")))
168 (install-file "fasm" (string-append out "/bin")))
170 (supported-systems '("x86_64-linux" "i686-linux"))
171 (synopsis "Assembler for x86 processors")
173 "FASM is an assembler that supports x86 and IA-64 Intel architectures.
174 It does multiple passes to optimize machine code. It has macro abilities and
175 focuses on operating system portability.")
176 (home-page "https://flatassembler.net/")
177 (license license:bsd-2)))
185 (uri (string-append "http://v3.sk/~lkundrak/dev86/Dev86src-"
189 "154dyr2ph4n0kwi8yx0n78j128kw29rk9r9f7s2gddzrdl712jr3"))))
190 (build-system gnu-build-system)
192 `(#:parallel-build? #f ; They use submakes wrong
193 #:make-flags (list "CC=gcc"
194 (string-append "PREFIX="
195 (assoc-ref %outputs "out")))
196 #:system "i686-linux" ; Standalone ld86 had problems otherwise
197 #:tests? #f ; No tests exist
199 (modify-phases %standard-phases
201 (add-before 'install 'mkdir
202 (lambda* (#:key outputs #:allow-other-keys)
203 (let ((out (assoc-ref outputs "out")))
204 (mkdir-p (string-append out "/bin"))
205 (mkdir-p (string-append out "/man/man1"))
207 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
209 (description "This package provides a Intel 8086 (primarily 16-bit)
210 assembler, a C compiler and a linker. The assembler uses Intel syntax
211 (also Intel order of operands).")
212 (home-page "https://github.com/jbruchon/dev86")
213 (supported-systems '("i686-linux" "x86_64-linux"))
214 (license license:gpl2+)))
216 (define-public libjit
217 (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226"))
224 (url "https://git.savannah.gnu.org/r/libjit.git")
226 (file-name (string-append name "-" version "-checkout"))
229 "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd"))))
230 (build-system gnu-build-system)
232 `(("autoconf" ,autoconf)
233 ("automake" ,automake)
236 ("help2man" ,help2man)
237 ("gettext" ,gettext-minimal)
239 ("makeinfo" ,texinfo)
240 ("pkg-config" ,pkg-config)))
241 (home-page "https://www.gnu.org/software/libjit/")
242 (synopsis "Just-In-Time compilation library")
244 "GNU libjit is a library that provides generic Just-In-Time compiler
245 functionality independent of any particular bytecode, language, or
247 (license license:lgpl2.1+))))