assembly.scm 8.1 KB

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