gnu: Remove unneeded uses of 'libiconv'.
[jackhill/guix/guix.git] / gnu / packages / mes.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
3 ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2020, 2021, 2022 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
7 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
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 mes)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages base)
27 #:use-module (gnu packages bash)
28 #:use-module (gnu packages bootstrap)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages cross-base)
31 #:use-module (gnu packages gcc)
32 #:use-module (gnu packages graphviz)
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages man)
35 #:use-module (gnu packages package-management)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages texinfo)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix licenses)
43 #:use-module (guix packages)
44 #:use-module (guix utils))
45
46 (define-public nyacc-0.86
47 ;; Nyacc used for bootstrap.
48 (package
49 (name "nyacc")
50 (version "0.86.0")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append "mirror://savannah/nyacc/"
54 name "-" version ".tar.gz"))
55 (patches (search-patches "nyacc-binary-literals.patch"))
56 (sha256
57 (base32
58 "0lkd9lyspvhxlfs0496gsllwinh62jk9wij6gpadvx9gwz6yavd9"))))
59 (build-system gnu-build-system)
60 (native-inputs (list guile-2.2))
61 (synopsis "LALR(1) Parser Generator in Guile")
62 (description
63 "NYACC is an LALR(1) parser generator implemented in Guile.
64 The syntax and nomenclature should be considered not stable. It comes with
65 extensive examples, including parsers for the Javascript and C99 languages.")
66 (home-page "https://savannah.nongnu.org/projects/nyacc")
67 (license (list gpl3+ lgpl3+))))
68
69 (define-public nyacc-0.99
70 (package
71 (inherit nyacc-0.86)
72 (version "0.99.0")
73 (source (origin
74 (method url-fetch)
75 (uri (string-append "mirror://savannah/nyacc/nyacc-"
76 version ".tar.gz"))
77 (sha256
78 (base32
79 "0hl5qxx19i4x1r0839sxm19ziqq65g4hy97yik81cc2yb9yvgyv3"))
80 (modules '((guix build utils)))
81 (snippet
82 '(begin
83 (substitute* (find-files "." "^Makefile\\.in$")
84 (("^SITE_SCM_DIR =.*")
85 "SITE_SCM_DIR = \
86 @prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
87 (("^SITE_SCM_GO_DIR =.*")
88 "SITE_SCM_GO_DIR = \
89 @prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")
90 (("^INFODIR =.*")
91 "INFODIR = @prefix@/share/info\n")
92 (("^DOCDIR =.*")
93 "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
94 #t))))
95 (native-inputs (list pkg-config))
96 (inputs (list guile-2.2))))
97
98 (define-public nyacc
99 (package
100 (inherit nyacc-0.99)
101 (version "1.06.5")
102 (source (origin
103 (method url-fetch)
104 (uri (string-append "mirror://savannah/nyacc/nyacc-"
105 version ".tar.gz"))
106 (sha256
107 (base32
108 "1fbzz9bm4mkz4j40l2z02zjlbqj82dmv2ayz83zl3j8gj6z3lpdg"))
109 (modules '((guix build utils)))
110 (snippet
111 '(substitute* "configure"
112 (("GUILE_GLOBAL_SITE=\\$prefix.*")
113 "GUILE_GLOBAL_SITE=\
114 $prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION\n")))))
115 (arguments
116 '(#:phases
117 (modify-phases %standard-phases
118 ;; See https://savannah.nongnu.org/bugs/index.php?60474
119 (add-after 'unpack 'fix-60474
120 (lambda _
121 (substitute* "module/nyacc/lang/c99/parser.scm"
122 (("\\(memq \\(car stmt\\) '\\(include include-next\\)\\)")
123 "(memq (car stmt) '(include include-next define))")))))))
124 (inputs (list guile-3.0))
125 (propagated-inputs (list guile-bytestructures))
126 (description
127 "@acronym{NYACC, Not Yet Another Compiler Compiler} is set of Guile modules
128 for generating parsers and lexical analyzers. It provides sample parsers,
129 pretty-printers using SXML trees as an intermediate representation, a decent C
130 parser and an `FFI Helper' tool to help create Guile Scheme bindings for C-based
131 libraries. It also provides (partially implemented) compilers based on these
132 parsers to allow execution with Guile as extension languages.")))
133
134 (define-public nyacc-1.00.2
135 (package
136 (inherit nyacc)
137 (version "1.00.2")
138 (source (origin
139 (method url-fetch)
140 (uri (string-append "mirror://savannah/nyacc/nyacc-"
141 version ".tar.gz"))
142 (modules '((guix build utils)))
143 (snippet
144 '(begin
145 (substitute* (find-files "." "^Makefile\\.in$")
146 (("^SITE_SCM_DIR =.*")
147 "SITE_SCM_DIR = \
148 @prefix@/share/guile/site/@GUILE_EFFECTIVE_VERSION@\n")
149 (("^SITE_SCM_GO_DIR =.*")
150 "SITE_SCM_GO_DIR = \
151 @prefix@/lib/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n")
152 (("^INFODIR =.*")
153 "INFODIR = @prefix@/share/info\n")
154 (("^DOCDIR =.*")
155 "DOCDIR = @prefix@/share/doc/$(PACKAGE_TARNAME)\n"))
156 #t))
157 (sha256
158 (base32
159 "065ksalfllbdrzl12dz9d9dcxrv97wqxblslngsc6kajvnvlyvpk"))))
160 (inputs (list guile-3.0))))
161
162 (define-public mes
163 (package
164 (name "mes")
165 (version "0.23")
166 (source (origin
167 (method url-fetch)
168 (uri (string-append "mirror://gnu/mes/"
169 "mes-" version ".tar.gz"))
170 (sha256
171 (base32
172 "0mnryfkl0dwbr5gxp16j5s95gw7z1vm1fqa1pxabp0aiar1hw53s"))))
173 (supported-systems '("armhf-linux" "i686-linux" "x86_64-linux"))
174 (propagated-inputs (list mescc-tools nyacc-1.00.2))
175 (native-inputs
176 (append (list guile-3.0)
177 (let ((target-system (or (%current-target-system)
178 (%current-system))))
179 (cond
180 ((string-prefix? "x86_64-linux" target-system)
181 ;; Use cross-compiler rather than #:system "i686-linux" to get
182 ;; MesCC 64 bit .go files installed ready for use with Guile.
183 (list (cross-binutils "i686-unknown-linux-gnu")
184 (cross-gcc "i686-unknown-linux-gnu")))
185 (else
186 '())))
187 (list graphviz help2man
188 perl ;build-aux/gitlog-to-changelog
189 texinfo)))
190 (build-system gnu-build-system)
191 (arguments
192 `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
193 (native-search-paths
194 (list (search-path-specification
195 (variable "C_INCLUDE_PATH")
196 (files '("include")))
197 (search-path-specification
198 (variable "LIBRARY_PATH")
199 (files '("lib")))
200 (search-path-specification
201 (variable "MES_PREFIX")
202 (separator #f)
203 (files '("")))))
204 (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
205 (description
206 "GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
207 bootstrap to Guix and aims to help create full source bootstrapping for
208 GNU/Linux distributions. It consists of a mutual self-hosting Scheme
209 interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with
210 Guile.")
211 (home-page "https://www.gnu.org/software/mes/")
212 (license gpl3+)))
213
214 (define-public mescc-tools
215 (package
216 (name "mescc-tools")
217 (version "1.2.0")
218 (source (origin
219 (method git-fetch)
220 (uri (git-reference
221 (url "https://git.savannah.nongnu.org/r/mescc-tools.git")
222 (commit (string-append "Release_" version))
223 (recursive? #t))) ;for M2libc
224 (file-name (git-file-name name version))
225 (sha256
226 (base32
227 "1xkn5sspfxldy4wm8fq8gd8kwn46578zhfl12c16pq74x21zb198"))))
228 (build-system gnu-build-system)
229 (supported-systems '("i686-linux" "x86_64-linux"
230 "armhf-linux" "aarch64-linux"
231 "powerpc64le-linux"))
232 (arguments
233 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
234 #:test-target "test"
235 #:phases (modify-phases %standard-phases
236 (delete 'configure))))
237 (native-inputs (list which))
238 (synopsis "Tools for the full source bootstrapping process")
239 (description
240 "Mescc-tools is a collection of tools for use in a full source
241 bootstrapping process. It consists of the M1 macro assembler, the hex2
242 linker, the blood-elf symbol table generator, the kaem shell, exec_enable and
243 get_machine.")
244 (home-page "https://savannah.nongnu.org/projects/mescc-tools")
245 (license gpl3+)))
246
247 (define-public m2-planet
248 (package
249 (name "m2-planet")
250 (version "1.8.0")
251 (source (origin
252 (method git-fetch)
253 (uri (git-reference
254 (url "https://github.com/oriansj/m2-planet")
255 (commit (string-append "Release_" version))
256 (recursive? #t))) ;for M2libc
257 (file-name (git-file-name name version))
258 (sha256
259 (base32
260 "0525fhijrjljgaabmgsjy8yk2pmh5zf8lwa44wpvkjc18knl7nza"))))
261 (native-inputs (list mescc-tools))
262 (build-system gnu-build-system)
263 (arguments
264 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
265 ,(string-append "CC=" (cc-for-target)))
266 #:tests? #f
267 #:phases (modify-phases %standard-phases
268 (delete 'bootstrap)
269 (delete 'configure))))
270 (synopsis "The PLAtform NEutral Transpiler")
271 (description
272 "M2-Planet, the PLAtform NEutral Transpiler, when combined with
273 mescc-tools, compiles a subset of the C language into working binaries with
274 introspective steps in between. It is self-hosting and for bootstrapping it
275 also has an implementation in the M1 macro assembly language. M2-Planet is
276 built as Phase-5 of the full source bootstrapping process and is capable of
277 building GNU Mes.")
278 (home-page "https://github.com/oriansj/m2-planet")
279 (license gpl3+)))