gnu: rust-percent-encoding-2: Update to 2.2.0.
[jackhill/guix/guix.git] / gnu / packages / mes.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018, 2019, 2020, 2021, 2022 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.07.0")
102 (source (origin
103 (method url-fetch)
104 (uri (string-append "mirror://savannah/nyacc/nyacc-"
105 version ".tar.gz"))
106 (sha256
107 (base32
108 "01qb6h6bk684z8xda5d71q5f5l2z3q9jjz36if3jbpjc7b8dxjap"))
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
161 ;; XXX: Remove GUILE-BYTESTRUCTURES, an optional dependency needed to
162 ;; build the FFI helper, because it fails to build.
163 (propagated-inputs '())
164
165 (inputs (list guile-3.0))))
166
167 (define-public mes
168 (package
169 (name "mes")
170 (version "0.24")
171 (source (origin
172 (method url-fetch)
173 (uri (string-append "mirror://gnu/mes/"
174 "mes-" version ".tar.gz"))
175 (sha256
176 (base32
177 "00lrpm4x5qg0l840zhbf9mr67mqhp8gljcl24j5dy0y109gf32w2"))))
178 (supported-systems '("armhf-linux" "i686-linux" "x86_64-linux"))
179 (propagated-inputs (list mescc-tools nyacc-1.00.2))
180 (native-inputs
181 (append (list guile-3.0)
182 (let ((target-system (or (%current-target-system)
183 (%current-system))))
184 (cond
185 ((string-prefix? "x86_64-linux" target-system)
186 ;; Use cross-compiler rather than #:system "i686-linux" to get
187 ;; MesCC 64 bit .go files installed ready for use with Guile.
188 (list (cross-binutils "i686-unknown-linux-gnu")
189 (cross-gcc "i686-unknown-linux-gnu")))
190 (else
191 '())))
192 (list graphviz help2man
193 m2-planet
194 perl ;build-aux/gitlog-to-changelog
195 texinfo)))
196 (build-system gnu-build-system)
197 (arguments
198 `(#:strip-binaries? #f)) ; binutil's strip b0rkes MesCC/M1/hex2 binaries
199 (native-search-paths
200 (list (search-path-specification
201 (variable "C_INCLUDE_PATH")
202 (files '("include")))
203 (search-path-specification
204 (variable "LIBRARY_PATH")
205 (files '("lib")))
206 (search-path-specification
207 (variable "MES_PREFIX")
208 (separator #f)
209 (files '("")))))
210 (synopsis "Scheme interpreter and C compiler for full source bootstrapping")
211 (description
212 "GNU Mes--Maxwell Equations of Software--brings the Reduced Binary Seed
213 bootstrap to Guix and aims to help create full source bootstrapping for
214 GNU/Linux distributions. It consists of a mutual self-hosting Scheme
215 interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with
216 Guile.")
217 (home-page "https://www.gnu.org/software/mes/")
218 (license gpl3+)))
219
220 (define-public mescc-tools
221 (package
222 (name "mescc-tools")
223 (version "1.4.0")
224 (source (origin
225 (method git-fetch)
226 (uri (git-reference
227 (url "https://git.savannah.nongnu.org/r/mescc-tools.git")
228 (commit (string-append "Release_" version))
229 (recursive? #t))) ;for M2libc
230 (file-name (git-file-name name version))
231 (sha256
232 (base32
233 "0z2ni2qn2np1walcaqlxz8sinzb78d4hiq9glddzf26wxc226hs4"))))
234 (build-system gnu-build-system)
235 (supported-systems '("i686-linux" "x86_64-linux"
236 "armhf-linux" "aarch64-linux"
237 "riscv32-linux" "riscv64-linux"))
238 (arguments
239 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
240 #:test-target "test"
241 #:phases (modify-phases %standard-phases
242 (delete 'configure))))
243 (native-inputs (list which))
244 (synopsis "Tools for the full source bootstrapping process")
245 (description
246 "Mescc-tools is a collection of tools for use in a full source
247 bootstrapping process. It consists of the M1 macro assembler, the hex2
248 linker, the blood-elf symbol table generator, the kaem shell, exec_enable and
249 get_machine.")
250 (home-page "https://savannah.nongnu.org/projects/mescc-tools")
251 (license gpl3+)))
252
253 (define-public m2-planet
254 (package
255 (name "m2-planet")
256 (version "1.9.0")
257 (source (origin
258 (method git-fetch)
259 (uri (git-reference
260 (url "https://github.com/oriansj/m2-planet")
261 (commit (string-append "Release_" version))
262 (recursive? #t))) ;for M2libc
263 (file-name (git-file-name name version))
264 (sha256
265 (base32
266 "0cgvvq91cbxxm93k8ayyvhpaf3c2lv10qw4wyqwn3hc1qb1cfyvr"))))
267 (native-inputs (list mescc-tools))
268 (build-system gnu-build-system)
269 (arguments
270 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
271 ,(string-append "CC=" (cc-for-target)))
272 #:tests? #f
273 #:phases (modify-phases %standard-phases
274 (delete 'bootstrap)
275 (delete 'configure))))
276 (synopsis "The PLAtform NEutral Transpiler")
277 (description
278 "M2-Planet, the PLAtform NEutral Transpiler, when combined with
279 mescc-tools, compiles a subset of the C language into working binaries with
280 introspective steps in between. It is self-hosting and for bootstrapping it
281 also has an implementation in the M1 macro assembly language. M2-Planet is
282 built as Phase-5 of the full source bootstrapping process and is capable of
283 building GNU Mes.")
284 (home-page "https://github.com/oriansj/m2-planet")
285 (license gpl3+)))