gnu: fasm: Update to 1.73.10.
[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 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@gmail.com>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages assembly)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix download)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages texinfo)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages xml)
35 #:use-module ((guix utils)
36 #:select (%current-system)))
37
38 (define-public nasm
39 (package
40 (name "nasm")
41 (version "2.13.03")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append "http://www.nasm.us/pub/nasm/releasebuilds/"
45 version "/" name "-" version ".tar.xz"))
46 (sha256
47 (base32
48 "0wr58pb2wnyihcl6635hlx98fnscx5yirxm8m84x8nxwvjqcybl1"))))
49 (build-system gnu-build-system)
50 (native-inputs `(("perl" ,perl) ;for doc and test target
51 ("texinfo" ,texinfo)))
52 (arguments
53 `(#:test-target "test"
54 #:phases
55 (modify-phases %standard-phases
56 (add-after 'unpack 'dont-build-ps-pdf-outputs
57 (lambda _
58 (substitute* "doc/Makefile.in"
59 (("html nasmdoc.txt nasmdoc.pdf")
60 "html nasmdoc.txt")
61 (("\\$\\(INSTALL_DATA\\) nasmdoc.pdf")
62 "$(INSTALL_DATA)"))
63 #t))
64 (add-after 'install 'install-info
65 (lambda _
66 (invoke "make" "install_doc"))))))
67 (home-page "https://www.nasm.us/")
68 (synopsis "80x86 and x86-64 assembler")
69 (description
70 "NASM, the Netwide Assembler, is an 80x86 and x86-64 assembler designed
71 for portability and modularity. It supports a range of object file formats,
72 including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ,
73 Windows32 and Windows64. It will also output plain binary files. Its syntax
74 is designed to be simple and easy to understand, similar to Intel's but less
75 complex. It supports all currently known x86 architectural extensions, and
76 has strong support for macros.")
77 (license license:bsd-2)))
78
79 (define-public yasm
80 (package
81 (name "yasm")
82 (version "1.3.0")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append
86 "http://www.tortall.net/projects/yasm/releases/yasm-"
87 version ".tar.gz"))
88 (sha256
89 (base32
90 "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix"))))
91 (build-system gnu-build-system)
92 (inputs
93 `(("python" ,python-wrapper)
94 ("xmlto" ,xmlto)))
95 (home-page "http://yasm.tortall.net/")
96 (synopsis "Rewrite of the NASM assembler")
97 (description
98 "Yasm is a complete rewrite of the NASM assembler.
99
100 Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM
101 and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit
102 Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source
103 debugging information in STABS, DWARF 2, and CodeView 8 formats.")
104 (license (license:non-copyleft "file://COPYING"
105 "See COPYING in the distribution."))))
106
107 (define-public lightning
108 (package
109 (name "lightning")
110 (version "2.1.2")
111 (source (origin
112 (method url-fetch)
113 (uri (string-append "mirror://gnu/lightning/lightning-"
114 version ".tar.gz"))
115 (sha256
116 (base32
117 "0sbs2lm8b9in2m8d52zf0x9gpp40x6r7sl6sha92yq3pr78rwa4v"))))
118 (build-system gnu-build-system)
119 (native-inputs `(("zlib" ,zlib)))
120 (synopsis "Library for generating assembly code at runtime")
121 (description
122 "GNU Lightning is a library that generates assembly language code at
123 run-time. Thus, it is useful in creating Just-In-Time compilers. It
124 abstracts over the target CPU by exposing a standardized RISC instruction set
125 to the clients.")
126 (home-page "https://www.gnu.org/software/lightning/")
127 (license license:gpl3+)))
128
129 (define-public fasm
130 (package
131 (name "fasm")
132 (version "1.73.10")
133 (source
134 (origin
135 (method url-fetch)
136 (uri (string-append "https://flatassembler.net/fasm-"
137 version ".tgz"))
138 (sha256
139 (base32 "1lk8vlr0vg7h8lhiav99paa5a1mi0r2m8agxjmczhhavqhx44c32"))))
140 (build-system gnu-build-system)
141 (arguments
142 `(#:tests? #f ; no tests exist
143 #:strip-binaries? #f ; fasm has no sections
144 #:phases
145 (modify-phases %standard-phases
146 (delete 'configure) ; no "configure" script
147 (replace 'build
148 (lambda _
149 (chdir "source/Linux/")
150 (if (string=? ,(%current-system) "x86_64-linux")
151 ;; Use pre-compiled binaries in top-level directory to build
152 ;; fasm.
153 (invoke "../../fasm.x64" "fasm.asm")
154 (invoke "../../fasm" "fasm.asm"))))
155 (replace 'install
156 (lambda _
157 (let ((out (assoc-ref %outputs "out")))
158 (install-file "fasm" (string-append out "/bin")))
159 #t)))))
160 (supported-systems '("x86_64-linux" "i686-linux"))
161 (synopsis "Assembler for x86 processors")
162 (description
163 "FASM is an assembler that supports x86 and IA-64 Intel architectures.
164 It does multiple passes to optimize machine code. It has macro abilities and
165 focuses on operating system portability.")
166 (home-page "https://flatassembler.net/")
167 (license license:bsd-2)))
168
169 (define-public dev86
170 (package
171 (name "dev86")
172 (version "0.16.21")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "http://v3.sk/~lkundrak/dev86/Dev86src-"
176 version ".tar.gz"))
177 (sha256
178 (base32
179 "154dyr2ph4n0kwi8yx0n78j128kw29rk9r9f7s2gddzrdl712jr3"))))
180 (build-system gnu-build-system)
181 (arguments
182 `(#:parallel-build? #f ; They use submakes wrong
183 #:make-flags (list "CC=gcc"
184 (string-append "PREFIX="
185 (assoc-ref %outputs "out")))
186 #:system "i686-linux" ; Standalone ld86 had problems otherwise
187 #:tests? #f ; No tests exist
188 #:phases
189 (modify-phases %standard-phases
190 (delete 'configure)
191 (add-before 'install 'mkdir
192 (lambda* (#:key outputs #:allow-other-keys)
193 (let ((out (assoc-ref outputs "out")))
194 (mkdir-p (string-append out "/bin"))
195 (mkdir-p (string-append out "/man/man1"))
196 #t))))))
197 (synopsis "Intel 8086 (primarily 16-bit) assembler, C compiler and
198 linker")
199 (description "This package provides a Intel 8086 (primarily 16-bit)
200 assembler, a C compiler and a linker. The assembler uses Intel syntax
201 (also Intel order of operands).")
202 (home-page "https://github.com/jbruchon/dev86")
203 (supported-systems '("i686-linux" "x86_64-linux"))
204 (license license:gpl2+)))