gnu: Add m4rie.
[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>
bf38c192 6;;; Copyright © 2017, 2018, 2019 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>
8472bdec
JN
9;;;
10;;; This file is part of GNU Guix.
11;;;
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.
16;;;
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.
21;;;
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/>.
24
25(define-module (gnu packages assembly)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix download)
43675ac7 28 #:use-module (guix git-download)
8472bdec
JN
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages)
a837997c 31 #:use-module (gnu packages)
43675ac7
AT
32 #:use-module (gnu packages admin)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages bison)
b6e08049 36 #:use-module (gnu packages compression)
43675ac7
AT
37 #:use-module (gnu packages flex)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages man)
8472bdec 40 #:use-module (gnu packages perl)
43675ac7 41 #:use-module (gnu packages pkg-config)
15a3fffc
LC
42 #:use-module (gnu packages texinfo)
43 #:use-module (gnu packages python)
9a2e4c5d 44 #:use-module (gnu packages xml)
45 #:use-module ((guix utils)
46 #:select (%current-system)))
8472bdec
JN
47
48(define-public nasm
49 (package
50 (name "nasm")
e51b3145 51 (version "2.13.03")
8472bdec
JN
52 (source (origin
53 (method url-fetch)
54 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
55 version "/" name "-" version ".tar.xz"))
56 (sha256
57 (base32
e51b3145 58 "0wr58pb2wnyihcl6635hlx98fnscx5yirxm8m84x8nxwvjqcybl1"))))
8472bdec 59 (build-system gnu-build-system)
a837997c 60 (native-inputs `(("perl" ,perl) ;for doc and test target
8472bdec
JN
61 ("texinfo" ,texinfo)))
62 (arguments
63 `(#:test-target "test"
161fb9be
EF
64 #:phases
65 (modify-phases %standard-phases
66 (add-after 'unpack 'dont-build-ps-pdf-outputs
67 (lambda _
68 (substitute* "doc/Makefile.in"
3f56740d
MB
69 (("html nasmdoc.txt nasmdoc.pdf")
70 "html nasmdoc.txt")
71 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
72 "$(INSTALL_DATA)"))
161fb9be
EF
73 #t))
74 (add-after 'install 'install-info
75 (lambda _
4792cc86 76 (invoke "make" "install_doc"))))))
80459f5a 77 (home-page "https://www.nasm.us/")
8472bdec
JN
78 (synopsis "80x86 and x86-64 assembler")
79 (description
80 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
81for portability and modularity. It supports a range of object file formats,
82including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
83Windows32 and Windows64. It will also output plain binary files. Its syntax
84is designed to be simple and easy to understand, similar to Intel's but less
85complex. It supports all currently known x86 architectural extensions, and
86has strong support for macros.")
1d7fbe09 87 (license license:bsd-2)))
15a3fffc
LC
88
89(define-public yasm
90 (package
91 (name "yasm")
92 (version "1.3.0")
93 (source (origin
94 (method url-fetch)
95 (uri (string-append
96 "http://www.tortall.net/projects/yasm/releases/yasm-"
97 version ".tar.gz"))
98 (sha256
99 (base32
100 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
101 (build-system gnu-build-system)
102 (inputs
103 `(("python" ,python-wrapper)
104 ("xmlto" ,xmlto)))
105 (home-page "http://yasm.tortall.net/")
106 (synopsis "Rewrite of the NASM assembler")
107 (description
108 "Yasm is a complete rewrite of the NASM assembler.
109
110Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
111and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
112Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
113debugging information in STABS, DWARF 2, and CodeView 8 formats.")
114 (license (license:non-copyleft "file://COPYING"
115 "See COPYING in the distribution."))))
c283b22e
AK
116
117(define-public lightning
118 (package
119 (name "lightning")
5fe56448 120 (version "2.1.2")
c283b22e
AK
121 (source (origin
122 (method url-fetch)
123 (uri (string-append "mirror://gnu/lightning/lightning-"
124 version ".tar.gz"))
125 (sha256
126 (base32
5fe56448 127 "0sbs2lm8b9in2m8d52zf0x9gpp40x6r7sl6sha92yq3pr78rwa4v"))))
c283b22e 128 (build-system gnu-build-system)
b6e08049 129 (native-inputs `(("zlib" ,zlib)))
c283b22e
AK
130 (synopsis "Library for generating assembly code at runtime")
131 (description
132 "GNU Lightning is a library that generates assembly language code at
133run-time. Thus, it is useful in creating Just-In-Time compilers. It
134abstracts over the target CPU by exposing a standardized RISC instruction set
135to the clients.")
6fd52309 136 (home-page "https://www.gnu.org/software/lightning/")
da0cef6a 137 (license license:gpl3+)))
9a2e4c5d 138
139(define-public fasm
140 (package
141 (name "fasm")
d2164944 142 (version "1.73.11")
9a2e4c5d 143 (source
144 (origin
145 (method url-fetch)
146 (uri (string-append "https://flatassembler.net/fasm-"
147 version ".tgz"))
148 (sha256
d2164944 149 (base32 "1zhbs72qc8bw5158zh6mvzznfamcx5a1bsmbmq9ci0d7wb58sxmg"))))
9a2e4c5d 150 (build-system gnu-build-system)
151 (arguments
bf38c192
TGR
152 `(#:tests? #f ; no tests exist
153 #:strip-binaries? #f ; fasm has no sections
9a2e4c5d 154 #:phases
155 (modify-phases %standard-phases
bf38c192 156 (delete 'configure) ; no "configure" script
9a2e4c5d 157 (replace 'build
158 (lambda _
9a2e4c5d 159 (chdir "source/Linux/")
160 (if (string=? ,(%current-system) "x86_64-linux")
f73b7bf6
DM
161 ;; Use pre-compiled binaries in top-level directory to build
162 ;; fasm.
9a2e4c5d 163 (invoke "../../fasm.x64" "fasm.asm")
164 (invoke "../../fasm" "fasm.asm"))))
165 (replace 'install
166 (lambda _
167 (let ((out (assoc-ref %outputs "out")))
168 (install-file "fasm" (string-append out "/bin")))
169 #t)))))
9a2e4c5d 170 (supported-systems '("x86_64-linux" "i686-linux"))
171 (synopsis "Assembler for x86 processors")
172 (description
cb95e79f
DM
173 "FASM is an assembler that supports x86 and IA-64 Intel architectures.
174It does multiple passes to optimize machine code. It has macro abilities and
175focuses on operating system portability.")
9a2e4c5d 176 (home-page "https://flatassembler.net/")
177 (license license:bsd-2)))
1bde3d2c
DM
178
179(define-public dev86
180 (package
181 (name "dev86")
182 (version "0.16.21")
183 (source (origin
184 (method url-fetch)
185 (uri (string-append "http://v3.sk/~lkundrak/dev86/Dev86src-"
186 version ".tar.gz"))
187 (sha256
188 (base32
189 "154dyr2ph4n0kwi8yx0n78j128kw29rk9r9f7s2gddzrdl712jr3"))))
190 (build-system gnu-build-system)
191 (arguments
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
198 #:phases
199 (modify-phases %standard-phases
200 (delete 'configure)
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"))
206 #t))))))
207 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
208linker")
209 (description "This package provides a Intel 8086 (primarily 16-bit)
210assembler, 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+)))
43675ac7
AT
215
216(define-public libjit
217 (let ((commit "554c9f5c750daa6e13a6a5cd416873c81c7b8226"))
218 (package
219 (name "libjit")
220 (version "0.1.4")
221 (source (origin
222 (method git-fetch)
223 (uri (git-reference
224 (url "https://git.savannah.gnu.org/r/libjit.git")
225 (commit commit)))
226 (file-name (string-append name "-" version "-checkout"))
227 (sha256
228 (base32
229 "0p6wklslkkp3s4aisj3w5a53bagqn5fy4m6088ppd4fcfxgqkrcd"))))
230 (build-system gnu-build-system)
231 (native-inputs
232 `(("autoconf" ,autoconf)
233 ("automake" ,automake)
234 ("bison" ,bison)
235 ("flex" ,flex)
236 ("help2man" ,help2man)
237 ("gettext" ,gettext-minimal)
238 ("libtool" ,libtool)
239 ("makeinfo" ,texinfo)
240 ("pkg-config" ,pkg-config)))
241 (home-page "https://www.gnu.org/software/libjit/")
242 (synopsis "Just-In-Time compilation library")
243 (description
244 "GNU libjit is a library that provides generic Just-In-Time compiler
245functionality independent of any particular bytecode, language, or
246runtime")
247 (license license:lgpl2.1+))))